- else {
- $user->comm[$user->step % COMM_N] .= show_notify($mlang_indwr['badsit_a'][$G_lang].secstoword($bantime - $user->laccwr).$mlang_indwr['badsit_a'][$G_lang], 2000, $mlang_indwr['btn_stays'][$G_lang], 400, 180);
- }
- $user->step_inc();
- Room::save_data($room);
- Room::unlock_data($sem);
- exit;
- }
-
- if ($table->player_n == PLAYERS_N) {
- log_wr("WARN:FSM: Sitdown unreachable, table full.");
- Room::unlock_data($sem);
- exit;
- }
-
- // set new status
- $user->subst = "sitdown";
- $user->table = $table_idx;
- $user->table_pos = $table->user_add($idx);
-
- log_wr("MOP before");
-
- if ($table->player_n == PLAYERS_N) {
- require_once("briskin5/Obj/briskin5.phh");
- log_wr("MOP inall");
-
- // Start game for this table.
- log_wr("Start game!");
-
- //
- // START THE SPAWN HERE!!!!
- //
-
- // Create new spawned table
- $bri_sem = Briskin5::lock_data($table_idx);
- $table_token = uniqid("");
- $room->table[$table_idx]->table_token = $table_token;
- $room->table[$table_idx]->table_start = $curtime;
-
- $plist = "$table_token|$user->table|$table->player_n";
- for ($i = 0 ; $i < $table->player_n ; $i++) {
- $plist .= '|'.$room->user[$table->player[$i]]->sess;
- }
- log_legal($curtime, $user, "STAT:CREATE_GAME", $plist);
-
- if (($bri =& new Briskin5(&$room, $table_idx, $table_token)) == FALSE)
- log_wr("bri create: FALSE");
- else
- log_wr("bri create: ".serialize($bri));
+ else if ($argz[0] == 'about') {
+ $user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; ";
+ $user->comm[$user->step % COMM_N] .= show_notify(str_replace("\n", " ", $G_room_about[$G_lang]), 0, $mlang_indwr['btn_backtotab'][$G_lang], 400, 200);
+
+ log_wr($user->comm[$user->step % COMM_N]);
+ $user->step_inc();
+
+ }
+ else if ($argz[0] == 'placing') {
+ require_once("briskin5/Obj/briskin5.phh");
+ require_once("briskin5/Obj/placing.phh");
+
+ $user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; ";
+ $user->comm[$user->step % COMM_N] .= show_notify_ex(str_replace("\n", " ", placings_show($user)), 0, $mlang_indwr['btn_backtotab'][$G_lang], 800, 600, TRUE, 0);
+
+ log_wr($user->comm[$user->step % COMM_N]);
+ $user->step_inc();
+ }
+ else if ($argz[0] == 'roadmap') {
+ $user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; ";
+ $user->comm[$user->step % COMM_N] .= show_notify(str_replace("\n", " ", $G_room_roadmap[$G_lang]), 0, $mlang_indwr['btn_backtotab'][$G_lang], 400, 200);
+
+ log_wr($user->comm[$user->step % COMM_N]);
+ $user->step_inc();
+
+ }
+ else if ($argz[0] == 'whysupport') {
+ $user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; ";
+ $user->comm[$user->step % COMM_N] .= show_notify(str_replace("\n", " ", $G_room_whysupport[$G_lang]), 0, $mlang_indwr['btn_backtotab'][$G_lang], 400, 200);
+
+ log_wr($user->comm[$user->step % COMM_N]);
+ $user->step_inc();
+
+ }
+ else if ($argz[0] == 'chatt') {
+ $brisk->chatt_send($user, xcapemesg($mesg));
+ }
+ else if ($argz[0] == 'tosmgr') {
+ // check IF is authnticated user, both terms of service versions matches
+ if ($user->is_auth() && count($argz) == 5) {
+ $f_type = $argz[1]; $f_code = $argz[2];
+ $f_tos_curr = $argz[3]; $f_tos_vers = $argz[4];
+
+ if ("$f_tos_curr" == $user->rec->tos_vers_get() &&
+ "$f_tos_vers" == "$G_tos_vers") {
+ if ("$f_type" == "soft" || "$f_type" == "hard") {
+ $res = 100;
+ switch ($f_code) {
+ case LICMGR_CHO_ACCEPT:
+ $user->rec->tos_vers_set($G_tos_vers);
+ $res = $user->tos_store();
+ break;
+ case LICMGR_CHO_REFUSE:
+ $user->flags_set(USER_FLAG_TY_DISABLE, USER_FLAG_TY_ALL);
+ $user->rec->disa_reas_set(USER_DIS_REA_LICENCE);
+ $res = $user->state_store();
+
+ $user->comm[$user->step % COMM_N] = $user->blocking_error(TRUE);
+ $user->the_end = TRUE;
+ $user->step_inc();
+ break;
+ }
+ }
+ }
+ }
+ }
+ /**********************
+ * *
+ * SUBST: standup *
+ * *
+ **********************/
+ else if ($user->subst == 'standup') {
+ if ($argz[0] == 'sitdown') {
+ log_wr("SITDOWN command");
+
+ if ($user->the_end == TRUE) {
+ log_wr("INFO:SKIP:argz == sitdown && ->the_end == TRUE => ignore request.");
+ return FALSE;
+ }
+
+ // Take parameters
+ $table_idx = (int)$argz[1];
+ $table = &$brisk->table[$table_idx];
+
+ $not_allowed_msg = "";
+ if ($G_shutdown) {
+ $not_allowed_msg = nickserv_msg($dt, $mlang_indwr['shutmsg'][$G_lang]);
+ }
+ else if ($table->wakeup_time > $curtime) {
+ $not_allowed_msg = nickserv_msg($dt, sprintf($mlang_indwr['tabwait'][$G_lang],
+ $table->wakeup_time - $curtime));
+ }
+ else if ( $table->auth_type == TABLE_AUTH_TY_CERT &&
+ (!$user->is_cert() || $user->is_appr()) ) {
+ $not_allowed_msg = nickserv_msg($dt, $mlang_indwr['mustcert'][$G_lang]);
+ }
+ else if ( $table->auth_type == TABLE_AUTH_TY_AUTH &&
+ (!$user->is_auth() || $user->is_appr()) ) {
+ $not_allowed_msg = nickserv_msg($dt, $mlang_indwr['mustauth'][$G_lang]);
+ }
+ else if ($user->flags & USER_FLAG_TY_FIRONLY && $table->player_n > 0) {
+ $not_allowed_msg = nickserv_msg($dt, $mlang_indwr['mustfirst'][$G_lang]);
+ }
+ if ($not_allowed_msg != "") {
+ $user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; ".$not_allowed_msg;
+ $user->step_inc();
+ return TRUE;
+ }
+
+ /* TODO: refact to a function */
+ // if ($user->bantime > $user->laccwr) {
+ require_once("Obj/hardban.phh");
+
+ if (($bantime = Hardbans::check(($user->is_auth() ? $user->name : FALSE),
+ $user->ip, $user->sess)) != -1) {
+ $user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; ";
+ /* MLANG: "<br>Ti sei alzato da un tavolo senza il consenso degli altri giocatori. <br><br>Dovrai aspettare ancora ".secstoword($user->bantime - $user->laccwr)." prima di poterti sedere nuovamente.", "resta in piedi.", "<br>Tu o qualcuno col tuo stesso indirizzo IP si è alzato da un tavolo senza il consenso degli altri giocatori.<br><br>Dovrai aspettare ancora ".secstoword($bantime - $user->laccwr)." prima di poterti sedere nuovamente.<br><br>Se non sei stato tu ad alzarti e possiedi un login con password, autenticandoti con quello, potrai accedere." */
+ if ($user->is_auth()) {
+ $user->comm[$user->step % COMM_N] .= show_notify($mlang_indwr['badwake_a'][$G_lang].secstoword($bantime - $user->laccwr).$mlang_indwr['badwake_b'][$G_lang], 2000, $mlang_indwr['btn_stays'][$G_lang], 400, 140);
+ }
+ else {
+ $user->comm[$user->step % COMM_N] .= show_notify($mlang_indwr['badsit_a'][$G_lang].secstoword($bantime - $user->laccwr).$mlang_indwr['badsit_a'][$G_lang], 2000, $mlang_indwr['btn_stays'][$G_lang], 400, 180);
+ }
+ $user->step_inc();
+ return TRUE;
+ }
+
+ if ($table->player_n == PLAYERS_N) {
+ log_wr("WARN:FSM: Sitdown unreachable, table full.");
+ return FALSE;
+ }
+
+ // set new status
+ $user->subst = "sitdown";
+ $user->table = $table_idx;
+ $user->table_pos = $table->user_add($idx);
+
+ log_wr("MOP before");
+
+ if ($table->player_n == PLAYERS_N) {
+ require_once("briskin5/Obj/briskin5.phh");
+ log_wr("MOP inall");
+
+ // Start game for this table.
+ log_wr("Start game!");