projects
/
brisk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
modified check to skip chatt call to be able to log all msg in moderation
[brisk.git]
/
web
/
briskin5
/
index_wr.php
diff --git
a/web/briskin5/index_wr.php
b/web/briskin5/index_wr.php
index
d3ace81
..
98fd79b
100644
(file)
--- a/
web/briskin5/index_wr.php
+++ b/
web/briskin5/index_wr.php
@@
-2,7
+2,7
@@
/*
* brisk - index_wr.php
*
/*
* brisk - index_wr.php
*
- * Copyright (C) 2006-201
1
Matteo Nastasi
+ * Copyright (C) 2006-201
2
Matteo Nastasi
* mailto: nastasi@alternativeoutput.it
* matteo.nastasi@milug.org
* web: http://www.alternativeoutput.it
* mailto: nastasi@alternativeoutput.it
* matteo.nastasi@milug.org
* web: http://www.alternativeoutput.it
@@
-38,9
+38,16
@@
require_once("Obj/briskin5.phh");
/*
* MAIN
*/
/*
* MAIN
*/
-function bin5_index_wr_main(&$bri, $remote_addr, $get, $post, $cookie)
+function bin5_index_wr_main(&$bri, $remote_addr
_full
, $get, $post, $cookie)
{
{
- GLOBAL $G_base, $G_dbasetype;
+ GLOBAL $G_base, $G_dbasetype, $G_black_list;
+
+ $remote_addr = addrtoipv4($remote_addr_full);
+
+ if (array_search($remote_addr, $G_black_list) !== FALSE) {
+ // TODO: waiting async 5 sec before close
+ return (FALSE);
+ }
$curtime = time();
if ($bri == NULL) {
$curtime = time();
if ($bri == NULL) {
@@
-69,6
+76,12
@@
function bin5_index_wr_main(&$bri, $remote_addr, $get, $post, $cookie)
log_wr("Get User Error");
return FALSE;
}
log_wr("Get User Error");
return FALSE;
}
+
+ if (array_search($user->ip, $G_black_list) !== FALSE) {
+ // TODO: waiting async 5 sec before close
+ return (FALSE);
+ }
+
$argz = explode('|', $mesg);
log_wr('POSTSPLIT: '.$argz[0].' user->stat: ['.$user->stat.']');
$argz = explode('|', $mesg);
log_wr('POSTSPLIT: '.$argz[0].' user->stat: ['.$user->stat.']');
@@
-111,8
+124,6
@@
function bin5_index_wr_main(&$bri, $remote_addr, $get, $post, $cookie)
$bri->chatt_send(&$user,$mesg);
}
else if ($argz[0] == 'preferences_update') {
$bri->chatt_send(&$user,$mesg);
}
else if ($argz[0] == 'preferences_update') {
- GLOBAL $CO_bin5_pref_ring_endauct;
-
log_wr("PER DI PREFERENCES_UPDATE");
if ($CO_bin5_pref_ring_endauct == "true")
log_wr("PER DI PREFERENCES_UPDATE");
if ($CO_bin5_pref_ring_endauct == "true")
@@
-179,7
+190,8
@@
function bin5_index_wr_main(&$bri, $remote_addr, $get, $post, $cookie)
$table->mult += 1;
$table->old_reason = sprintf("Ha lasciato %s perché aveva al massimo 2 punti.", xcape($user->name));
$table->mult += 1;
$table->old_reason = sprintf("Ha lasciato %s perché aveva al massimo 2 punti.", xcape($user->name));
- $table->game_next();
+ // Non si cambia mazzo se si abbandona la partita
+ // $table->game_next();
$table->game_init(&$bri->user);
for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
$table->game_init(&$bri->user);
for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
@@
-496,7
+508,7
@@
function bin5_index_wr_main(&$bri, $remote_addr, $get, $post, $cookie)
for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
$plist .= '|'.xcapelt($ucodes[$i]);
}
for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
$plist .= '|'.xcapelt($ucodes[$i]);
}
- log_legal($curtime,
'xxx'
, $user, "STAT:BRISKIN5:FINISH_GAME", $plist);
+ log_legal($curtime,
$user->ip
, $user, "STAT:BRISKIN5:FINISH_GAME", $plist);
if ($user->table_orig < TABLES_AUTH_N) {
require_once("../Obj/dbase_".$G_dbasetype.".phh");
if ($user->table_orig < TABLES_AUTH_N) {
require_once("../Obj/dbase_".$G_dbasetype.".phh");