+
+ //
+ // Compute actions
+ //
+
+ $to_user = FALSE;
+ $to_all = FALSE;
+ $to_room = FALSE;
+ $to_tabl = FALSE;
+ $update_room = FALSE;
+
+ if (strcmp($msg, "/tav") == 0 ||
+ strncmp($msg, "/tav ", 5) == 0) {
+ do {
+ if ($user->stat != 'room' || $user->subst != 'sitdown') {
+ $msg = "<br>Per attivare il messaggio di segnalazione del tavolo occorre essere seduti.<br><br>";
+ $to_user = show_notify($msg, 0, "chiudi", 400, 100);
+
+ break;
+ }
+
+ $table = &$this->table[$user->table];
+
+ if ($table->wag_own != NULL) {
+ $msg = "<br>Il messaggio di segnalazione del tavolo è già attivato.<br><br>";
+ $to_user = show_notify($msg, 0, "chiudi", 400, 100);
+
+ break;
+ }
+
+ $dtime = $timecur - $table->wag_tout;
+ if ($dtime < EXPIRE_TIME_WAG) {
+ $msg = sprintf("<br>Il messaggio di segnalazione del tavolo<br>è disattivato ancora per %d second%s.<br><br>",
+ EXPIRE_TIME_WAG - $dtime, (EXPIRE_TIME_WAG - $dtime == 1 ? "o" : "i"));
+ $to_user = show_notify($msg, 0, "chiudi", 400, 100);
+
+ break;
+ }
+
+ $msg = substr($msg, 5);
+
+ $table->wag_set($user, $msg);
+ $to_user = sprintf('tra.add(%d, "%s");', $user->table, xcape(sprintf("%s: %s", $user->name, $msg)));
+ $to_room = $to_user;
+
+ } while (0);
+ } // /tav chat command
+
+ else if (strncmp($msg, "/alarm ", 7) == 0) {
+ $alarm_check = "/alarm ".$G_alarm_passwd." ";
+ do {
+ if (strncmp($msg, $alarm_check, strlen($alarm_check)) != 0) {
+ $msg = "<br>La password digitata non è corretta.<br><br>";
+ $to_user = show_notify($msg, 0, "chiudi", 400, 100);
+
+ break;
+ }
+
+ $to_user = sprintf('chatt_sub("%s","Alarm <b>%s</b> inviato a tutti.");',
+ $dt.NICKSERV, xcape(substr($msg, strlen($alarm_check))));
+
+ // $msg = "<br><b>".$dt.NICKSERV."<br><br>".xcape(substr($msg, strlen($alarm_check)))."</b><br><br>";
+ $msg = sprintf("<br><b>%s%s<br><br>%s</b><br><br>",
+ $dt, NICKSERV, xcape(substr($msg, strlen($alarm_check))));
+ $to_all = show_notify($msg, 0, "chiudi", 400, 120);
+ } while (0);
+ } // /alarm chat command
+
+ else if (strncmp($msg, "/nick ", 6) == 0) {