webstart_hilite added, var for multiple topbanner big banner added
[brisk.git] / web / briskin5 / Obj / briskin5.phh
index 024e8cd..c1c0f5b 100644 (file)
@@ -2,9 +2,9 @@
 define(BRISKIN5_PLAYERS_N, 3);
 define(BRISKIN5_MAX_PLAYERS, BRISKIN5_PLAYERS_N);
 // define(BRISKIN5_SHM_MIN, (50000 * BRISKIN5_MAX_PLAYERS));
-define(BRISKIN5_SHM_MIN, 10000);
+define(BRISKIN5_SHM_MIN, 32768);
 define(BRISKIN5_SHM_MAX, (BRISKIN5_SHM_MIN + 1048576));
-define(BRISKIN5_SHM_DLT, 65536);
+define(BRISKIN5_SHM_DLT, 32768);
 
 class Briskin5 {
   var $user;
@@ -191,7 +191,6 @@ class Briskin5 {
       if (($shm = shm_attach($bri->tok, $bri->shm_sz)) == FALSE)
        break;
       
-      // log_only("PUT_VAR DI ".strlen(serialize($room)));
       if (@shm_put_var($shm, $bri->tok, $bri) != FALSE) {
        shm_detach($shm);
        return (TRUE);
@@ -204,6 +203,8 @@ class Briskin5 {
       $bri->shm_sz += BRISKIN5_SHM_DLT;
     } 
 
+    log_crit("save data failed!");
+
     if ($shm)
       shm_detach($shm);
     
@@ -212,42 +213,6 @@ class Briskin5 {
 
 
 
-  function save_data_orig(&$bri) 
-  {
-    GLOBAL $sess;
-    
-    $ret =   FALSE;
-    $shm =   FALSE;
-    $isacq = FALSE;
-    
-    log_main("SAVE BRISKIN5 DATA");
-    // var_dump($bri);
-    
-    if (!isset($bri->tok))
-      return (FALSE);
-    
-    do {
-      $isacq = TRUE;
-      
-      if (($shm = shm_attach($bri->tok, BRISKIN5_SHM_DIMS)) == FALSE)
-       break;
-      
-      // log_only("PUT_VAR DI ".strlen(serialize($bri)));
-      if (shm_put_var($shm, $bri->tok, $bri) == FALSE) {
-       log_only("PUT_VAR FALLITA ".strlen(serialize($bri)));
-       log_only(serialize($bri));
-       break;
-      }
-      // log_main("QUI CI ARRIVA [".$bri->user[0]->name."]");
-      $ret = TRUE;
-    } while (0);
-    
-    if ($shm)
-      shm_detach($shm);
-    
-    return ($ret);
-  }
-
   function destroy_data($table_idx) 
   {
     GLOBAL $sess;
@@ -290,12 +255,12 @@ class Briskin5 {
     log_wr("LOCK_DATA ".FTOK_PATH."/table".$table_idx);
     //  echo "LOCK: ".FTOK_PATH."/main";
     //  exit;
-    // FIXME monitor this step
+    // WARNING monitor this step
     if (($tok = @ftok(FTOK_PATH."/table".$table_idx, "B")) == -1) {
       echo "FTOK FAILED";
       exit;
     }
-    // FIXME monitor this step
+    // WARNING monitor this step
     if (($res = @sem_get($tok)) == FALSE) {
       echo "SEM_GET FAILED";
       exit;
@@ -328,15 +293,15 @@ class Briskin5 {
     
     $user_mesg = substr($mesg,6);
     
-    $timecur = time();
+    $curtime = time();
     
-    $dt = date("H:i ", $timecur);
+    $dt = date("H:i ", $curtime);
     if (strncmp($user_mesg, "/nick ", 6) == 0) {
       log_main($user->sess." chatt_send BEGIN");
 
       if (($name_new = validate_name(substr($user_mesg, 6))) == FALSE) {
          $user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; ";
-         $user->comm[$user->step % COMM_N] .= sprintf('chatt_sub("%s","Il nickname deve contenere almeno una lettera o una cifra.");', $dt.NICKSERV, xcape($name_new));
+         $user->comm[$user->step % COMM_N] .= sprintf('chatt_sub("%s","Il nickname deve contenere almeno una lettera dell\'alfabeto o una cifra.");', $dt.NICKSERV);
          $user->step_inc();
 
          return;
@@ -417,7 +382,7 @@ class Briskin5 {
                                                             $dt.xcape($user->name), xcape($user_mesg));
        $user_cur->step_inc();
       }
-      log_legal($timecur, $user->sess, $user->name, 
+      log_legal($curtime, $user->sess, $user->name, 
                ($user->stat == 'room' ? 'room' : 'table '.$user->table),$user_mesg);
     }
   }
@@ -495,4 +460,4 @@ function locshm_exists($tok)
 }
 
 
-?>
\ No newline at end of file
+?>