diff --git a/consql.php b/consql.php index 419725a..db7e120 100644 --- a/consql.php +++ b/consql.php @@ -1,18 +1,11 @@ 0) { + if (count($objlower) > 0) { echo $InfoGT[73].$InfoGT[74].$InfoGT[75].$InfoGT[76].$InfoGT[77].$InfoGT[78]; echo "x". $InfoGT[47]. " - x".$InfoGT[60]." "; -} + } ?> @@ -253,7 +253,18 @@ $sec = "300";
-
+
+ 0){ + echo $InfoGT[19].$InfoGT[25].$InfoGT[26].$InfoGT[27].$InfoGT[28].$InfoGT[29].$InfoGT[30].$InfoGT[31]; + } + ?> +
HIVE
diff --git a/query-servers.php b/query-servers.php index fb2da3e..c1cf0d5 100755 --- a/query-servers.php +++ b/query-servers.php @@ -1,13 +1,10 @@ &\u0013Ԓ\u0011\u000bLivonia DLC\u0001\u0001\u0004dayz","allowedBuild":"0","dedicated":"1","island":"chernarusplus","language":"65545","platform":"win","requiredBuild":"0","requiredVersion":"110","timeLeft":"15"}},"maxplayers":60,"players":[{},{},{},{},{},{},{},{},{},{},{},{},{},{}],"bots":[],"connect":"103.58.149.102:2302","ping":195} diff --git a/statserver_json.php b/statserver_json.php index 8101f47..f50d20c 100644 --- a/statserver_json.php +++ b/statserver_json.php @@ -6,10 +6,11 @@ echo "

TEST connection MYSQL

"; - //echo $InfoGT ; +//echo $InfoGT; - echo "
"; +echo $Players; +echo "
"; -//echo $Info['GameTags']; +echo $Info['GameTags']; ?> diff --git a/statserver_json.sh b/statserver_json.sh index 6c12fc9..8bd6a76 100755 --- a/statserver_json.sh +++ b/statserver_json.sh @@ -18,10 +18,17 @@ varMod="server1" # Game Port IP mod IpGame="103.58.149.102" -PortGame="2402" -QueryGame="27017" +PortGame="2302" +QueryGame="27016" -#CHECKstatserver="/tmp/CHECKstatserver_${varMod}.json" + +TABLE="StatServer_1" +DB_USER="fpinth_status" +DB_PASSWD="Nick053896077" +DB_NAME="fpinth_status" +DB_SERV="183.90.168.189" + +CHECKstatserver="/tmp/CHECKstatserver_${varMod}.json" statserver="${pathd}/${varMod}/statserver.json" gameqjson="${pathd}/${varMod}/gameqjson.json" @@ -30,15 +37,11 @@ gameqjson="${pathd}/${varMod}/gameqjson.json" # pathBin="/dayz/bin" pathDBe="${pathd}/${varMod}" -# NEED to SET +# NEED to SET date # SQL datesql=$(date +'%F %T') date=$(date +'%F %T') -TABLE="" -DB_USER="" -DB_PASSWD="" -DB_NAME="" #DEBUG: # ls ${statserver} @@ -55,7 +58,7 @@ fi if [ ! -r "$statserver" ]; then echo " ⛔Error:"${statserver}" doesn't exits" - exit 1 +# exit 1 fi @@ -79,36 +82,13 @@ insert_mysql_down() { numplayers="0" players="0" ping="0" -mysql --user=$DB_USER --password=$DB_PASSWD --database=$DB_NAME << EOF +mysql --host=$DB_SERV --user=$DB_USER --password=$DB_PASSWD --database=$DB_NAME << EOF SET NAMES utf8; insert into $TABLE (\`date\`,\`name\`,\`game\`,\`map\`,\`version\`,\`requiredVersion\`,\`numplayers\`,\`players\`,\`maxplayers\`,\`ping\`,\`timeserver\`,\`hive\`,\`battleye\`,\`connect\`,\`secure\`) VALUES ("$datesql","OFFLINE","$game","$map","$version","$requiredVersion","$numplayers","$players","$maxplayers","$ping","$timeserver","$hive","$battleye","$connect","$secure"); EOF } -print_info() { -echo -e "$name $map $password $game ($numplayers) $version $maxplayers $ping $connect $secure $requiredVersion $island [$players] $mod $hive $battleye $timeserver $speedtime $speedtimenight $timeLeft $secure" > $pathDBe/Info-all.txt -echo -e "- Statserver Expansion: ${date}" > $pathDBe/Info-date.txt -echo "Name: $name" > $pathDBe/Info-name.txt -echo "Game: $game" > $pathDBe/Info-game.txt -echo "Numplayer: $numplayers" > $pathDBe/Info-numplayers.txt -echo "Version: $version" > $pathDBe/Info-version.txt -echo "Connect: $connect" > $pathDBe/Info-connect.txt -echo "Timeserver: $timeserver" > $pathDBe/Info-timeserver.txt -echo "Maxplayer: $maxplayers" > $pathDBe/Info-maxplayers.txt -echo "Password: $password" > $pathDBe/Info-password.txt -echo "RequireVersion: $requiredVersion" > $pathDBe/Info-requiredVersion.txt -echo "Secure: $secure" > $pathDBe/Info-secure.txt -echo "Island: $island" > $pathDBe/Info-island.txt -echo "Ping: $ping" > $pathDBe/Info-ping.txt -echo "Map: $map" > $pathDBe/Info-map.txt - -echo "Hive: $hive" > $pathDBe/Info-hive.txt -echo "Battleye: $battleye" > $pathDBe/Info-battleye.txt - -echo "Players: $players" > $pathDBe/Info-players.txt -#echo "Players: $gq_players" >> $pathDBe/Info-players.txt -} varcat=$(cat $statserver) @@ -130,7 +110,7 @@ island=$(echo $varcat | jq -r '.raw.rules.island') mod=$(echo $varcat | jq -r '.raw.tags[63:66]') hive=$(echo $varcat | jq -r '.raw.tags[18:26]') battleye=$(echo $varcat | jq -r '.raw.tags[:8]') -timeserver=$(echo $varcat | jq -r '.raw.tags[67:]') +timeserver=$(echo $varcat | jq -r '.raw.tags[68:]') speedtime=$(echo $varcat | jq -r '.raw.tags[41:42]') speedtimenight=$(echo $varcat | jq -r '.raw.tags[54:55]') timeLeft=$(echo $varcat | jq -r '.raw.rules.timeLeft') @@ -140,16 +120,11 @@ serverstatus="UP" ############### # check -print_info 2>&1 -# print only error -cat $pathDBe/Info-* > $pathDBe/Info_$varMod.txt -# cat $pathDBe/Info_$varMod.txt - echo " [✔] Server UP =>> update mysql" echo " Debug: $numplayers" insert_mysql() { -mysql --user=$DB_USER --password=$DB_PASSWD --database=$DB_NAME << EOF +mysql --host=$DB_SERV --user=$DB_USER --password=$DB_PASSWD --database=$DB_NAME << EOF SET NAMES utf8; insert into $TABLE (\`date\`,\`name\`,\`game\`,\`map\`,\`version\`,\`requiredVersion\`,\`numplayers\`,\`players\`,\`maxplayers\`,\`ping\`,\`timeserver\`,\`hive\`,\`battleye\`,\`connect\`,\`secure\`) VALUES ("$datesql","$name","$game","$map","$version","$requiredVersion","$numplayers","$players","$maxplayers","$ping","$timeserver","$hive","$battleye","$connect","$secure"); @@ -159,4 +134,8 @@ EOF insert_mysql && echo -e "\n ✅ Updated Mysql " || echo -e "\n Huston ,up MYSQL issue" fi + +echo -e "\nCheck Date SQL format:" +echo $date + exit 1