first commit

This commit is contained in:
Erreur32 2021-02-05 18:57:23 +01:00
parent 316af02a9b
commit b6cc8fabb5
5 changed files with 96 additions and 30 deletions

View file

@ -34,7 +34,7 @@ $insql = "INSERT INTO $table (date,name,players,maxplayers,map,game,version,time
mysqli_close($con);
//exit ;
}
} else {
// REGEX TIME
$regtimsev = "/[0-9]{1,2}[:][0-9]{1,2}/";
@ -74,7 +74,7 @@ if (mysqli_query($con, $insql)) {
}
mysqli_close($con);
}
// end

View file

@ -71,45 +71,79 @@ echo "Version: " .$Version . "<br>";
echo "Port: " .$GamePort . "<br><hr>";
echo "<h1>Payes ta regex</h1>";
$result = explode(",", $InfoGT);
print_r($result);
echo "<pre>".$InfoGT."</pre>";
echo "<br>";
//echo "<table><tr>";
echo "<hr>";
//$result = explode(",", $InfoGT);
//print_r($result);
echo "<br> ";
?>
$re = '/[^,]...(Hive)/';
$rt = preg_grep($re, array($InfoGT));
print_r($rt);
echo "<br><hr>";
<h2> example</h2>
<pre>
$regtimeacc = "/etm([0-9]{1,2}[.][0-9]{1})/";<br>
$result = preg_grep($regtimeacc, explode(",", $InfoGT));<br>
foreach ($result as $key => $val) {<br>
echo $val;<br>
}<br>
</pre>
<?php
echo "<hr>";
echo "<pre> '/(battleye)/' </pre> ";
$regtimsev = "/(battleye)/";
$result = preg_grep($regtimsev, explode(",", $InfoGT));
//print_r($result);
echo $result[0];
//echo $result[0];
foreach ($result as $key => $val) {
echo $val;
}
echo "<br><hr>";
echo "<pre> '/[^,]...(Hive)/'</pre>";
$re = '/[^,]...(Hive)/';
$result = preg_grep($re,explode(",", $InfoGT));
//print_r( preg_grep($re, array($InfoGT)));
echo $result[2];
foreach ($result as $key => $val) {
echo $val;
}
echo "<br><hr>";
echo "<pre> '/[0-9]{1,2}[:][0-9]{1,2}/' </pre>";
$regtimsev = "/[0-9]{1,2}[:][0-9]{1,2}/";
$result = preg_grep($regtimsev, explode(",", $InfoGT));
//print_r($result);
echo $result[8];
foreach ($result as $key => $val) {
echo $val;
}
echo "<br><hr>";
$regtimeacc = "/([0-9][.][0-9]{1})/";
echo "<pre> '/(mod)/' </pre>";
$regmod = "/(mod)/";
$result = preg_grep($regmod, explode(",", $InfoGT));
foreach ($result as $key => $val) {
echo $val;
}
echo "<br><hr>";
echo "<pre> '/etm([0-9]{1,2}[.][0-9]{1})/' </pre>";
$regtimeacc = "/etm([0-9]{1,2}[.][0-9]{1})/";
$result = preg_grep($regtimeacc, explode(",", $InfoGT));
//print_r($result);
echo $result[5];
//echo $result[5];
foreach ($result as $key => $val) {
echo $val;
}
echo "<br><hr>";
$regtimeacn = "/([0-9][.][0-9]{1})/";
//echo "<pre> '/entm[0-9]{1,2}[.][0-9]{1}/' </pre>";
$regtimeacn = "/entm[0-9][.][0-9]{1}/";
echo "<pre> .$regtimeacn.</pre>";
$result = preg_grep($regtimeacn, explode(",", $InfoGT));
//print_r($result);
echo $result[6];
//echo $result[6];
foreach ($result as $key => $val) {
echo $val;
}
echo "<br><hr>";
@ -133,10 +167,11 @@ echo $fl_array;
echo "<hr>";
$re = '/[0-9]{1,2}[:][0-9]{1,2}/m';
$str = 'battleye,external,privHive,shard,lqs0,etm2.000000,entm5.500000,mod,23:17';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
$re = '/[0-9]{1,2}[:][0-9]{1,2}/m';
//$str = 'battleye,external,privHive,shard,lqs0,etm2.000000,entm5.500000,mod,23:17';
preg_match_all($re, $InfoGT, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
//var_dump($matches);
@ -150,13 +185,8 @@ echo $encode;
echo "<br>";
//echo $matches[0];
$output = implode(",", array($str));
$output = implode(",", array($InfoGT));
echo $output;
echo "<br>";
$output1 = implode(",", array($matches));
echo $output1;
echo "<br>";
?>

View file

@ -20,7 +20,7 @@ CREATE TABLE `StatServer_5` (
`timeserver` varchar(12) DEFAULT NULL,
`timespeed` varchar(5) DEFAULT NULL,
`timespeedn` varchar(5) DEFAULT NULL,
`mod` varchar(5) DEFAULT NULL,
`mods` varchar(5) DEFAULT NULL,
`battleye` tinytext DEFAULT NULL,
`hive` varchar(11) DEFAULT NULL,
`connect` varchar(32) DEFAULT NULL,

24
server.json Normal file
View file

@ -0,0 +1,24 @@
Array
(
[Protocol] => 17
[HostName] => [TH] F2P SERVER | Chernarus Map | No Mod | F2P.IN.TH |
[Map] => chernarusplus
[ModDir] => dayz
[ModDesc] => DayZ
[AppID] => 0
[Players] => 18
[MaxPlayers] => 60
[Bots] => 0
[Dedicated] => d
[Os] => w
[Password] =>
[Secure] => 1
[Version] => 1.10.153598
[ExtraDataFlags] => 177
[GamePort] => 2302
[ServerID] => 90142715919842311
[GameTags] => battleye,external,privHive,shard,lqs0,etm12.000000,entm2.000000,mod,22:23
[GameID] => 221100
)

12
server.json.php Normal file
View file

@ -0,0 +1,12 @@
<?php
//ini_set('display_errors', 'on');
// include_once('./consql.php');
// MAKE json
header("Content-Type: application/json; charset=UTF-8; pageEncoding=UTF-8");
include_once('./config.php');
print_r($Info);
?>