Skip to content

Commit ddc1ff5

Browse files
committed
Add dayz support
1 parent 30c4b55 commit ddc1ff5

File tree

10 files changed

+53
-5
lines changed

10 files changed

+53
-5
lines changed

html/img/logo/dayz.webp

1.6 KB
Binary file not shown.

html/img/map/chernarusplus.webp

43.7 KB
Binary file not shown.

html/reload.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,14 @@ function LoadData(id) {
109109
tbody.innerHTML += rulename+rulevalue;
110110
}
111111
}
112-
} else if (type === "valheim") {
112+
} else if (type === "valheim") {
113113
serverid.getElementsByClassName("maxplayers")[0].innerHTML = " "+data.MaxPlayers;
114114
serverid.getElementsByClassName("queryport")[0].innerHTML = " "+data.QueryPort;
115115

116+
} else if (type === "dayz") {
117+
serverid.getElementsByClassName("map")[0].src = data.raw.MapLink;
118+
serverid.getElementsByClassName("tags")[0].innerHTML = data.raw.Tags;
119+
116120
}
117121

118122
// Display Players
@@ -127,7 +131,7 @@ function LoadData(id) {
127131
}
128132
}
129133
// Display System, Password, Map
130-
if (type === "arkse" || type === "rust" || type === "vrising" || type === "csgo" || type === "valheim") {
134+
if (type === "arkse" || type === "rust" || type === "vrising" || type === "csgo" || type === "valheim" || type === "dayz") {
131135
serverid.getElementsByClassName("system")[0].innerHTML = " "+data.raw.OS;
132136
if (type !== "valheim") {serverid.getElementsByClassName("password")[0].innerHTML = " "+data.raw.Password;}
133137
serverid.getElementsByClassName("mapname")[0].innerHTML = " "+data.raw.Map;

html/tabs.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@
4747
echo '<div class="flex"><span style="font-weight: 500;">Map:</span><div class="mapname"></div></div>';
4848
echo '<div class="flex"><span style="font-weight: 500;">Uptime:</span><div class="rustuptime"></div></div>';
4949
}
50+
elseif ($type == "dayz") {
51+
echo '<img class="map">';
52+
echo '<div class="flex" style="max-width: 234px;"><span style="font-weight: 500;">Map:</span><div class="mapname"></div></div>';
53+
}
5054
?>
5155
</div>
5256
<!-- DETAILS -->
@@ -95,10 +99,17 @@
9599
echo "<div style='max-height:166px;overflow-y:scroll;'><div style='max-width:300px'><span style='font-weight: 500;'>Tags:</span><div class='tags'></div></div>";
96100
echo "<span style='font-weight: 500;'>Description:</span><div class='description'></div><br>";
97101
echo "</div>";
102+
} elseif ($type == "dayz") {
103+
echo "<div class='flex'><span style='font-weight: 500;'>System:</span><div class='system'></div><br></div>";
104+
echo "<div class='flex'><span style='font-weight: 500;'>".$language[$lang][12].":</span><div class='password'></div><br></div>";
105+
echo "<div class='flex'><span style='font-weight: 500;'>Version:</span><div class='sversion'></div><br></div>";
106+
echo "<div style='max-height:166px;overflow-y:scroll;'><div style='max-width:300px'><span style='font-weight: 500;'>Tags:</span><div class='tags'></div></div>";
107+
echo "</div>";
108+
98109
}
99110
?>
100111
</div>
101-
<div class="movediv<?php if ($type == "csgo" && isset($csgorules)){echo " csmovedivhide";} elseif ($type == "minecraft"){echo " mcmovedivhide";} elseif ($type == "valheim"){echo " valheim";}?>"></div>
112+
<div class="movediv<?php if ($type == "csgo" && isset($csgorules)){echo " csmovedivhide";} elseif ($type == "minecraft"){echo " mcmovedivhide";} elseif ($type == "valheim"){echo " valheim";}elseif ($type == "dayz"){echo " dayz";}?>"></div>
102113
<!-- DIV III (Not used yet) -->
103114
<div class="III"></div>
104115
<div class="IV" style="display:<?php echo $display['IV']?>">

html/type/query.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
case "protocol-valve":
3131
case "rust":
3232
case "arkse":
33+
case "dayz":
3334
// Get the operating system and convert it to full name
3435
if (function_exists("convertos")) {
3536
$Os = $serverstatus->info->Os ?? '';
@@ -267,6 +268,20 @@
267268
$GameTags = str_replace(",", ", ", $GameTags);
268269
$maplink = "html/img/map/$map.webp";
269270
break;
271+
case "dayz":
272+
// Check if server has a password
273+
$password = $serverstatus->rules->ServerPassword_b ?? '';
274+
if ($password == "True" || $password == "true") {$password = $language[$lang][14];} else {$password = $language[$lang][15];}
275+
// Get the game tags
276+
$GameTags = $serverstatus->info->GameTags;
277+
$GameTags = preg_replace("/,/", ", ", $GameTags);
278+
$officialmaps = array("chernarusplus", "chernarus");
279+
if (in_array($map, $officialmaps)) {
280+
$maplink = "html/img/map/chernarusplus.webp";
281+
} else {
282+
$maplink = "html/img/map/modmap.webp";
283+
}
284+
break;
270285
case "rust":
271286
$playernames = $serverstatus->players;
272287
$count = 0;

query/sourcequery.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
$queryresult["players"] = $Query->GetPlayers();
1313
$queryresult["rules"] = $Query->GetRules();
1414
break;
15-
// Why do I isolate csfo from the other servers? Because CSGO doesn't always respond to a A2S_RULES query.
15+
case "dayz":
16+
$queryresult["players"] = $Query->GetPlayers();
17+
18+
break;
1619
case "csgo":
1720
$lastplayerline = json_decode(tailCustom("query/cron/$ServerID.json", 1));
1821
// I check with the cronjob if the server accepts A2S_Rules Requests.

reload.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
case "protocol-valve":
5555
case "arkse":
5656
case "vrising":
57+
case "dayz":
5758
case "rust":
5859
include 'query/sourcequery.php';
5960
break;
@@ -84,6 +85,7 @@
8485
case "arkse":
8586
case "vrising":
8687
case "rust":
88+
case "dayz":
8789
//if ($password == "true") {$password = "True";} elseif ($password == "false") {$password = "False";}
8890
$response['raw']['OS'] = $Os;
8991
$response['raw']['Password'] = $password;
@@ -142,6 +144,10 @@
142144
$response['raw']['Tags'] = $GameTags;
143145
$response['raw']['MapLink'] = $maplink;
144146
break;
147+
case "dayz":
148+
$response['raw']['Tags'] = $GameTags;
149+
$response['raw']['MapLink'] = $maplink;
150+
break;
145151
case "rust":
146152
$mapurl = "https://rustmaps.com/map/".$worldsize."_".$seed."?embed=img_i_l";
147153
$metas = get_meta_tags($mapurl);

users/control/script.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ function selecttype() {
2323
} else if (type === "rust") {
2424
text = "If you don't want to use rcon, use 0 as rcon port.";
2525
document.getElementById("input-qport").required = true;
26+
} else if (type === "dayz") {
27+
text = "If you don't want to use rcon, use 0 as rcon port.";
28+
document.getElementById("input-qport").required = true;
2629
}
2730
document.getElementById("notes").innerHTML = text;
2831
}

users/control/server.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ function deleteserver($id, $arrayresult) {
198198
case "vrising":
199199
case "protocol-valve":
200200
case "rust":
201+
case "dayz":
201202
case "arkse":
202203
$Query = new SourceQuery();
203204
try {
@@ -507,6 +508,7 @@ function deleteserver($id, $arrayresult) {
507508
case "protocol-valve":
508509
case "arkse":
509510
case "vrising":
511+
case "dayz":
510512
case "rust":
511513
include '../../query/sourcequery.php';
512514
break;
@@ -667,6 +669,7 @@ function checkpattern() {
667669
case "vrising":
668670
case "protocol-valve":
669671
case "rust":
672+
case "dayz":
670673
case "arkse":
671674
echo '<span style="font-weight: 500;">System:</span>'.$Os.'<br>';
672675
break;
@@ -767,10 +770,12 @@ function getusernames() {
767770
<option disabled selected value style="display:none">select a game</option>
768771
<option value="arkse">ARK Survival Evolved</option>
769772
<option value="csgo">Counter-Strike: Global Offensive</option>
773+
<option value="dayz">DayZ</option>
770774
<option value="minecraft">Minecraft</option>
775+
<option value="rust">Rust</option>
771776
<option value="valheim">Valheim</option>
772777
<option value="vrising">Vrising</option>
773-
<option value="rust">Rust</option>
778+
774779
</select>
775780
</label>
776781
<div class="input">

users/control/smallserver.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
case "valheim":
4545
case "protocol-valve":
4646
case "arkse":
47+
case "dayz":
4748
case "vrising":
4849
case "rust":
4950
include '../../query/sourcequery.php';

0 commit comments

Comments
 (0)