mmueller-87
Mitglied
Hallo, vielen dank für deine Antwort. Leider hilft das nichts. Das Resultat ist dieses hier: http://gs.web4f.de/webrcon/metalist.php
Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
function PlayerInfo() {
if (!$this->Connected)
return $this->Connected;
$RConResult = $this->RconCommand('status');
if (!$RConResult || trim($RConResult) == 'Bad rcon_password.')
return $RConResult;
$arrLine = explode("\n", $RConResult);
$SrvMap = substr($arrLine[3], strpos($arrLine[3], ':') + 1);
$Players = trim(
substr($arrLine[4], strpos($arrLine[4], ':') + 1)
); $ativePlayers = explode(" ", $Players);
$Result['ServerIp'] = trim(
substr($arrLine[2], strpos($arrLine[2], ':') + 1)
); $Result['ServerName'] = trim(
substr($arrLine[0], strpos($arrLine[0], ':') + 1)
); $Result['ServerMap'] = trim(
substr($SrvMap, 0, strpos($SrvMap, 'at:'))
); $Result['ServerMod'] = 'Counterstrike '.trim(
substr($arrLine[1], strpos($arrLine[1], ':') + 1)
); $Result['Game'] = 'Halflife';
$Result['activePlayers'] = $ativePlayers[0];
$Result['maxPlayers'] = substr($ativePlayers[2], 1);
for($i = 1; $i <= $Result['activePlayers']; $i++) {
$Temp = $arrLine[$i + 6];
if (substr_count($Temp, '#') <= 0)
break;
$BeginTmp = strpos($Temp, "\"") + 1;
$EndTmp = strrpos($Temp, "\"");
$Result[$i]['PlayerName'] = substr($Temp, $BeginTmp, $EndTmp - $BeginTmp);
$Temp = trim(substr($Temp, $EndTmp + 1));
$EndTmp = strpos($Temp, ' ');
$Result[$i]['PlayerId'] = substr($Temp, 0, $EndTmp);
$Temp = trim(substr($Temp, $EndTmp));
$EndTmp = strpos($Temp, ' ');
$Result[$i]['PlayerWonId'] = substr($Temp, 0, $EndTmp);
$Temp = trim(substr($Temp, $EndTmp));
$EndTmp = strpos($Temp, ' ');
$Result[$i]['PlayerFrags'] = substr($Temp, 0, $EndTmp);
$Temp = trim(substr($Temp, $EndTmp));
$EndTmp = strpos($Temp, ' ');
$Result[$i]['PlayerTime'] = substr($Temp, 0, $EndTmp);
$Temp = trim(substr($Temp, $EndTmp));
$EndTmp = strpos($Temp, ' ');
$Result[$i]['PlayerPing'] = substr($Temp, 0, $EndTmp);
$Temp = trim(substr($Temp, $EndTmp));
$Temp = trim(substr($Temp, $EndTmp));
$Result[$i]['PlayerIp'] = $Temp;
}
return $Result;
}
UserID filter list: 4 entries
1 STEAM_0:1:64439552 : 120.000 min
2 STEAM_0:1:34003545 : 10.000 min
3 STEAM_0:1:42585000 : 100.000 min
4 STEAM_0:1:51745122 : 100.000 min
Array
(
[0] => array
(
[userid] => 1,
[steamid] => STEAM_0:1:64439552,
[banntime] => '120.000 min',
),
[1] => array
(
[userid] => 2,
[steamid] => STEAM_0:1:34003545,
[banntime] => '10.000 min',
),
[2] => array
(
[userid] => 3,
[steamid] => STEAM_0:1:42585000,
[banntime] => '100.000 min',
),
[3] => array
(
[userid] => 4,
[steamid] => STEAM_0:1:51745122,
[banntime] => '100.000 min',
),
)