- 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++;
- }
- }
+ if ($mesg_to_user != "") {
+ $user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; ";
+
+ $dt = date("H:i ", $curtime);
+ $user->comm[$user->step % COMM_N] .= $mesg_to_user;
+ $user->step_inc();
+ }
+}
+else if ($argz[0] == 'mesgtoadm') {
+ GLOBAL $cli_subj, $cli_mesg;
+
+ $curtime = time();
+ $mesg_to_user = "";
+
+ log_wr("INFO:SKIP:argz == mesgtoadm 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."/messages.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_subj)), xcapelt(urldecode($cli_mesg))));
+ fclose($fp);