1
0
mirror of https://e.coding.net/circlecloud/McAccount.git synced 2024-11-24 02:08:53 +00:00

允许退出10秒内免登陆...

Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
502647092 2015-11-19 19:04:23 +08:00
parent 8f27adba84
commit 68e7fe8c2e

View File

@ -5,7 +5,7 @@ class authme extends AmysqlModel {
"username" => $username,
"password" => $password,
"ip" => $ip,
"lastlogin" => '',
"lastlogin" => time (),
"x" => '0',
"y" => '0',
"z" => '0',
@ -38,11 +38,17 @@ class authme extends AmysqlModel {
$num = $this->_sum ( "SELECT * FROM `authme` WHERE `username`='$username' AND `isLogged`='1'" );
if ($num != 0)
return true;
else
return false;
else {
$last = $this->_sum ( "SELECT * FROM `authme` WHERE `username`='$username' AND `lastlogin`>" . (time () - 10) );
if ($last != 0) {
return true;
} else {
return false;
}
}
}
public function clientlogout($username) {
$key = array ("isLogged" => 0 );
$key = array ("isLogged" => 0,"lastlogin" => time () );
$num = $this->_update ( 'authme', $key, "WHERE `username`='$username'" );
if ($num != 0)
return true;