source: branches/mvc/measure_scripts/wow.php

Last change on this file was 37, checked in by george, 16 years ago

Změna rozvržení složek na klasický styl trunk, branches a tags. Stránka o vývoji přehozena do složky devel a vlastní pomocné skripty do složky custom.

File size: 2.0 KB
Line 
1<?php
2
3// Funkce pro měření stavových veličin herního serveru hry World of Warcraft
4
5include_once('../global.php');
6include_once('system.php');
7
8function 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
18function 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
28function 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
38function 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
48function 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
58function 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
68function WoWEmulatorAvailability()
69{
70 if(CheckPortStatus('localhost', 8085)) return(100); else return(0);
71}
72
73function 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}
Note: See TracBrowser for help on using the repository browser.