1 | <?php
|
---|
2 |
|
---|
3 | // Funkce pro měření stavových veličin herního serveru hry World of Warcraft
|
---|
4 |
|
---|
5 | include_once('Global.php');
|
---|
6 | include_once('Linux.php');
|
---|
7 |
|
---|
8 | function WoWPlayersOnline()
|
---|
9 | {
|
---|
10 | global $Database;
|
---|
11 |
|
---|
12 | $Database->select_db('realmd');
|
---|
13 | $DbResult = $Database->query('SELECT COUNT(*) FROM account WHERE online=1');
|
---|
14 | $Row = $DbResult->fetch_array();
|
---|
15 | return($Row[0]);
|
---|
16 | }
|
---|
17 |
|
---|
18 | function WoWGMOnline()
|
---|
19 | {
|
---|
20 | global $Database;
|
---|
21 |
|
---|
22 | $Database->select_db('realmd');
|
---|
23 | $DbResult = $Database->query('SELECT COUNT(*) FROM account WHERE online=1 AND gmlevel > 0');
|
---|
24 | $Row = $DbResult->fetch_array();
|
---|
25 | return($Row[0]);
|
---|
26 | }
|
---|
27 |
|
---|
28 | function WoWAccountCount()
|
---|
29 | {
|
---|
30 | global $Database;
|
---|
31 |
|
---|
32 | $Database->select_db('realmd');
|
---|
33 | $DbResult = $Database->query('SELECT COUNT(*) FROM account');
|
---|
34 | $Row = $DbResult->fetch_array();
|
---|
35 | return($Row[0]);
|
---|
36 | }
|
---|
37 |
|
---|
38 | function WoWGuildCount()
|
---|
39 | {
|
---|
40 | global $Database;
|
---|
41 |
|
---|
42 | $Database->select_db('characters');
|
---|
43 | $DbResult = $Database->query('SELECT COUNT(*) FROM guild');
|
---|
44 | $Row = $DbResult->fetch_array();
|
---|
45 | return($Row[0]);
|
---|
46 | }
|
---|
47 |
|
---|
48 | function WoWCharacterCount()
|
---|
49 | {
|
---|
50 | global $Database;
|
---|
51 |
|
---|
52 | $Database->select_db('characters');
|
---|
53 | $DbResult = $Database->query('SELECT COUNT(*) FROM `characters`');
|
---|
54 | $Row = $DbResult->fetch_array();
|
---|
55 | return($Row[0]);
|
---|
56 | }
|
---|
57 |
|
---|
58 | function WoWEmulatorRestartCount()
|
---|
59 | {
|
---|
60 | global $Database;
|
---|
61 |
|
---|
62 | $Database->select_db('mangos');
|
---|
63 | $DbResult = $Database->query('SELECT COUNT(*) FROM uptime');
|
---|
64 | $Row = $DbResult->fetch_array();
|
---|
65 | return($Row[0]);
|
---|
66 | }
|
---|
67 |
|
---|
68 | function WoWEmulatorAvailability()
|
---|
69 | {
|
---|
70 | if(CheckPortStatus('localhost', 8085)) return(100); else return(0);
|
---|
71 | }
|
---|
72 |
|
---|
73 | function WoWTranslatedQuestsCount()
|
---|
74 | {
|
---|
75 | global $Database;
|
---|
76 |
|
---|
77 | $Database->select_db('quests');
|
---|
78 | $DbResult = $Database->query('SELECT ((SELECT count(*) FROM `quests` WHERE Complete = 1 AND Language <> 0) + '.
|
---|
79 | '(SELECT count(*) FROM `npc_text` WHERE Complete = 1 AND Language <> 0) +'.
|
---|
80 | '(SELECT count(*) FROM `page_text` WHERE Complete = 1 AND Language <> 0)'.
|
---|
81 | ') as NumberTranslate');
|
---|
82 | $Row = $DbResult->fetch_array();
|
---|
83 | $Value = $Row[0];
|
---|
84 | return($Value);
|
---|
85 | }
|
---|