diff --git a/Controller/server_status.php b/Controller/server_status.php new file mode 100644 index 0000000..c943d79 --- /dev/null +++ b/Controller/server_status.php @@ -0,0 +1,8 @@ + _model('server_model') -> QueryMinecraft( $_REQUEST ['ip'], $_REQUEST ['port'] ); + return $info; + } +} +?> \ No newline at end of file diff --git a/Controller/user_current.php b/Controller/user_current.php index 0aca910..cafb375 100644 --- a/Controller/user_current.php +++ b/Controller/user_current.php @@ -4,7 +4,9 @@ class user_current extends AmysqlController function current() { $money = $this -> _model('current_model') -> money_current($_REQUEST['user']); - + if(!$money){ + JsonError( "未查询到账号信息!" ); + } JsonSuccess( $money ); } } diff --git a/Model/current_model.php b/Model/current_model.php index 974dcc1..353c5ca 100644 --- a/Model/current_model.php +++ b/Model/current_model.php @@ -1,9 +1,8 @@ _all ( $sql ); + $sql = "SELECT * FROM `iconomy` WHERE `username` = '" . $user . "'"; + return $this->_row ( $sql ); } } - ?> \ No newline at end of file diff --git a/Model/server_model.php b/Model/server_model.php new file mode 100644 index 0000000..d34514b --- /dev/null +++ b/Model/server_model.php @@ -0,0 +1,67 @@ + ( int ) $Timeout, + 'usec' => 0 + ) ); + Socket_Set_Option ( $Socket, SOL_SOCKET, SO_RCVTIMEO, array ( + 'sec' => ( int ) $Timeout, + 'usec' => 0 + ) ); + + if ($Socket === FALSE || @Socket_Connect ( $Socket, $IP, ( int ) $Port ) === FALSE) { + return FALSE; + } + + Socket_Send ( $Socket, "\xFE\x01", 2, 0 ); +// Socket_Send ( $Socket, "\x0F\0x00\x04\x09\x31\x32\x37\x2E\x30\x2E\x30\x2E\x31\x63\xDD\x01", 16, 0); +// Socket_Send ( $Socket, "\x01\x00", 2, 0 ); + $Len = Socket_Recv ( $Socket, $Data, 1024, 0 ); + Socket_Close ( $Socket ); + +// return FALSE; +// if ($Len < 4 || $Data [0] !== "\xFF") { +// return FALSE; +// } + +// $Data = SubStr ( $Data, 3 ); + echo($Len); + echo("

"); + +// $Data = iconv( 'UTF-16BE', 'UTF-8', $Data ); + print_r($Data); + echo("

"); + $zData = Explode ( "\x00", $Data ); + echo(count($zData)); + echo("

"); + print_r($zData); + echo("

"); + $aData = Explode ( "\xA7", $Data ); + echo(count($aData)); + echo("

"); + print_r($aData); +// if ($Data [1] === "\xA7" && $Data [2] === "\x31") { +// $Data = Explode ( "\x00", $Data ); +// var_dump($Data [3]); +// return Array ( +// 'HostName' => $Data [3], +// 'Players' => IntVal ( $Data [4] ), +// 'MaxPlayers' => IntVal ( $Data [5] ), +// 'Protocol' => IntVal ( $Data [1] ), +// 'Version' => $Data [2] +// ); +// } + +// $Data = Explode ( "\xA7", $Data ); +// return Array ( +// 'HostName' => SubStr ( $Data [0], 0, - 1 ), +// 'Players' => isset ( $Data [1] ) ? IntVal ( $Data [1] ) : 0, +// 'MaxPlayers' => isset ( $Data [2] ) ? IntVal ( $Data [2] ) : 0, +// 'Protocol' => 0, +// 'Version' => '1.3' +// ); + } +} \ No newline at end of file diff --git a/View/header.php b/View/header.php index 27125c5..988af96 100644 --- a/View/header.php +++ b/View/header.php @@ -3,27 +3,41 @@ + \ No newline at end of file + + \ No newline at end of file diff --git a/View/index.php b/View/index.php index 4033032..b19405b 100644 --- a/View/index.php +++ b/View/index.php @@ -44,7 +44,7 @@ if (empty ( $_SESSION ['username'] )) - + diff --git a/View/message.php b/View/message.php index 491f475..9a8414a 100644 --- a/View/message.php +++ b/View/message.php @@ -1,128 +1,100 @@ - - - -<?=$title?> - - - - - - - - - - - - - - - - - - - - - - +?> + + + +<?=$title?> + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - -
-
-
- -
-
- -
-
- - -
-
Minecraft玩家信息
- -
-
- -
-
-

-
-
- -
-
-
-
-
-
- - - - - - - + + + + + + + + + + +
+
+
+ +
+
+ +
+
+ + +
+
Minecraft玩家信息
+ +
+
+ +
+
+ +
+
+ +
+
+ 在线人数: / +
+
+
+
+
+
+ + + + + + + - - + + + \ No newline at end of file diff --git a/View/servers.php b/View/servers.php new file mode 100644 index 0000000..c04bc65 --- /dev/null +++ b/View/servers.php @@ -0,0 +1,9 @@ + + + +<?=$title?> + + +
+ +