#305 attach botcount to log instead of ts query

This commit is contained in:
Ulf Gebhardt 2017-01-16 22:10:56 +01:00
parent 9f2f0c0957
commit 5544032e03
2 changed files with 12 additions and 3 deletions

View File

@ -1,9 +1,7 @@
<?php
class cron_server_bot_tbc_live implements \SYSTEM\CRON\cronjob{
public static function run(){
\LIB\lib_ts3::php();
$ts3 = TeamSpeak3::factory("serverquery://mojotrollztsquery:9aYllYkG@127.0.0.1:10011/");
$bot_count = $ts3->serverGetByPort(9987)->clientCount();
$bot_count = \SQL\CRON_BOT_COUNT::Q1()['bot_count'];
$bots = \SQL\CRON_RANDOM_BOTS::QQ();
while($bot = $bots->next()){

View File

@ -0,0 +1,11 @@
<?php
namespace SQL;
class CRON_BOT_COUNT extends \SYSTEM\DB\QQ {
public static function get_class(){return \get_class();}
public static function mysql(){return
'SELECT code as bot_count FROM system_log'.
' WHERE class="LOG\\PLAYER_COUNT_TS"'.
' ORDER BY `time` DESC'.
' LIMIT 1';
}
}