projects
/
brisk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add index_rd_ifra user data server side. rd keepalive and endtime management
[brisk.git]
/
web
/
briskin5
/
statadm.php
diff --git
a/web/briskin5/statadm.php
b/web/briskin5/statadm.php
index
15fd27c
..
c634ef6
100644
(file)
--- a/
web/briskin5/statadm.php
+++ b/
web/briskin5/statadm.php
@@
-58,8
+58,11
@@
function main_file($curtime)
fclose($fp_start);
}
fclose($fp_start);
}
- // FIXME: now create can return FALSE
- $bdb = BriskDB::create();
+ if (($bdb = BriskDB::create()) == FALSE) {
+ echo "database connection failed";
+ exit;
+ }
+
$bdb->users_load();
for ($i = 0 ; $i < $bdb->count() ; $i++) {
$bdb->users_load();
for ($i = 0 ; $i < $bdb->count() ; $i++) {
@@
-97,12
+100,12
@@
function main_file($curtime)
continue;
}
continue;
}
- // echo $p++." ".B
RISK
IN5_PLAYERS_N."<br>";
+ // echo $p++." ".BIN5_PLAYERS_N."<br>";
$found = FALSE;
$mult = 1;
$found = FALSE;
$mult = 1;
- for ($i = 0 ; $i < B
RISK
IN5_PLAYERS_N ; $i++) {
- for ($e = $i + 1 ; $e < B
RISK
IN5_PLAYERS_N ; $e++) {
+ for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
+ for ($e = $i + 1 ; $e < BIN5_PLAYERS_N ; $e++) {
if ($ar[10+($i*2)] == $ar[10+($e*2)]) {
$mult = abs($ar[10+($i*2)]);
$found = TRUE;
if ($ar[10+($i*2)] == $ar[10+($e*2)]) {
$mult = abs($ar[10+($i*2)]);
$found = TRUE;
@@
-114,7
+117,7
@@
function main_file($curtime)
if ($mult == 0)
continue;
if ($mult == 0)
continue;
- for ($i = 0 ; $i < B
RISK
IN5_PLAYERS_N ; $i++) {
+ for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
// echo $p." i) ".$i."<br>";
$username = $ar[9+($i*2)];
if (($item = $bdb->getitem_bylogin($username, &$id)) == FALSE) {
// echo $p." i) ".$i."<br>";
$username = $ar[9+($i*2)];
if (($item = $bdb->getitem_bylogin($username, &$id)) == FALSE) {
@@
-211,8
+214,10
@@
function main_pgsql($curtime)
{
GLOBAL $G_dbpfx;
{
GLOBAL $G_dbpfx;
- // FIXME: now create can return FALSE
- $bdb = BriskDB::create();
+ if (($bdb = BriskDB::create()) == FALSE) {
+ echo "database connection failed";
+ exit;
+ }
$limi = array( TRI_LIMIT, MON_LIMIT, WEE_LIMIT );
$ming = array( TRI_MIN_GAMES, MON_MIN_GAMES, WEE_MIN_GAMES );
$limi = array( TRI_LIMIT, MON_LIMIT, WEE_LIMIT );
$ming = array( TRI_MIN_GAMES, MON_MIN_GAMES, WEE_MIN_GAMES );
@@
-228,7
+233,6
@@
function main_pgsql($curtime)
FROM %sbin5_matches as m, %sbin5_games as g
WHERE g.mcode = m.code GROUP BY m.code, m.ttok",
$G_dbpfx, $G_dbpfx, $G_dbpfx);
FROM %sbin5_matches as m, %sbin5_games as g
WHERE g.mcode = m.code GROUP BY m.code, m.ttok",
$G_dbpfx, $G_dbpfx, $G_dbpfx);
- // error_log($mtc_sql, 0);
if (pg_query($bdb->dbconn->db(), $mtc_sql) == FALSE) {
log_crit("statadm: temporary matches table creation [$mtc_sql] failed");
break;
if (pg_query($bdb->dbconn->db(), $mtc_sql) == FALSE) {
log_crit("statadm: temporary matches table creation [$mtc_sql] failed");
break;
@@
-236,7
+240,6
@@
function main_pgsql($curtime)
$tmt_sql = sprintf("SELECT * FROM %sbin5_temp_matches WHERE tstamp < to_timestamp(%d)",
$G_dbpfx, $curtime - TRI_LIMIT);
$tmt_sql = sprintf("SELECT * FROM %sbin5_temp_matches WHERE tstamp < to_timestamp(%d)",
$G_dbpfx, $curtime - TRI_LIMIT);
- // error_log($tmt_sql, 0);
// if deletable old matches exists then ...
if (($tmt_pg = pg_query($bdb->dbconn->db(), $tmt_sql)) != FALSE) {
// if deletable old matches exists then ...
if (($tmt_pg = pg_query($bdb->dbconn->db(), $tmt_sql)) != FALSE) {
@@
-257,7
+260,6
@@
function main_pgsql($curtime)
$mtc_sql = sprintf("SELECT * from %sbin5_matches WHERE code = %d",
$G_dbpfx, $tmt_obj->code);
$mtc_sql = sprintf("SELECT * from %sbin5_matches WHERE code = %d",
$G_dbpfx, $tmt_obj->code);
- error_log($mtc_sql, 0);
if (($mtc_pg = pg_query($bdb->dbconn->db(), $mtc_sql)) == FALSE || pg_numrows($mtc_pg) != 1) {
log_crit("statadm: matches row select failed");
break;
if (($mtc_pg = pg_query($bdb->dbconn->db(), $mtc_sql)) == FALSE || pg_numrows($mtc_pg) != 1) {
log_crit("statadm: matches row select failed");
break;
@@
-408,10
+410,10
@@
function main()
GLOBAL $G_dbasetype, $G_alarm_passwd, $pazz;
echo "Inizio.<br>";
GLOBAL $G_dbasetype, $G_alarm_passwd, $pazz;
echo "Inizio.<br>";
- flush();
+
mop_
flush();
if ($pazz != $G_alarm_passwd) {
echo "Wrong password<br>";
if ($pazz != $G_alarm_passwd) {
echo "Wrong password<br>";
- flush();
+
mop_
flush();
exit;
}
exit;
}
@@
-426,7
+428,7
@@
function main()
echo "Failed.<br>\n";
echo "Fine.\n";
echo "Failed.<br>\n";
echo "Fine.\n";
- flush();
+
mop_
flush();
}
main();
}
main();