From 36ef3990da31407be08e6eb7b337883686545886 Mon Sep 17 00:00:00 2001 From: 502647092 Date: Thu, 12 Nov 2015 21:01:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9C=8D=E5=8A=A1=E5=99=A8?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=20=E4=BF=AE=E5=A4=8D=E7=8E=A9=E5=AE=B6?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E9=80=80=E5=87=BA=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 502647092 --- Amysql/Amysql.php | 2 +- Controller/user_public.php | 2 +- Model/authme.php | 23 +++++------ View/servers.php | 78 ++++++++++++++++++++++++++++++++++---- 4 files changed, 84 insertions(+), 21 deletions(-) diff --git a/Amysql/Amysql.php b/Amysql/Amysql.php index 88679eb..cd3b06e 100644 --- a/Amysql/Amysql.php +++ b/Amysql/Amysql.php @@ -444,4 +444,4 @@ class DB { $CharSet = str_replace ( '-', '', $Config ['CharSet'] ); mysql_query ( "SET NAMES '$CharSet'", $this->DBS [$Config ['ModelTag']] ); } -} +} diff --git a/Controller/user_public.php b/Controller/user_public.php index 1bfadc7..3b6480b 100644 --- a/Controller/user_public.php +++ b/Controller/user_public.php @@ -33,7 +33,7 @@ class user_public extends AmysqlController { } } function clientlogout() { - if ($this->_model ( "authme" )->login ( @$_REQUEST ['user'], md5 ( @$_REQUEST ['pass'] ) )) { + if ($this->_model ( "authme" )->clientlogout ( @$_REQUEST ['user'])) { $_SESSION ['username'] = @$_REQUEST ['user']; JsonSuccess ( '登陆成功!' ); } else { diff --git a/Model/authme.php b/Model/authme.php index b06d0c4..7700815 100644 --- a/Model/authme.php +++ b/Model/authme.php @@ -19,18 +19,19 @@ class authme extends AmysqlModel { return false; } public function login($username, $password) { + $sum = $this->_sum ( "SELECT * FROM `authme` WHERE `username` = '$username' AND `password` = '$password'" ); + if ($sum != 0) + return true; + else + return false; + } + public function clientlogin($username, $password) { $sum = $this->_sum ( "SELECT * FROM `authme` WHERE `username` = '$username' AND `password` = '$password'" ); if ($sum != 0) { $key = array ("isLogged" => 1 ); $this->_update ( 'authme', $key, "WHERE `username`='$username'" ); return true; - } - } - public function clientlogin($username, $password) { - $sum = $this->_sum ( "SELECT * FROM `authme` WHERE `username` = '$username' AND `password` = '$password'" ); - if ($sum != 0) - return true; - else + } else return false; } public function clientcheck($username) { @@ -42,11 +43,11 @@ class authme extends AmysqlModel { } public function clientlogout($username) { $key = array ("isLogged" => 0 ); - $num = $this->_update ( 'authme', $key, "WHERE `username`='" . $username . "'" ); - if ($num == 0) - return false; - else + $num = $this->_update ( 'authme', $key, "WHERE `username`='$username'" ); + if ($num != 0) return true; + else + return false; } public function pass($username, $newpass) { $key = array ("password" => $newpass ); diff --git a/View/servers.php b/View/servers.php index 810b6fa..06beaa7 100644 --- a/View/servers.php +++ b/View/servers.php @@ -1,31 +1,61 @@ { "areas":[ + { + "name":"测试大区", + "servers":[ + { + "name":"测试服务器", + "addr":"2630.7ymc.com", + "port":25565, + "picurl":"http://yum.citycraft.cn", + "type":"测试|生存|PVP|帮派|技能|任务", + "info":"测试服务器一区", + "wfjs":"http://yum.citycraft.cn", + "tsjc":"http://yum.citycraft.cn", + "version":"1.8-Forge", + "url":"http://cloud.citycraft.cn/Version", + "depend":"1.8" + } + ] + }, { "name":"纯净大区", "servers":[ { "name":"MFCRAFT", - "address":"s1.mfcraft.cn", + "addr":"s1.mfcraft.cn", "port":25510, - "info":"MFCRAFT \u000d 稳定 声誉 生存 地皮 小游戏", + "picurl":"http://yum.citycraft.cn", + "type":"生存|PVP|帮派|技能|任务", + "info":"我是7老板 我在生存一区等你", + "wfjs":"http://yum.citycraft.cn", + "tsjc":"http://yum.citycraft.cn", "version":"1.8-Forge", "url":"four.mengcraft.com", "depend":"1.8" }, { "name":"IZCRAFT", - "address":"mc.izcraft.com", + "addr":"mc.izcraft.com", "port":25565, - "info":"IZCRAFT \u000d 稳定 声誉 生存 地皮 小游戏", + "picurl":"http://yum.citycraft.cn", + "type":"生存|PVP|帮派|技能|任务", + "info":"我是7老板 我在生存一区等你", + "wfjs":"http://yum.citycraft.cn", + "tsjc":"http://yum.citycraft.cn", "version":"1.8-Forge", "url":"http://cloud.citycraft.cn/Version", "depend":"1.8" }, { "name":"MFCRAFT3", - "address":"s3.mfcraft.cn", + "addr":"s3.mfcraft.cn", "port":25512, - "info":"MFCRAFT3 \u000d 稳定 声誉 生存 地皮 小游戏", + "picurl":"http://yum.citycraft.cn", + "type":"生存|PVP|帮派|技能|任务", + "info":"我是7老板 我在生存一区等你", + "wfjs":"http://yum.citycraft.cn", + "tsjc":"http://yum.citycraft.cn", "version":"1.8", "url":"four.mengcraft.com", "depend":"1.8" @@ -37,14 +67,46 @@ "servers":[ { "name":"梦幻之都", - "address":"three.mengcraft.com", + "addr":"three.mengcraft.com", "port":11333, - "info":"梦幻之都\u000dMOD服务器\u000d豆腐 家具 工业2 能源应用2", + "picurl":"http://yum.citycraft.cn", + "type":"生存|PVP|帮派|技能|任务", + "info":"我是7老板 我在生存一区等你", + "wfjs":"http://yum.citycraft.cn", + "tsjc":"http://yum.citycraft.cn", "version":"1.7.10-Forge-CT", "url":"http://cloud.citycraft.cn/Version", "depend":"1.7.10" } ] } + ], + "recommendserver":[ + { + "name":"逗比ZXC", + "addr":"three.mengcraft.com", + "port":11333, + "picurl":"http://yum.citycraft.cn", + "type":"生存|PVP|帮派|技能|任务", + "info":"我是7老板 我在生存一区等你", + "wfjs":"http://yum.citycraft.cn", + "tsjc":"http://yum.citycraft.cn", + "version":"1.7.10-Forge-CT", + "url":"http://cloud.citycraft.cn/Version", + "depend":"1.7.10" + }, + { + "name":"傻叉ZXC", + "addr":"three.mengcraft.com", + "port":11333, + "picurl":"http://yum.citycraft.cn", + "type":"生存|PVP|帮派|技能|任务", + "info":"我是7老板 我在生存一区等你", + "wfjs":"http://yum.citycraft.cn", + "tsjc":"http://yum.citycraft.cn", + "version":"1.7.10-Forge-CT", + "url":"http://cloud.citycraft.cn/Version", + "depend":"1.7.10" + } ] } \ No newline at end of file