- if ($again == FALSE) {
- log_wr($sess, "NUOVI ORZI.");
- $user->asta_card = $a_card;
- $table->asta_card = $a_card;
- if ($a_card == 9) {
- $user->asta_pnt = $a_pnt;
- $table->asta_pnt = $a_pnt;
- }
- }
- }
-
-
-
- if ($again) { // Qualcosa non andato bene, rifare
- log_wr($sess, "Ripetere.");
- }
- else {
- /* next step */
- $showst = "show_astat(";
- for ($i = 0 ; $i < PLAYERS_N ; $i++) {
- $user_cur = &$bri->user[$table->player[$i]];
- $showst .= sprintf("%s%d", ($i == 0 ? "" : ", "),
- ($user_cur->asta_card < 9 ? $user_cur->asta_card : $user_cur->asta_pnt));
- }
- if (PLAYERS_N == 3)
- $showst .= ",-2,-2";
- $showst .= ");";
-
- $maxcard = -2;
- for ($i = 0 ; $i < PLAYERS_N ; $i++) {
- $user_cur = &$bri->user[$table->player[$i]];
- if ($maxcard < $user_cur->asta_card)
- $maxcard = $user_cur->asta_card;
- }
-
- if (($table->asta_pla_n > ($maxcard > -1 ? 1 : 0)) &&
- !($table->asta_card == 9 && $table->asta_pnt == 120)) {
- log_wr($sess,"ALLOPPA QUI");
- for ($i = 1 ; $i < PLAYERS_N ; $i++) {
- $index_next = ($table->gstart + $i) % PLAYERS_N;
- if ($table->asta_pla[$index_next]) {
- log_wr($sess,"GSTART 1");
- $table->gstart += $i;
- break;
- }
- }
-
-
- for ($i = 0 ; $i < PLAYERS_N ; $i++) {
- $user_cur = &$bri->user[$table->player[$i]];
- $ret = sprintf('gst.st = %d; %s', $user_cur->step+1, $showst);
- if ($user_cur->table_pos == ($table->gstart % PLAYERS_N))
- $ret .= sprintf('dispose_asta(%d,%d); remark_on();',
- $table->asta_card + 1, $table->asta_pnt+1);
- else
- $ret .= sprintf('dispose_asta(%d,%d); remark_off();',
- $table->asta_card + 1, -($table->asta_pnt+1));
- $user_cur->comm[$user_cur->step % COMM_N] = $ret;
- $user_cur->step++;
- }
- }
- else if ($table->asta_pla_n == 0) {
- log_wr($sess, "MOLLANO TUTTI!");
-
- log_wr($sess, sprintf("GIOCO FINITO !!!"));
-
- $table->mult *= 2;
-
- $table->game_next();
- $table->game_init(&$bri);
-
- for ($i = 0 ; $i < PLAYERS_N ; $i++) {
- $user_cur = &$bri->user[$table->player[$i]];
-
- $ret = sprintf('gst.st = %d;', $user_cur->step+1);
- $ret .= show_table(&$bri,&$user_cur,$user_cur->step+1, TRUE, TRUE);
- $user_cur->comm[$user_cur->step % COMM_N] = $ret;
- $user_cur->step++;
- }
- }
- else {
- log_wr($sess, "FINITA !");
- // if a_pnt == 120 supergame ! else abbandono
- if ($a_pnt == 120 || $user->asta_card != -1) {
- $chooser = $index_cur;
- for ($i = 1 ; $i < PLAYERS_N ; $i++)
- if ($i != $chooser)
- $table->asta_pla[$i] = FALSE;
- }
- else {
- $user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; dispose_asta(".($table->asta_card + 1).",".-($table->asta_pnt)."); remark_off();";
- $user->step++;
- for ($i = 1 ; $i < PLAYERS_N ; $i++) {
- $chooser = ($table->gstart + $i) % PLAYERS_N;
- if ($table->asta_pla[$chooser]) {
- break;
- }
- }
- }
- $table->asta_win = $chooser;
-
- for ($i = 0 ; $i < PLAYERS_N ; $i++) {
- $user_cur = &$bri->user[$table->player[$i]];
- $ret = sprintf('gst.st = %d; %s', $user_cur->step+1, $showst);
-
- if ($i == $chooser) {
- $ret .= "choose_seed(". $table->asta_card."); \$(\"asta\").style.visibility = \"hidden\"; remark_on();";
- }
- else {
- $ret .= "remark_off();";
- }
-
- $user_cur->comm[$user_cur->step % COMM_N] = $ret;
- $user_cur->step++;
- }
- }
+ log_rd2("AUTO LOGOUT.");
+ if ($user->subst == 'sitdown' || $user->stat == 'table')
+ $room->room_wakeup(&$user);
+ else if ($user->subst == 'standup')
+ $room->room_outstandup(&$user);
+ else
+ log_rd2("SHUTDOWN FROM WHAT ???");
+}
+else if ($argz[0] == 'warranty') {
+ GLOBAL $cli_name, $cli_email;
+
+ $curtime = time();
+ $mesg_to_user = "";
+
+ log_wr("INFO:SKIP:argz == warranty name: [".$cli_name."] AUTH: ".($user->flags & USER_FLAG_AUTH));
+ if ($user->flags & USER_FLAG_AUTH) {
+ if (($wa_lock = Warrant::lock_data()) != FALSE) {
+ if (($fp = @fopen(LEGAL_PATH."/warrant.txt", 'a')) != FALSE) {
+ /* Unix time | session | nickname | IP | where was | mesg */
+ fwrite($fp, sprintf("%ld|%s|%s|%s|\n", $curtime, $user->name, xcapelt(urldecode($cli_name)), xcapelt(urldecode($cli_email))));
+ fclose($fp);