1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202. | <?php
require_once('inc/GameQ.php');
include_once("inc/ts3admin.class.php");
require 'inc/class.cache.php';
$serwer=array();
$main = array();
$main['cache_time']=30;
$main['dateformat'] = "Y-M-d H:i:s";
$automatyczne_odswiezanie=30; // Co ile sekund tabela się odświeża. 0 - wyłącza odświeżanie.
$licz['ts3']=0; // Czy ma liczyć sloty z serwerów TS3 w podsumowaniu na końcu tabeli 0-nie 1-tak
$licz['ventrilo']=0; // Czy ma liczyć sloty z serwerów Ventrilo w podsumowaniu na końcu tabeli 0-nie 1-tak
$podsumowanie=1; // Czy pokazywać podsumowanie: Aktualnie na naszych 3 serwerach gra... 0-nie 1-tak
$nazwa_serwera=0; // Pobierać nazwę serwera przy połączeniu czy używać tej wpisanej niżej. (tylko w przypadku serwerów cs)
// 0 - Stała nazwa serwera pobierana z tego pliku
// 1 - Nazwa serwera pobierana przy połączeniu z serwerem.
/*W pole game wpisujemy skrót od gry. Dostępne gry:
ts3 - Team Speak 3
cs - Counter Strike 1.6
ventrilo - Ventrilo
tf2 - Team Fortress 2
csgo - Counter Strike: Global Offensive
cod2 - Call of Duty 2
cod4 - Call of Duty 4
cssource - Counter Strike: Source
*/
$cvars[]= array(
'cs'=>array(0=>array(0=>'amxmodx_version',1=>'Wersja amxx:'),1=>array(0=>'amxbans_version',1=>'Wersja amxbans:'),2=>array(0=>'mp_timelimit',1=>'Czas mapy:')),
'csgo'=>array(0=>array(0=>'sourcemod_version',1=>'Wersja SourceMod:'),1=>array(0=>'mp_maxrounds',1=>'Liczba rund:'),2=>array(0=>'deathmatch',1=>'DeathMatch:')),
'cssource'=>array(0=>array(0=>'sourcemod_version',1=>'Wersja SourceMod:'),1=>array(0=>'mp_maxrounds',1=>'Liczba rund:'),2=>array(0=>'deathmatch',1=>'DeathMatch:')),
'tf2'=>array(0=>array(0=>'mp_allowNPCs',1=>'NPC Włączone:'),1=>array(0=>'mp_timelimit',1=>'Czas mapy:'),2=>array(0=>'deathmatch',1=>'DeathMatch:')),
'ventrilo'=>array(0=>array(0=>'version',1=>'Wersja:'),1=>array(0=>'channelcount',1=>'Liczba kanałów:'),2=>array(0=>'uptime',1=>'Czas online:')),
'ts3'=>array(0=>array(0=>'virtualserver_version',1=>'Wersja:'),1=>array(0=>'virtualserver_channelsonline',1=>'Liczba kanałów:'),2=>array(0=>'virtualserver_uptime',1=>'Czas online:')),
'cod2'=>array(0=>array(0=>'g_gametype',1=>'Typ gry:'),1=>array(0=>'shortversion',1=>'Wersja:'),2=>array(0=>'scr_friendlyfire',1=>'FriendlyFire:')),
'cod4'=>array(0=>array(0=>'g_gametype',1=>'Typ gry:'),1=>array(0=>'shortversion',1=>'Wersja:'),2=>array(0=>'_Mod',1=>'Mod:')),
);
$games[]=array(
'cs'=>'Counter Strike 1.6',
'csgo'=>'Counter Strike: Global Offensive',
'cssource'=>'Counter Strike: Source',
'tf2'=>'Team Fortress 2',
'ventrilo'=>'Ventrilo',
'ts3'=>'Team Speak 3',
'cod2'=>'Call of Duty 2',
'cod4'=>'Call of Duty 4',
);
$serwers[]=array(
'nazwa'=>'BF2 [CS]',
'ip'=>'31.186.83.163:27066',
'game'=>'cs',
'hltv'=>'',
'on'=>1,
'new'=>0,
'offline'=>0);
$serwers[]=array(
'nazwa'=>'4fun [CS]',
'ip'=>'91.210.128.55:27020',
'game'=>'cs',
'hltv'=>'',
'on'=>1,
'new'=>0,
'offline'=>0);
$serwers[]=array(
'nazwa'=>'PB [CS]',
'ip'=>'31.186.82.137:27466',
'game'=>'cs',
'hltv'=>'',
'on'=>1,
'new'=>0,
'offline'=>0);
$serwers[]=array(
'nazwa'=>'Elite COD [CS]',
'ip'=>'91.203.223.45:27045',
'game'=>'cs',
'hltv'=>'',
'on'=>1,
'new'=>0,
'offline'=>0);
$serwers[]=array(
'nazwa'=>'[TS3] - Cs-Patrioci.pl',
'ip'=>'5.231.56.101',
'game'=>'ts3',
'hltv'=>'',
'on'=>1,
'new'=>0,
'offline'=>0);
function logErrors($title, $content)
{
$dir='log';
if(!file_exists($dir) && !file_exists('status/log'))
mkdir($dir);
else if(!file_exists($dir) && file_exists('status/log'))
$dir='status/log';
if(strstr($content,'(Connection timed out)'))
return false;
$plik = $dir."/".date('dmy').".log";
$open = fopen( $plik, "a");
flock( $open, 2);
fputs( $open, "\n$title\n$content\n");
flock( $open, 1);
fclose( $open );
}
function error($errCode, $errString, $errFile, $errLine)
{
if(!defined('E_STRICT'))
define('E_STRICT', 2048);
$user = $_SERVER['REMOTE_ADDR'];
$uri = $_SERVER['REQUEST_URI'];
$content = "[".date("d.m.Y h:i:s")."]\n";
$content .= "Błąd skryptu '$errFile' w linii $errLine ";
$content .= "wywołany żądaniem '$uri' przez użytkownika $user ( ";
$content .= @gethostbyaddr($user);
$content .= " )\n$errString";
switch($errCode)
{
case E_USER_ERROR:
case E_ERROR:
case E_COMPILE_ERROR:
case E_CORE_ERROR:
echo logErrors("Błąd krytyczny", $content);
exit(1);
break;
case E_USER_WARNING:
case E_CORE_WARNING:
case E_COMPILE_WARNING:
case E_WARNING:
echo logErrors("Ostrzeżenie", $content);
break;
case E_STRICT:
case E_NOTICE:
case E_USER_NOTICE:
case E_PARSE;
echo logErrors("Uwaga", $content);
break;
default:
echo logErrors("Nieznany błąd - $errCode", $content);
break;
}
return true;
}
set_error_handler('error');
function ae_detect_ie()
{
if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false))
return true;
else
return false;
}
function fetch_server_info($ip, $port) {
$socket = @fsockopen($ip, $port, $errno, $errstr, 0.5);
if ($socket === false) {
return false;
}
fwrite($socket, "\xfe");
$data = fread($socket, 256);
if (substr($data, 0, 1) != "\xff") {
return false;
}
$data = explode('§', mb_convert_encoding(substr($data, 3), 'UTF-16', 'UCS-2'));
return array(
'motd' => $data[0],
'players' => intval($data[1]),
'max_players' => intval($data[2]),
);
var_dump($data);
}
?> |