diff --git a/GraphPlayer.php b/GraphPlayer.php index e747f14..9c37774 100755 --- a/GraphPlayer.php +++ b/GraphPlayer.php @@ -1,17 +1,15 @@ query($queryP); - + $queryP = "SELECT date, players FROM ".$StatServer." ORDER BY id DESC LIMIT 80"; + $arrPlay = $con->query($queryP); ?> @@ -24,12 +22,12 @@ include_once('config.php'); -

☠ Players on

+
'; + // echo ''; echo "
...Connection failed with MYSQL
"; // die("Connection failed: " . $con->connect_error); } diff --git a/dayz2json.php b/dayz2json_full.php similarity index 100% rename from dayz2json.php rename to dayz2json_full.php diff --git a/dayz2json_obj_full.php b/dayz2json_obj_full.php new file mode 100644 index 0000000..43a9204 --- /dev/null +++ b/dayz2json_obj_full.php @@ -0,0 +1,60 @@ +var dump:
"; var_dump($myJSON); +echo "
"; + +echo "

JSON ARRAY:


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

var_dump(json_decode:


"; + +*/ + +var_dump(json_decode($readjson)); + +//$sname = $readjson->{'server1'}; +//echo $sname; + +/* +echo "
"; +$InfoGT = $Info['GameTags']; +echo $InfoGT; + +echo "
"; +$sname = $Info['HostName'] ; +$Players = $Info['Players'] ; +$MaxPlayers = $Info['MaxPlayers'] ; +$Secure = $Info['Secure'] ; +$Map = $Info['Map'] ; +$Os = $Info['Os'] ; +$Version = $Info['Version'] ; +$GamePort = $Info['GamePort'] ; + +$game = "Dayz" ; +$ping = "666" ; + +echo "Hostname: " .$sname . "
"; +echo "Players: " .$Players . "
"; +echo "MaxPlayers: " .$MaxPlayers . "
"; +echo "Secure: " .$Secure . "
"; +echo "Map: " .$Map . "
"; +echo "Os: " .$Os . "
"; +echo "Version: " .$Version . "
"; +echo "Port: " .$GamePort . "

"; +*/ + +//preg_grep('/keywords \z map/', explode("\n", $readjson)); + + +?> + diff --git a/dayz2json_parser.php b/dayz2json_parser.php deleted file mode 100644 index a4457e4..0000000 --- a/dayz2json_parser.php +++ /dev/null @@ -1,66 +0,0 @@ -Connect( SQ_SERVER_ADDR, SQ_SERVER_PORT, SQ_TIMEOUT, SQ_ENGINE ); - - $Info = $Query->GetInfo( ); - $Players = $Query->GetPlayers( ); - } - catch( Exception $e ) - { - $Exception = $e; - } - - $Query->Disconnect( ); - - $Timer = Number_Format( MicroTime( true ) - $Timer, 4, '.', '' ); - $InfoGT = $Info['GameTags']; - - - -echo $Info['Players'] ;echo "
"; -echo $Info['MaxPlayers'] ;echo "
"; -echo $Info['MaxPlayers'] ;echo "
"; -echo $Info['MaxPlayers'] ;echo "
"; -echo $Info['MaxPlayers'] ;echo "
"; -echo $Info['MaxPlayers'] ;echo "
"; -echo $Info['MaxPlayers'] ;echo "
"; -echo $Info['MaxPlayers'] ;echo "
"; -echo $Info['MaxPlayers'] ;echo "
"; -echo $Info['MaxPlayers'] ;echo "
"; -echo $Info['MaxPlayers'] ;echo "
"; -echo $Info['MaxPlayers'] ;echo "
"; -echo $Info['MaxPlayers'] ;echo "
"; -echo $Info['MaxPlayers'] ;echo "
"; -echo $Info['MaxPlayers'] ;echo "
"; -echo $Info['MaxPlayers'] ;echo "
"; -echo $Info['MaxPlayers'] ;echo "
"; -echo $Info['MaxPlayers'] ; - - - - -?> - diff --git a/dayz2json_parser_sql.php b/dayz2json_parser_sql.php new file mode 100644 index 0000000..7a1ce94 --- /dev/null +++ b/dayz2json_parser_sql.php @@ -0,0 +1,90 @@ +Connect( SQ_SERVER_ADDR, SQ_SERVER_PORT, SQ_TIMEOUT, SQ_ENGINE ); + + $Info = $Query->GetInfo( ); + $Players = $Query->GetPlayers( ); + } + catch( Exception $e ) + { + $Exception = $e; + } + + $Query->Disconnect( ); + + $Timer = Number_Format( MicroTime( true ) - $Timer, 4, '.', '' ); + + $InfoGT = $Info['GameTags']; + + +print_r($Info); +echo "

"; + +echo "InfoGT: " .$InfoGT . "
"; +echo "ModDesc: " .$Info['ModDesc'] . "
"; +echo "Hostname: " .$Info['HostName'] . "
"; +echo "Players: " .$Info['Players'] . "
"; +echo "MaxPlayers: " .$Info['MaxPlayers'] . "
"; +echo "Secure: " .$Info['Secure'] . "
"; +echo "Map: " .$Info['Map'] . "
"; +echo "Os: " .$Info['Os'] . "
"; +echo "Version: " .$Info['Version'] . "
"; +echo "Port: " .$Info['GamePort'] . "
"; +echo "GameID: " .$Info['GameID'] . "
"; + +echo "
test SQL"; + +$HostName = $Info['HostName'] ; +$Game = $Info['ModDesc'] ; +$Version = $Info['Version'] ; +$Players = $Info['Players']; +$MaxPlayers = $Info['MaxPlayers'] ; +$Secure = $Info['Secure'] ; +$Map = $Info['Map']; +$Os = $Info['Os'] ; +$GamePort = $Info['GamePort'] ; +$GameID = $Info['GameID'] ; + + +// set the default timezone to use. Available since PHP 5.1 +date_default_timezone_set('UTC+1'); + +$date = date('Y-m-d H:i:s'); + +$insql = "INSERT INTO $table (date,name,game,map,version,players,maxplayers,ping,timeserver,hive,battleye,connect,secure) VALUES ('$date','$HostName', '$Game', '$Map', '$Version', '$Players', '$MaxPlayers', '0', '2:20', 'hive', 'battleye', '$urlserv', '$Secure')"; + +if (mysqli_query($con, $insql)) { + echo "New record created successfully"; +} else { + echo "Error: " . $insql . "
" . mysqli_error($con); +} + +mysqli_close($con); + + + + +?> diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..105ee2b Binary files /dev/null and b/favicon.ico differ diff --git a/favicon.png b/favicon.png new file mode 100644 index 0000000..105ee2b Binary files /dev/null and b/favicon.png differ diff --git a/index.php b/index.php index e3bf8cf..121d485 100644 --- a/index.php +++ b/index.php @@ -61,7 +61,8 @@ $sec = "300"; <?php echo "$title"; ?> - + + @@ -582,7 +583,6 @@ $sec = "300";
Player last 24 hours
-
diff --git a/json2sql.php b/json2sql.php index 8ccb798..9545eef 100755 --- a/json2sql.php +++ b/json2sql.php @@ -30,7 +30,7 @@ if (!$file) quit("File read error with $filanme"); $data = json_decode($file, true); $sql = ""; foreach($data as $obj) { -// $keys = implode('`,`', array_map('addslashes', array_keys($obj))); + $keys = implode('`,`', array_map('addslashes', array_keys($obj))); $values = implode("','", array_map('addslashes', array_values($obj))); $sql .= "INSERT INTO `$table` (`$keys`, `Dates`) VALUES ('$values', '$date');\n"; } @@ -39,3 +39,6 @@ $out = pathinfo($filename, PATHINFO_FILENAME) . ".sql"; if(!file_put_contents($out, $sql)) quit("Could not write contents to $out"); quit("Written SQL data to $out"); + + +// php -f json2sql.php StatServer_5 server.json diff --git a/mod_server.php b/mod_server.php deleted file mode 100755 index f99b451..0000000 --- a/mod_server.php +++ /dev/null @@ -1,128 +0,0 @@ -'); -$objhigher = json_decode($json); //converts to an object -$objlower = $objhigher[0]; // if the json response its multidimensional this lowers it -$objlower = json_decode($json); //converts to an array of objects ?> - - -
- -

- MODS - IP: -
- (clic to join) - -

- - -
- -
- - - - - - - - - - - -
- - - - - - - - - - - -
MOD NamesteamWorkshopIdTaille

name; ?>steamWorkshopId; ?> -
-steamWorkshopId"; -$data_scrapped = file_get_contents($getcontents); - -$thestart = explode('
', $data_scrapped); -$theend = explode('
',$thestart[1]); -echo $theend[0]; - -?> - - -
-
-
- - -
-
-
- -