playercount, better stats
This commit is contained in:
parent
7673c1dfc1
commit
8427657b64
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__),'');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/realm','');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/world','');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/world','');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/database','');
|
||||
7
mojotrollz/api/database/database.php
Normal file
7
mojotrollz/api/database/database.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
class database {
|
||||
public static function player_online(){
|
||||
//new \DBD\PLAYER_ONLINE($count);
|
||||
$count = \DBD\PLAYER_ONLINE::Q1()['count'];
|
||||
return $count;}
|
||||
}
|
||||
@ -2,6 +2,6 @@
|
||||
class realm {
|
||||
public static function status(){
|
||||
$res = shell_exec('/home/mojotrolls/mojo_zero/realm status 2>&1');
|
||||
($res == 1) ? new WOW_STATS_ONLINE() : new WOW_STATS_OFLINE();
|
||||
($res == 1) ? new WOW_STATS_REALM_ONLINE() : new WOW_STATS_REALM_OFFLINE();
|
||||
return ($res == 1) ? '<status>on</status>' : '<status>off</status>';}
|
||||
}
|
||||
@ -2,6 +2,6 @@
|
||||
class world {
|
||||
public static function status(){
|
||||
$res = shell_exec('/home/mojotrolls/mojo_zero/world status 2>&1');
|
||||
($res == 1) ? new WOW_STATS_ONLINE() : new WOW_STATS_OFLINE();
|
||||
($res == 1) ? new WOW_STATS_WORLD_ONLINE() : new WOW_STATS_WORLD_OFFLINE();
|
||||
return ($res == 1) ? '<status>on</status>' : '<status>off</status>';}
|
||||
}
|
||||
|
||||
@ -4,5 +4,5 @@ namespace DBD;
|
||||
class mangos_chars extends \SYSTEM\DB\DBInfoMYS {
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct('mangos_one_chars', 'mojotrolls_dev', 'dsjgfasudzfsvad', '127.0.0.1');}
|
||||
parent::__construct('mangos_zero_chars', 'mojotrolls_dev', 'dsjgfasudzfsvad', '127.0.0.1');}
|
||||
}
|
||||
|
||||
@ -8,8 +8,10 @@ class ONLINE_STATS extends \SYSTEM\DB\QP {
|
||||
'',
|
||||
//mys
|
||||
'SELECT DATE_FORMAT(FROM_UNIXTIME(UNIX_TIMESTAMP('.\SYSTEM\DBD\system_log::FIELD_TIME.') - MOD(UNIX_TIMESTAMP('.\SYSTEM\DBD\system_log::FIELD_TIME.'),?)),"%Y/%m/%d %H:%i:%s") as day,'
|
||||
.'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = \'WOW_STATS_ONLINE\' then 1 else 0 end) online,'
|
||||
.'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = \'WOW_STATS_OFLINE\' then 1 else 0 end) Ofline'
|
||||
.'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = \'WOW_STATS_REALM_ONLINE\' then 1 else 0 end) realm_on,'
|
||||
.'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = \'WOW_STATS_REALM_OFFLINE\' then 1 else 0 end) realm_off,'
|
||||
.'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = \'WOW_STATS_WORLD_OFFLINE\' then 1 else 0 end) world_off,'
|
||||
.'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = \'WOW_STATS_WORLD_ONLINE\' then 1 else 0 end) world_on'
|
||||
.' FROM '.\SYSTEM\DBD\system_log::NAME_MYS
|
||||
.' GROUP BY day'
|
||||
.' ORDER BY day DESC'
|
||||
|
||||
13
mojotrollz/dbd/qq/PLAYER_ONLINE.php
Normal file
13
mojotrollz/dbd/qq/PLAYER_ONLINE.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class PLAYER_ONLINE extends \SYSTEM\DB\QQ {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
'SELECT count(*) as count FROM characters WHERE online="1"',
|
||||
new \DBD\mangos_chars()
|
||||
);}}
|
||||
|
||||
@ -1,2 +0,0 @@
|
||||
<?php
|
||||
class WOW_STATS_OFLINE extends \SYSTEM\LOG\INFO {}
|
||||
@ -1,2 +0,0 @@
|
||||
<?php
|
||||
class WOW_STATS_ONLINE extends \SYSTEM\LOG\INFO {}
|
||||
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class WOW_STATS_PLAYER extends \SYSTEM\LOG\INFO {
|
||||
public function __construct($player_count){
|
||||
parent::__construct($player_count);}
|
||||
}
|
||||
|
||||
2
mojotrollz/log/WOW_STATS_PLAYER_ONLINE.php
Normal file
2
mojotrollz/log/WOW_STATS_PLAYER_ONLINE.php
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
class WOW_STATS_PLAYER_ONLINE extends \SYSTEM\LOG\INFO {}
|
||||
2
mojotrollz/log/WOW_STATS_REALM_OFFLINE.php
Normal file
2
mojotrollz/log/WOW_STATS_REALM_OFFLINE.php
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
class WOW_STATS_REALM_OFFLINE extends \SYSTEM\LOG\INFO {}
|
||||
2
mojotrollz/log/WOW_STATS_REALM_ONLINE.php
Normal file
2
mojotrollz/log/WOW_STATS_REALM_ONLINE.php
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
class WOW_STATS_REALM_ONLINE extends \SYSTEM\LOG\INFO {}
|
||||
2
mojotrollz/log/WOW_STATS_WORLD_OFFLINE.php
Normal file
2
mojotrollz/log/WOW_STATS_WORLD_OFFLINE.php
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
class WOW_STATS_WORLD_OFFLINE extends \SYSTEM\LOG\INFO {}
|
||||
2
mojotrollz/log/WOW_STATS_WORLD_ONLINE.php
Normal file
2
mojotrollz/log/WOW_STATS_WORLD_ONLINE.php
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
class WOW_STATS_WORLD_ONLINE extends \SYSTEM\LOG\INFO {}
|
||||
@ -35,6 +35,7 @@ class default_page extends SYSTEM\PAGE\Page {
|
||||
$vars['inprint'] = '';
|
||||
$vars['realm_status'] = realm::status();
|
||||
$vars['world_status'] = world::status();
|
||||
$vars['player_online'] = database::player_online();
|
||||
$vars = array_merge($vars, \SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_MAINPAGE),
|
||||
\SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_WOW_SERVERINFO),
|
||||
\SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_BASIC));
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
<font color="red" size="1">This Server is currently closed for the Public. Be gone.</font>
|
||||
<p>Realm Server: ${realm_status}</p>
|
||||
<p>World Server: ${world_status}</p>
|
||||
<p>Players Online: ${player_online}</p>
|
||||
|
||||
<H3>Server Help</H3>
|
||||
<p><a href="${url_realmlistwtf}" target="_blank">Download realmlist.wtf</a></p>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user