X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fbrisk.phh;h=44b00f416331a90b4a1d8db88f7b51fe4538fa8b;hb=75db386ed459aa061fdf6d89a5aa1dc62f5bcc2d;hp=53c46a76d990c1a4f46ac351259d0dd148a98351;hpb=507a79a6e6c512a2b0ac0af6e067f5a8845b7d9c;p=brisk.git
diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh
index 53c46a7..44b00f4 100644
--- a/web/Obj/brisk.phh
+++ b/web/Obj/brisk.phh
@@ -141,12 +141,12 @@ $mlang_brisk = array( 'btn_backstand'=> array( 'it' => 'torna in piedi',
$G_lng = langtolng($G_lang);
$G_all_points = array( 11,10,4,3,2, 0,0,0,0,0 );
-$G_brisk_version = "4.6.0";
+$G_brisk_version = "4.8.0";
/* MLANG: ALL THE INFO STRINGS IN brisk.phh */
-$root_wellarr = array( 'it' => array ( 'Brisk (Ver. '.$G_brisk_version.'), NOVITA\': aggiunti script di avvio automatico, gestione dei segnali e logging dell\' ultima connessione.',
+$root_wellarr = array( 'it' => array ( 'Brisk (Ver. '.$G_brisk_version.'), NOVITA\': prova il nuovo azioni->preferenze.',
'Se vuoi iscriverti alla Mailing List, cliccala!' ),
- 'en' => array ( 'Brisk (Ver. '.$G_brisk_version.'), NEWS: usage of reader/writer locking instead of generic exclusive locking.',
+ 'en' => array ( 'Brisk (Ver. '.$G_brisk_version.'), NEWS: server-side infrastructure to manage user preferences added and S customization added.',
'If you want to subscribe our Mailing List, click it!' ) );
$G_room_help = array( 'it' => '
@@ -601,11 +601,6 @@ class Table {
}
}
-
-
- // $ret .= table_act_content(($user->subst == 'standup'), $this->table[$i]->player_n, $i, $user->table,
- // ($this->table[$i]->auth_only == FALSE ? TRUE : $user->flags & USER_FLAG_AUTH));
-
// function act_content($isstanding, $sitted, $table, $cur_table, $allowed)
function act_content($user)
{
@@ -727,7 +722,12 @@ class Client_prefs {
{
fprintf(STDERR, "QQ %s: %x\n", __FUNCTION__, $user->flags);
$this->listen = ($user->flags & USER_FLAG_MAP_AUTH) >> 2;
- $this->supp_comp = $user->rec->supp_comp;
+ if ($user->rec != FALSE) {
+ $this->supp_comp = $user->rec->supp_comp;
+ }
+ else {
+ $this->supp_comp = "000000000000";
+ }
fprintf(STDERR, "QQ %s: LISTEN: %d\n", __FUNCTION__, $this->listen);
}
@@ -770,11 +770,11 @@ class Client_prefs {
{
// save into DB
fprintf(STDERR, "QQ %s::%s PRE: %x\n", __CLASS__, __FUNCTION__,
- $user->flags & (~USER_FLAG_S_ALL & ~USER_FLAG_AUTH));
+ $user->flags & (~USER_FLAG_AUTH));
$user->flags_set(($this->listen << 2), USER_FLAG_MAP_AUTH);
fprintf(STDERR, "QQ %s::%s %x\n", __CLASS__, __FUNCTION__,
$user->flags);
- if ($user->rec != FALSE && $user->rec->last_dona > 1356994800) {
+ if ($user->is_supp_custom()) {
$user->rec->supp_comp = $this->supp_comp;
}
if ($is_save)
@@ -958,7 +958,7 @@ class Room
if ($user_cur->sess == "")
continue;
-
+
if ($user_cur->lacc + EXPIRE_TIME_RD < ($curtime - $delta)) {
// Auto logout dell'utente
log_rd2("AUTO LOGOUT.".($user_cur->lacc + EXPIRE_TIME_RD)." curtime - delta ".($curtime - $delta));
@@ -1038,8 +1038,6 @@ class Room
for ($i = 0 ; $i < TABLES_N ; $i++) {
$ret .= $this->table_content($user, $i);
- // $ret .= table_act_content(($user->subst == 'standup'), $this->table[$i]->player_n, $i, $user->table,
- // ($this->table[$i]->auth_only == FALSE ? TRUE : $user->flags & USER_FLAG_AUTH));
$ret .= $this->table[$i]->act_content($user);
if ($this->table[$i]->wag_own != -1)
$ret .= sprintf('tra.add(%d, "%s: %s"); ', $i, $this->user[$this->table[$i]->wag_own]->name, $this->table[$i]->wag_com);
@@ -1103,7 +1101,7 @@ class Room
$user_cur = $this->user[$i];
if ($user_cur->sess == '' || $user_cur->stat != 'room')
continue;
-
+
// log_main("VALORI: name: ".$user_cur->name."from_table: ".$from_table." tab: ".$user_cur->table." taix: ".$table_idx." ucur: ".$user_cur." us: ".$user);
$ret = "gst.st = ".($user_cur->step+1)."; ".($remove_wagon ? sprintf("tra.rem(%d);",$table_idx) : "");
@@ -1127,15 +1125,11 @@ class Room
// clean the action buttons in other tables
for ($e = 0 ; $e < TABLES_N ; $e++) {
if ($this->table[$e]->player_n < PLAYERS_N) {
- // $ret .= table_act_content(TRUE, 0, $e, $user->table,
- // ($this->table[$e]->auth_only == FALSE ? TRUE : $user->flags & USER_FLAG_AUTH));
$ret .= $this->table[$e]->act_content($user);
}
}
}
else {
- // $ret .= table_act_content(($user_cur->subst == 'standup'), $table->player_n, $table_idx, $user_cur->table,
- // ($table->auth_only == FALSE ? TRUE : $user_cur->flags & USER_FLAG_AUTH));
$ret .= $table->act_content($user_cur);
}
}
@@ -1210,8 +1204,6 @@ class Room
$ret .= $this->table_content($user_cur, $table_idx);
$ret .= $this->standup_content($user_cur);
- // $ret .= table_act_content(FALSE, 0, $table_idx, $user_cur->table,
- // ($table->auth_only == FALSE ? TRUE : $user_cur->flags & USER_FLAG_AUTH));
$ret .= $table->act_content($user_cur);
@@ -1239,8 +1231,6 @@ class Room
log_main("JOIN_WAKEUP wup_idx ".$wup_idx." wup_n ".$user_wup_n);
log_main("JOIN_WAKEUP more");
- // $ret .= table_act_content(($user_cur->subst == 'standup'), $table->player_n, $table_idx, $user_cur->table,
- // ($table->auth_only == FALSE ? TRUE : $user_cur->flags & USER_FLAG_AUTH));
$ret .= $table->act_content($user_cur);
log_main("JOIN_WAKEUP end more");
@@ -1270,7 +1260,7 @@ class Room
$user_cur = $this->user[$i];
if ($user_cur->sess == '' || $user_cur->stat != 'room')
continue;
-
+
$ret = "gst.st = ".($user_cur->step+1)."; ";
if ($table_idx > -1)
$ret .= $this->table_content($user_cur, $table_idx);
@@ -1327,8 +1317,6 @@ class Room
}
else if ($table_idx > -1) {
if ($table->player_n == PLAYERS_N) {
- // $ret .= table_act_content(($user_cur->subst == 'standup'), PLAYERS_N, $table_idx, $user_cur->table,
- /// ($table->auth_only == FALSE ? TRUE : $user_cur->flags & USER_FLAG_AUTH));
$ret .= $table->act_content($user_cur);
}
}
@@ -1422,8 +1410,7 @@ class Room
/* MLANG: "Alarm %s inviato a %s." */
$prestr = sprintf($mlang_brisk['alarret'][$G_lang], xcape(substr($msg, strlen($alarm_check))),
($target == "" ? $mlang_brisk['tit_all'][$G_lang] : xcape($target)) );
- $to_user = sprintf('chatt_sub("%s", [2, "%s"],%s);',
- $dt, NICKSERV, $prestr);
+ $to_user = sprintf('chatt_sub("%s", [2, 0, "%s"],%s);', $dt, NICKSERV, $prestr);
$msg = sprintf("
%s
%s
",
$dt.NICKSERV, xcape(substr($msg, strlen($alarm_check))));
@@ -1438,7 +1425,7 @@ class Room
$flags_old = 0;
if ($user->stat == 'room' && $user->subst == 'sitdown' &&
$user->table >= TABLES_AUTH_N) {
- $to_user = sprintf('chatt_sub("%s", [2, "%s"],"%s");', $dt, NICKSERV, $mlang_brisk['listmust'][$G_lang]);
+ $to_user = sprintf('chatt_sub("%s", [2, 0, "%s"],"%s");', $dt, NICKSERV, $mlang_brisk['listmust'][$G_lang]);
}
else {
@@ -1471,7 +1458,7 @@ class Room
}
else {
/* MLANG: "Per autenticare qualcuno devi a tua volta essere autenticato.", "Il nickname deve contenere almeno una lettera dell\'alfabeto o una cifra.", "Nickname %s già in uso." */
- $to_user = sprintf('chatt_sub("%s", [2, "%s"],"%s");', $dt, NICKSERV, $mlang_brisk['authmust'][$G_lang]);
+ $to_user = sprintf('chatt_sub("%s", [2, 0, "%s"],"%s");', $dt, NICKSERV, $mlang_brisk['authmust'][$G_lang]);
}
}
else if (strncmp($msg, "/mesgtoadm", 8) == 0) {
@@ -1480,7 +1467,7 @@ class Room
}
else {
/* MLANG: "Per inviare un messaggio devi essere autenticato." */
- $to_user = sprintf('chatt_sub("%s", [2, "%s"],"%s");', $dt, NICKSERV, $mlang_brisk['mesgmust'][$G_lang]);
+ $to_user = sprintf('chatt_sub("%s", [2, 0, "%s"],"%s");', $dt, NICKSERV, $mlang_brisk['mesgmust'][$G_lang]);
}
}
else if (strncmp($msg, "/nick ", 6) == 0) {
@@ -1488,7 +1475,7 @@ class Room
do {
if (($name_new = validate_name(substr($msg, 6))) == FALSE) {
- $to_user = sprintf('chatt_sub("%s", [2,"%s"],"%s");', $dt, NICKSERV, $mlang_brisk['nickmust'][$G_lang]);
+ $to_user = sprintf('chatt_sub("%s", [2, 0, "%s"],"%s");', $dt, NICKSERV, $mlang_brisk['nickmust'][$G_lang]);
break;
}
@@ -1503,7 +1490,7 @@ class Room
}
if ($i < MAX_PLAYERS) {
$prestr = sprintf($mlang_brisk['nickdupl'][$G_lang], xcape($name_new));
- $to_user = sprintf('chatt_sub("%s", [2, "%s"],"%s");', $dt, NICKSERV, $prestr);
+ $to_user = sprintf('chatt_sub("%s", [2, 0, "%s"],"%s");', $dt, NICKSERV, $prestr);
break;
}
@@ -1521,7 +1508,7 @@ class Room
}
}
else {
- $to_user = sprintf('chatt_sub("%s", [2, "%s"],"%s");', $dt, NICKSERV, $mlang_brisk['authchan'][$G_lang]);
+ $to_user = sprintf('chatt_sub("%s", [2, 0, "%s"],"%s");', $dt, NICKSERV, $mlang_brisk['authchan'][$G_lang]);
break;
}
}
@@ -1534,7 +1521,7 @@ class Room
/* MLANG: "Il nickname \'%s\' è già registrato, se il suo proprietario si autentificherà verrai rinominato d\'ufficio come ghostN." */
if ($bdb->login_exists($name_new)) {
$prestr = sprintf($mlang_brisk['nickjust'][$G_lang], xcape($name_new));
- $to_user .= sprintf('chatt_sub("%s", [2, "%s"],"%s");', $dt, NICKSERV, $prestr);
+ $to_user .= sprintf('chatt_sub("%s", [2, 0, "%s"],"%s");', $dt, NICKSERV, $prestr);
}
}
}
@@ -1601,14 +1588,13 @@ class Room
}
else {
/* MLANG: "Questo stato non esiste." */
- $to_user = sprintf('chatt_sub("%s", [2,"%s"],"%s");', $dt, NICKSERV, $mlang_brisk['statunkn'][$G_lang]);
+ $to_user = sprintf('chatt_sub("%s", [2, 0, "%s"],"%s");', $dt, NICKSERV, $mlang_brisk['statunkn'][$G_lang]);
break;
}
log_main("chatt_send start set");
- if (($user->flags & USER_FLAG_S_ALL) != $st) {
- $update_room = TRUE;
- $user->flags = ($user->flags & ~USER_FLAG_S_ALL) | $st;
+ if ($user->flags_vlt_set($st, USER_FLAG_S_ALL)) {
+ $update_room = TRUE;
}
} while (0);
} // nick chat command
@@ -1634,10 +1620,10 @@ class Room
}
if ($only_you) {
- $to_user = sprintf('chatt_sub("%s", [%d, "%s"],"%s");', $dt, $user->flags, xcape($user->name), xcape("== chat ban =="));
+ $to_user = sprintf('chatt_sub("%s", [%d, %d, "%s"],"%s");', $dt, $user->flags, $user->flags_vlt, xcape($user->name), xcape("== chat ban =="));
}
else {
- $to_user = sprintf('chatt_sub("%s", [%d, "%s"],"%s");', $dt, $user->flags, xcape($user->name), xcape($msg));
+ $to_user = sprintf('chatt_sub("%s", [%d, %d, "%s"],"%s");', $dt, $user->flags, $user->flags_vlt, xcape($user->name), xcape($msg));
// temporary silentiation for troll (will became array check)
// if (strcasecmp($user->name,'JackRokka') != 0 && $user->sess != '47ea653f602e8')
$to_room = $to_user;
@@ -2220,28 +2206,29 @@ class Room
$user_cur_id = $user->idx_get();
for ($i = 0 , $ct = 0 ; $i < MAX_PLAYERS ; $i++) {
- if ($this->user[$i]->sess == "" || $this->user[$i]->stat != "room" || $this->user[$i]->name == "")
- continue;
-
- $flags = $this->user[$i]->flags;
+ if ($this->user[$i]->sess == "" || $this->user[$i]->stat != "room" || $this->user[$i]->name == "")
+ continue;
- // sql record exists AND last donate > 2013-01-01
- if ($this->user[$i]->rec != FALSE && $this->user[$i]->rec->last_dona > 1356994800) {
- $supp_comp_s = sprintf(', "%s"', $this->user[$i]->rec->supp_comp);
- }
- else {
- $supp_comp_s = '';
- }
+ $flags = $this->user[$i]->flags;
+ $flags_vlt = $this->user[$i]->flags_vlt;
- if ($this->user[$i]->subst == "standup") {
- if ($user_cur_id == $i) {
- $flags |= 1;
- }
-
- $content .= sprintf('%s[ %d, "%s"%s ]',($ct > 0 ? ', ' : ''), $flags,
- xcape($this->user[$i]->name), $supp_comp_s);
- $ct++;
- }
+ // sql record exists AND last donate > 2013-01-01
+ if ($this->user[$i]->is_supp_custom()) {
+ $supp_comp_s = sprintf(', "%s"', $this->user[$i]->rec->supp_comp);
+ }
+ else {
+ $supp_comp_s = '';
+ }
+
+ if ($this->user[$i]->subst == "standup") {
+ if ($user_cur_id == $i) {
+ $flags |= 1;
+ }
+ $content .= sprintf('%s[ %d, %d, "%s"%s ]',($ct > 0 ? ', ' : ''),
+ $flags, $flags_vlt,
+ xcape($this->user[$i]->name), $supp_comp_s);
+ $ct++;
+ }
}
$content .= ' ]);';
@@ -2269,17 +2256,19 @@ class Room
$user_cur = $this->user[$table->player[$i]];
$flags = $user_cur->flags;
-
+ $flags_vlt = $user_cur->flags_vlt;
+
if ($user_cur_id == $table->player[$i])
$flags |= 1;
log_main($user_cur->name. sprintf(" IN TABLE [%d]", $table_idx));
- if ($user_cur->rec != FALSE && $user_cur->rec->last_dona > 1356994800)
+ if ($user_cur->is_supp_custom())
$supp_comp_s = sprintf(', "%s"', $user_cur->rec->supp_comp);
else
$supp_comp_s = '';
- $content .= sprintf('%s[ %d, "%s"%s ]',($i == 0 ? '' : ', '), $flags,
+ $content .= sprintf('%s[ %d, %d, "%s"%s ]',($i == 0 ? '' : ', '),
+ $flags, $flags_vlt,
xcape($user_cur->name), $supp_comp_s);
}
@@ -2292,6 +2281,8 @@ class Room
function request_mgr(&$s_a_p, $header, &$header_out, &$new_socket, $path, $addr, $get, $post, $cookie)
{
+ GLOBAL $G_black_list;
+
printf("NEW_SOCKET (root): %d PATH [%s]\n", intval($new_socket), $path);
$enc = get_encoding($header);
@@ -2852,7 +2843,7 @@ function root_welcome($user)
$dt = date("H:i ", $curtime);
for ($i = 0 ; $i < count($root_wellarr[$G_lang]) ; $i++)
- $ret .= sprintf('chatt_sub("%s", [2, "%s"],"%s");', $dt, NICKSERV, str_replace('"', '\"', $root_wellarr[$G_lang][$i]));
+ $ret .= sprintf('chatt_sub("%s", [2, 0, "%s"],"%s");', $dt, NICKSERV, str_replace('"', '\"', $root_wellarr[$G_lang][$i]));
return ($ret);
}