ip integer, -- ip v4 address
atime timestamp DEFAULT to_timestamp(0) -- access time
);
+
+--
+-- Add counters to show how many matches and games are played
+--
+ALTER TABLE #PFX#users DROP COLUMN match_cnt;
+ALTER TABLE #PFX#users ADD COLUMN match_cnt integer DEFAULT 0;
+ALTER TABLE #PFX#users DROP COLUMN game_cnt;
+ALTER TABLE #PFX#users ADD COLUMN game_cnt integer DEFAULT 0;
var $tos_vers;
var $disa_reas;
var $guar_code;
+ var $match_cnt;
+ var $game_cnt;
- function LoginDBItem($code, $login, $pass, $email, $type, $last_dona, $supp_comp, $tos_vers, $disa_reas, $guar_code)
+ function LoginDBItem($code, $login, $pass, $email, $type, $last_dona, $supp_comp, $tos_vers,
+ $disa_reas, $guar_code, $match_cnt, $game_cnt)
{
$this->code = $code;
$this->login = $login;
$this->tos_vers = $tos_vers;
$this->disa_reas = $disa_reas;
$this->guar_code = $guar_code;
+ $this->match_cnt = $match_cnt;
+ $this->game_cnt = $game_cnt;
}
static function LoginDBItemFromRecord($rec)
{
$ret = new LoginDBItem($rec->code, $rec->login, $rec->pass,
$rec->email, $rec->type, $rec->last_dona,
- $rec->supp_comp, $rec->tos_vers, $rec->disa_reas, $rec->guar_code);
+ $rec->supp_comp, $rec->tos_vers, $rec->disa_reas, $rec->guar_code,
+ $rec->match_cnt, $rec->game_cnt);
return ($ret);
}
return $this->guar_code;
}
+ function match_cnt_get()
+ {
+ return $this->match_cnt;
+ }
+ function match_cnt_add($v)
+ {
+ return $this->match_cnt += $v;
+ }
+
+ function game_cnt_get()
+ {
+ return $this->game_cnt;
+ }
+ function game_cnt_add($v)
+ {
+ return $this->game_cnt += $v;
+ }
}
define('MAIL_TYP_CHECK', 1);