source: trunk/Modules/TimeMeasure/Measurement/WoW.php

Last change on this file was 874, checked in by chronos, 5 years ago
  • Modified: Do not use parenthesis around returned value.
File size: 2.0 KB
Line 
1<?php
2
3// Funkce pro měření stavových veličin emulátoru hry World of Warcraft
4
5include_once(dirname(__FILE__).'/Measurement.php');
6
7class WoWMeasurement extends Measurement
8{
9 function WoWPlayersOnline()
10 {
11 $this->Database->select_db('realmd');
12 $DbResult = $Database->query('SELECT COUNT(*) FROM account WHERE online=1');
13 $Row = $DbResult->fetch_array();
14 return $Row[0];
15 }
16
17 function WoWGMOnline()
18 {
19 $this->Database->select_db('realmd');
20 $DbResult = $Database->query('SELECT COUNT(*) FROM account WHERE online=1 AND gmlevel > 0');
21 $Row = $DbResult->fetch_array();
22 return $Row[0];
23 }
24
25 function WoWAccountCount()
26 {
27 $this->Database->select_db('realmd');
28 $DbResult = $Database->query('SELECT COUNT(*) FROM account');
29 $Row = $DbResult->fetch_array();
30 return $Row[0];
31 }
32
33 function WoWGuildCount()
34 {
35 $this->Database->select_db('characters');
36 $DbResult = $Database->query('SELECT COUNT(*) FROM guild');
37 $Row = $DbResult->fetch_array();
38 return $Row[0];
39 }
40
41 function WoWCharacterCount()
42 {
43 $this->Database->select_db('characters');
44 $DbResult = $Database->query('SELECT COUNT(*) FROM `characters`');
45 $Row = $DbResult->fetch_array();
46 return $Row[0];
47 }
48
49 function WoWEmulatorRestartCount()
50 {
51 $this->Database->select_db('mangos');
52 $DbResult = $Database->query('SELECT COUNT(*) FROM uptime');
53 $Row = $DbResult->fetch_array();
54 return $Row[0];
55 }
56
57 function WoWEmulatorAvailability()
58 {
59 if (CheckPortStatus('localhost', 8085)) return 100;
60 else return 0;
61 }
62
63 function WoWTranslatedQuestsCount()
64 {
65 $this->Database->select_db('quests');
66 $DbResult = $Database->query('SELECT ((SELECT count(*) FROM `quests` WHERE Complete = 1 AND Language <> 0) + '.
67 '(SELECT count(*) FROM `npc_text` WHERE Complete = 1 AND Language <> 0) +'.
68 '(SELECT count(*) FROM `page_text` WHERE Complete = 1 AND Language <> 0)'.
69 ') as NumberTranslate');
70 $Row = $DbResult->fetch_array();
71 $Value = $Row[0];
72 return $Value;
73 }
74}
Note: See TracBrowser for help on using the repository browser.