source: branches/mvc/Application/Model/Measurement/WoW.php

Last change on this file was 43, checked in by george, 15 years ago
  • Upraveno: Skripty pro načítání hodnot byly pročištěny a přepsány na třídy. Pro definici místně měřených veličin nyní použita tabulky MeasureClient odkazující se na tabulku MeasureMethod obsahující globální registr měřících metod.
  • Opraveno: Různé chyby vzniklé při přepisu třídy Measure a použité pro zobrazení obrázku grafu.
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); else return(0);
60 }
61
62 function WoWTranslatedQuestsCount()
63 {
64 $this->Database->select_db('quests');
65 $DbResult = $Database->query('SELECT ((SELECT count(*) FROM `quests` WHERE Complete = 1 AND Language <> 0) + '.
66 '(SELECT count(*) FROM `npc_text` WHERE Complete = 1 AND Language <> 0) +'.
67 '(SELECT count(*) FROM `page_text` WHERE Complete = 1 AND Language <> 0)'.
68 ') as NumberTranslate');
69 $Row = $DbResult->fetch_array();
70 $Value = $Row[0];
71 return($Value);
72 }
73}
Note: See TracBrowser for help on using the repository browser.