OSDN Git Service

TeleportMachine 鋳型
[h58pcdgame/GameScriptCoreLibrary.git] / www / monitor.php
1 <?php
2 //FOR DEBUG
3 mysqli_report(MYSQLI_REPORT_ERROR);
4
5 require("header.php");
6
7 $db = new mysqli('localhost', DATABASE_USER, DATABASE_PWD, DATABASE_NAME);
8 if (mysqli_connect_error()) {
9         responseError();
10 }
11 // 文字化け防止
12 $db->set_charset("utf8");
13 //timestamp
14 echo("[" . getTimeStampMs() . ",");
15 //userList
16 $stmt = $db->prepare("select id, name from authUserTable");
17 $stmt->execute();
18 $stmt->store_result();
19 if($stmt->num_rows == 0){
20         exit("error1");
21 }
22 $stmt->bind_result($uid, $uname);
23 echo ("[");
24 while($stmt->fetch()){
25         echo("\"" . $uid . ":" . $uname . "\",");
26 }
27 echo ("],");
28 $stmt->close();
29 //objectlist
30 echo("[]");
31
32 echo("]");
33
34 $stmt = $db->prepare(QUERY_CHECK_AND_SET_DELETED_OBJECT);
35 $limittime = getTimeStampMs() - USER_ALIVE_TIME_MS;
36 $stmt->bind_param(QUERY_CHECK_AND_SET_DELETED_OBJECT_TYPES, getTimeStampMs(), $limittime);
37 $stmt->execute();
38 $stmt->close();
39
40 //
41 // response
42 //
43 //[
44 //      [timestamp],
45 //      
46 //]
47 function responseError()
48 {
49         exit("[0];");
50 }
51
52 ?>