Перейти к содержимому
View in the app

A better way to browse. Learn more.

Zloplay community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Опубликовано:

Hello, there is a (little) Problem with my Gameservers.

 

Serverstatus-Script says that the Servers are offline.

 

4D1 In-Game Serverlist says that the Servers are online. (i'm able to play on them)

Was there a Update for the Servers or something?.

 

 

(Link to Statuspage -> http://www.ien-clan.de/index.php?page=Custom&pageID=1)

Featured Replies

Опубликовано:
  • Автор

<?php
$timeout = 0.5; //Timeout in Sekunden
$html = <<
Servername:
{sv_hostname}
Server IP:
{ip}:{port}
Map:
{mapname}
{mapname}.jpg
Spieltyp:
{g_gametype}
Spieler:
{currentplayers}/{sv_maxclients}

HEREDOC;

/* CONFIG END */

$con = fsockopen("udp://$ip", $port, $errno, $errstr, 3);

if (!$con) {
echo "Server offline\n";
}
else {
fwrite($con, "\xFF\xFF\xFF\xFFgetstatus\x00");
stream_set_timeout($con, (int) $timeout, ($timeout - ((int) $timeout)) * 100000);
$start = microtime(true);
$s = "";
do {
$s .= substr(fread($con, 9999), 10);
$info = stream_get_meta_data($con);
if (!isset($end)) {
$end = microtime(true);
}
}
while(!$info["timed_out"]) ;


if (empty($s)) {
echo "Server offline!\n";
}
else {
$ping = round(($end - $start) * 1000) . " ms";

list($dummy, $dvarslist, $playerlist) = explode("\n", $s, 3);

$dvarslist = explode("\\", $dvarslist);
$dvars = array();
for ($i = 1; $i < count($dvarslist); $i += 2) {
$dvars[$dvarslist[$i]] = htmlentities(trimcolor($dvarslist[$i + 1]));
}

$playerlist = explode("\n", $playerlist);
array_pop($playerlist);
$players = array();
foreach ($playerlist as $value) {
list($score, $pingp, $name) = explode(" ", $value, 3);
$players[] = array(
"name" => htmlspecialchars(trimcolor(substr($name, 1, -1))),
"score" => $score,
"ping" => $pingp
);
}

$dvars["mapname"] = getmap($dvars["mapname"]);
$dvars["g_gametype"] = getgametype($dvars["g_gametype"]);
$dvars["fs_game"] = getmods($dvars["fs_game"]);
$dvars["sv_punkbuster"] = getpb($dvars["sv_punkbuster"]);
$dvars["pswrd"] = getpw($dvars["pswrd"]);


$playerlist = "";
foreach ($players as $value) {
$playerlist .= "$value[name]$value[score]$value[ping]\n";
}

$search[] = "{playerlist}";
$replace[] = $playerlist;
$search[] = "{ping}";
$replace[] = $ping;
$search[] = "{ip}";
$replace[] = $ip;
$search[] = "{port}";
$replace[] = $port;
$search[] = "{currentplayers}";
$replace[] = count($players);

foreach ($dvars as $key => $value) {
$search[] = "{" . $key ."}";
$replace[] = $value;
}

echo str_replace($search, $replace, $html);
}
}


function trimcolor($name) {
return preg_replace('|\^.|', '', $name);
}

function getmap($short) {
$maps = array(
// Call of Duty: World at War Maps
"mp_highrise" => "Highrise",
"mp_afghan" => "Afghan",
"mp_checkpoint" => "Karachi",
"mp_terminal" => "Terminal",
"mp_rust" => "Rust",
"mp_complex" => "Bailout",
"mp_dome" => "Dome",
"mp_downfall" => "Downfall",
"mp_hangar" => "Hangar",
"mp_outskirts" => "Outskirts",
"mp_seelow" => "Seelow",
"mp_suburban" => "Upheaval",
"mp_courtyard" => "Hof",

// Call of Duty 4: Modern Warfare Maps
"mp_backlot" => "Backlot",
"mp_bloc" => "Bloc",
"mp_bog" => "Bog",
"mp_cargoship" => "Wet Work",
"mp_citystreets" => "District",
"mp_convoy" => "Ambush",
"mp_countdown" => "Countdown",
"mp_crash" => "Crash",
"mp_crash_snow" => "Winter Crash",
"mp_crossfire" => "Crossfire",
"mp_farm" => "Downpour",
"mp_overgrown" => "Overgrown",
"mp_pipeline" => "Pipeline",
"mp_showdown" => "Showdown",
"mp_strike" => "Strike",
"mp_vacant" => "Vacant",
"mp_shipment" => "Shipment",
"mp_broadcast" => "Broadcast",
"mp_carentan" => "Chinatown",
"mp_creek" => "Creek",
"mp_killhouse" => "Killhouse"

);
if (array_key_exists($short, $maps)) {
return $maps[$short];
}
return $short;
}
function getgametype($short) {
$gametypes = array(
"dom" => "Herrschaft",
"dm" => "Frei fГјr Alle",
"war" => "Team-Deathmatch",
"sab" => "Sabotage",
"sd" => "Suchen und ZerstГ¶ren",
"koth" => "Hauptquatier",
"ctf" => "Capture the Flag",
"twar" => "Krieg"
);
if (array_key_exists($short, $gametypes)) {
return $gametypes[$short];
}
return $short;
}
function getmods($short) {
$mods = array(
"" => "Kein Mod",
"mods/pam4" => "Pam4",
"mods/promod_version3" => "Promod Version 3",
);
if (array_key_exists($short, $mods)) {
return $mods[$short];
}
return $short;
}
function getpb($short) {
$pb = array(
"1" => "An",
"0" => "Aus",
);
if (array_key_exists($short, $pb)) {
return $pb[$short];
}
return $short;
}
function getpw($short) {
$pw = array(
"1" => "Ja",
"0" => "Nein",
);
if (array_key_exists($short, $pw)) {
return $pw[$short];
}
return $short;
}
?>

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Гость
Ответить в тему...

Сейчас на странице 0

  • Нет пользователей, просматривающих эту страницу

Важная информация

Используя этот сайт, вы соглашаетесь Условия использования.

Account

Navigation

Поиск

Поиск

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.