#238 split server handling saimod

This commit is contained in:
Ulf Gebhardt 2016-12-13 07:49:51 +01:00
parent a839efc679
commit b8a36bd69b
24 changed files with 2093 additions and 415 deletions

View File

@ -1,7 +1,9 @@
<?php
require_once dirname(__FILE__).'/saimod_mojotrollz_servers/autoload.inc';
require_once dirname(__FILE__).'/saimod_mojotrollz_downloads/autoload.inc';
require_once dirname(__FILE__).'/saimod_mojotrollz_server_handling/autoload.inc';
require_once dirname(__FILE__).'/saimod_mojotrollz_server_tbc/autoload.inc';
require_once dirname(__FILE__).'/saimod_mojotrollz_server_classic/autoload.inc';
require_once dirname(__FILE__).'/saimod_mojotrollz_teamspeak/autoload.inc';
//require_once dirname(__FILE__).'/saimod_mojotrollz_beta/autoload.inc';
require_once dirname(__FILE__).'/saimod_mojotrollz_downloads/autoload.inc';
require_once dirname(__FILE__).'/saimod_mojotrollz_npc_vendor_template/autoload.inc';

View File

@ -0,0 +1,4 @@
<?php
require_once dirname(__FILE__).'/sql/autoload.inc';
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'SAI');
\SYSTEM\SAI\sai::register('\SAI\saimod_mojotrollz_server_classic');

View File

@ -0,0 +1,615 @@
function init_saimod_mojotrollz_server_classic(){
{
load_visualisation_mojotrollz_server_classic('vis_classic', 'stats_classic', '#filter_vis_classic', 'Players on WoW-Classic', 900,350);
$('#filter_vis_classic').on('change',function(){
load_visualisation_mojotrollz_server_classic('vis_classic', 'stats_classic', '#filter_vis_classic', 'Players on WoW-Classic', 900,350);
})
}
$('#btn_clear').click(function(){
$('#output_log').html('');
$('#table_changes').html('');
});
register_classic();
}
function register_classic(){
{
$('#btn_classic_realm_start').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'run_classic_realm_start'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_classic_realm_stop').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'run_classic_realm_stop'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_classic_realm_status').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'run_classic_realm_status'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
}
{
$('#btn_classic_world_start').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'run_classic_world_start'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_classic_world_stop').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'run_classic_world_stop'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_classic_world_status').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'run_classic_world_status'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
}
{
$('#btn_classic_world_test_start').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'run_classic_world_test_start'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_classic_world_test_stop').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'run_classic_world_test_stop'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_classic_world_test_status').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'run_classic_world_test_status'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
}
{
$('#btn_compile_classic_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'compile_classic_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_compile_classic_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'compile_classic_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
}
{
$('#btn_db_classic_realm_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'db_classic_realm_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_db_classic_chars_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'db_classic_chars_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_db_classic_chars_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'db_classic_chars_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_db_classic_world_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'db_classic_world_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_db_classic_world_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'db_classic_world_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
}
{
$('#btn_log_classic_chars_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'log_classic_chars_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_log_classic_chars_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'log_classic_chars_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_log_classic_db_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'log_classic_db_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_log_classic_db_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'log_classic_db_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_log_classic_eventai_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'log_classic_eventai_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_log_classic_eventai_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'log_classic_eventai_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_log_classic_realm_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'log_classic_realm_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_log_classic_realm_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'log_classic_realm_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_log_classic_sd2_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'log_classic_sd2_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_log_classic_sd2_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'log_classic_sd2_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_log_classic_server_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'log_classic_server_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_log_classic_server_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'log_classic_server_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
}
{
$('#btn_logdel_classic_chars_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'logdel_classic_chars_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_logdel_classic_chars_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'logdel_classic_chars_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_logdel_classic_db_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'logdel_classic_db_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_logdel_classic_db_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'logdel_classic_db_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_logdel_classic_eventai_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'logdel_classic_eventai_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_logdel_classic_eventai_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'logdel_classic_eventai_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_logdel_classic_realm_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'logdel_classic_realm_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_logdel_classic_realm_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'logdel_classic_realm_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_logdel_classic_sd2_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'logdel_classic_sd2_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_logdel_classic_sd2_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'logdel_classic_sd2_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_logdel_classic_server_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'logdel_classic_server_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_logdel_classic_server_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_classic',
action: 'logdel_classic_server_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
}
}
function growl_start(message){
$.bootstrapGrowl(message, {
ele: 'body', // which element to append to
type: 'info', // (null, 'info', 'danger', 'success')
offset: {from: 'top', amount: 50}, // 'top', or 'bottom'
align: 'right', // ('left', 'right', or 'center')
width: 250, // (integer, or 'auto')
//delay: 7000, // Time while the message will be displayed. It's not equivalent to the *demo* timeOut!
allow_dismiss: true, // If true then will display a cross to close the popup.
stackup_spacing: 10 // spacing between consecutively stacked growls.
});
}
function growl_end_success(message){
$.bootstrapGrowl(message, {
ele: 'body', // which element to append to
type: 'success', // (null, 'info', 'danger', 'success')
offset: {from: 'top', amount: 50}, // 'top', or 'bottom'
align: 'right', // ('left', 'right', or 'center')
width: 250, // (integer, or 'auto')
delay: 4500, // Time while the message will be displayed. It's not equivalent to the *demo* timeOut!
allow_dismiss: true, // If true then will display a cross to close the popup.
stackup_spacing: 10 // spacing between consecutively stacked growls.
});
}
function growl_end_error(message){
$.bootstrapGrowl(message, {
ele: 'body', // which element to append to
type: 'danger', // (null, 'info', 'danger', 'success')
offset: {from: 'top', amount: 50}, // 'top', or 'bottom'
align: 'right', // ('left', 'right', or 'center')
width: 250, // (integer, or 'auto')
delay: 4500, // Time while the message will be displayed. It's not equivalent to the *demo* timeOut!
allow_dismiss: true, // If true then will display a cross to close the popup.
stackup_spacing: 10 // spacing between consecutively stacked growls.
});
}
function load_visualisation_mojotrollz_server_classic(div, stats, filter, name, width, height){
$.getJSON('./sai.php?sai_mod=.SAI.saimod_mojotrollz_server_classic&action='+stats+'&filter='+$(filter).val(),function(json){
if(!json || json.status != true || !json.result){
return;}
json = json.result;
var data = new google.visualization.DataTable();
first = true;
$.each(json[0], function(key, value){
if(first){
data.addColumn('datetime',key);
first = false;
} else {
data.addColumn('number',key);
}
});
$.each(json, function(key, value){first = true; data.addRow($.map(value, function(v) { if(first){first=false;return [new Date(v)];}else{return [(v == null || parseFloat(v) <= 0) ? parseFloat(0) : parseFloat(v)];}}));});
var options = {title: name, aggregationTarget: 'category', selectionMode: 'multiple', curveType: 'function', /*focusTarget: 'category',*/ chartArea:{left:40,top:40}, vAxis:{logScale: false}, interpolateNulls: false, width: width, height: height};
new google.visualization.LineChart(document.getElementById(div)).draw(data, options);
});
}

View File

@ -0,0 +1,171 @@
<?php
namespace SAI;
class saimod_mojotrollz_server_classic extends \SYSTEM\SAI\SaiModule {
public static function sai_mod__SAI_saimod_mojotrollz_server_classic(){
$vars = array();
$vars['classic_realm_status'] = self::sai_mod__SAI_saimod_mojotrollz_server_classic_action_run_classic_realm_status();
$vars['classic_world_status'] = self::sai_mod__SAI_saimod_mojotrollz_server_classic_action_run_classic_world_status();
$vars['classic_world_test_status'] = self::sai_mod__SAI_saimod_mojotrollz_server_classic_action_run_classic_world_test_status();
$vars['classic_players_online'] = self::online_classic();
$vars['classic_test_players_online'] = self::online_classic_test();
return \SYSTEM\PAGE\replace::replaceFile(dirname(__FILE__).'/tpl/main.tpl', $vars);}
public static function html_li_menu(){return '<li class=""><a data-toggle="tooltip" data-placement="left" title="Mojotrollz Classic Server" href="#!mojotrollz_server_classic"><span class="glyphicon glyphicon-grain" aria-hidden="true"></span>&nbsp;&nbsp;Classic Server</a></li>';}
public static function right_public(){return false;}
public static function right_right(){return \SYSTEM\SECURITY\security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
public static function js(){return array(new \PSAI('saimod_mojotrollz_server_classic/js/saimod_mojotrollz_server_classic.js'));}
//public static function css(){}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_stats_classic($filter = 600){
return \SYSTEM\LOG\JsonResult::toString(\SQL\STATS_CLASSIC::QA(array($filter)));}
public static function online_classic(){
return \SQL\ONLINE_PLAYERS::Q1(new \SQL\mangos_zero_chars())['count'];}
public static function online_classic_test(){
return 0;}//\SQL\ONLINE_PLAYERS::Q1(new \SQL\mangos_zero_chars_test())['count'];}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_log_classic_chars_live(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log/Char.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/classic/server/log/Char.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_log_classic_chars_test(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log_test/Char.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/classic/server/log_test/Char.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_log_classic_db_live(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log/DBErrors.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/classic/server/log/DBErrors.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_log_classic_db_test(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log_test/DBErrors.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/classic/server/log_test/DBErrors.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_log_classic_eventai_live(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log/EventAIErrors.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/classic/server/log/EventAIErrors.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_log_classic_eventai_test(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log_test/EventAIErrors.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/classic/server/log_test/EventAIErrors.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_log_classic_realm_live(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log/Realmd.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/classic/server/log/Realmd.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_log_classic_realm_test(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log_test/Realmd.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/classic/server/log_test/Realmd.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_log_classic_sd2_live(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log/SD2Errors.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/classic/server/log/SD2Errors.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_log_classic_sd2_test(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log_test/SD2Errors.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/classic/server/log_test/SD2Errors.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_log_classic_server_live(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log/Server.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/classic/server/log/Server.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_log_classic_server_test(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log_test/Server.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/classic/server/log_test/Server.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_logdel_classic_chars_live(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log/Char.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/classic/server/log/Char.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_logdel_classic_chars_test(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log_test/Char.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/classic/server/log_test/Char.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_logdel_classic_db_live(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log/DBErrors.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/classic/server/log/DBErrors.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_logdel_classic_db_test(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log_test/DBErrors.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/classic/server/log_test/DBErrors.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_logdel_classic_eventai_live(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log/EventAIErrors.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/classic/server/log/EventAIErrors.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_logdel_classic_eventai_test(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log_test/EventAIErrors.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/classic/server/log_test/EventAIErrors.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_logdel_classic_realm_live(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log/Realmd.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/classic/server/log/Realmd.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_logdel_classic_realm_test(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log_test/Realmd.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/classic/server/log_test/Realmd.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_logdel_classic_sd2_live(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log/SD2Errors.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/classic/server/log/SD2Errors.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_logdel_classic_sd2_test(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log_test/SD2Errors.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/classic/server/log_test/SD2Errors.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_logdel_classic_server_live(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log/Server.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/classic/server/log/Server.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_logdel_classic_server_test(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log_test/Server.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/classic/server/log_test/Server.log',''));}
private static function shell_run($ver,$prog,$cmd){
return \str_replace("\n","\r\n",shell_exec('/home/mojotrollz/mojo/run '.$ver.' '.$prog.' '.$cmd.' 2>&1'));}
private static function shell_db($ver,$db,$cmd){
return \str_replace("\n","\r\n",shell_exec('/home/mojotrollz/mojo/db '.$ver.' '.$db.' '.$cmd.' 2>&1'));}
private static function shell_compile($ver,$cmd){
return \str_replace("\n","\r\n",shell_exec('/home/mojotrollz/mojo/compile '.$ver.' '.$cmd.' 2>&1'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_compile_classic_live(){
$log = \htmlentities(self::shell_compile('classic', 'live'));
$log .= chmod('/home/mojotrollz/mojo/'.'classic/server/bin/bin/run-mangosd',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
return $log;
}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_compile_classic_test(){
$log = \htmlentities(self::shell_compile('classic', 'test'));
$log .= chmod('/home/mojotrollz/mojo/'.'classic/server/bin_test/bin/run-mangosd',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
return $log;
}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_db_classic_realm_live(){
return \htmlentities(self::shell_db('classic', 'realm', 'live'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_db_classic_chars_live(){
return \htmlentities(self::shell_db('classic', 'chars', 'live'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_db_classic_chars_test(){
return \htmlentities(self::shell_db('classic', 'chars', 'test'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_db_classic_world_live(){
return \htmlentities(self::shell_db('classic', 'world', 'live'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_db_classic_world_test(){
return \htmlentities(self::shell_db('classic', 'world', 'test'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_run_classic_realm_start(){
return self::shell_run('classic', 'realm','start');}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_run_classic_world_start(){
return self::shell_run('classic', 'world','start');}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_run_classic_world_test_start(){
return self::shell_run('classic', 'world_test','start');}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_run_classic_realm_stop(){
return self::shell_run('classic', 'realm','stop');}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_run_classic_world_stop(){
return self::shell_run('classic', 'world','stop');}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_run_classic_world_test_stop(){
return self::shell_run('classic', 'world_test','stop');}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_run_classic_realm_status(){
return self::shell_run('classic', 'realm','status');}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_run_classic_world_status(){
return self::shell_run('classic', 'world','status');}
public static function sai_mod__SAI_saimod_mojotrollz_server_classic_action_run_classic_world_test_status(){
return self::shell_run('classic', 'world_test','status');}
}

View File

@ -0,0 +1,9 @@
<?php
namespace SQL;
class DATA_SAIMOD_MOJOTROLLZ_SERVER_CLASSIC extends \SYSTEM\DB\QI {
public static function get_class(){return \get_class();}
public static function files_mysql(){
return array( (new \PSAI('/saimod_mojotrollz_server_classic/sql/mysql/system_page.sql'))->SERVERPATH(),
(new \PSAI('/saimod_mojotrollz_server_classic/sql/mysql/system_api.sql'))->SERVERPATH());
}
}

View File

@ -0,0 +1,4 @@
<?php
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'SQL');
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/qq/','SQL');
\SYSTEM\SQL\setup::register('SQL\\DATA_SAIMOD_MOJOTROLLZ_SERVER_CLASSIC');

View File

@ -0,0 +1,3 @@
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5700, 42, 0, 0, '_SAI_saimod_mojotrollz_server_classic', 'action', NULL);
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5720, 42, 3, 5700, NULL, 'filter', 'INT');

View File

@ -0,0 +1 @@
REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (570, 42, 'mojotrollz_server_classic', 'mojotrollz_server_classic', -1, 0, 0, '#content', './sai.php?sai_mod=.SAI.saimod_mojotrollz_server_classic', 'init_saimod_mojotrollz_server_classic', '\\SAI\\saimod_mojotrollz_server_classic');

View File

@ -0,0 +1,8 @@
<?php
namespace SQL;
class ONLINE_PLAYERS extends \SYSTEM\DB\QQ {
public static function get_class(){return \get_class();}
public static function mysql(){return
'SELECT count(*) as count FROM characters WHERE online = 1 OR at_login = 1;';
}
}

View File

@ -0,0 +1,14 @@
<?php
namespace SQL;
class STATS_CLASSIC extends \SYSTEM\DB\QP {
public static function get_class(){return \get_class();}
public static function mysql(){return
'SELECT DATE_FORMAT(FROM_UNIXTIME(UNIX_TIMESTAMP('.\SYSTEM\SQL\system_log::FIELD_TIME.') - MOD(UNIX_TIMESTAMP('.\SYSTEM\SQL\system_log::FIELD_TIME.'),?)),"%Y/%m/%d %H:%i:%s") as day,'
.'avg('.\SYSTEM\SQL\system_log::FIELD_CODE.') online'
.' FROM '.\SYSTEM\SQL\system_log::NAME_MYS
.' WHERE '.\SYSTEM\SQL\system_log::NAME_MYS.'.'.\SYSTEM\SQL\system_log::FIELD_CLASS.' LIKE "%PLAYER_COUNT_CLASSIC"'
.' GROUP BY day'
.' ORDER BY day DESC'
.' LIMIT 30;';
}
}

View File

@ -0,0 +1,181 @@
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><h4>Classic - Status</h4></div>
<div class="panel-body">
<table class="table">
<tr>
<th>realm</th>
<td>${classic_realm_status}</td>
</tr>
<tr>
<th>world</th>
<td>${classic_world_status}</td>
</tr>
<tr>
<th>world_test</th>
<td>${classic_world_test_status}</td>
</tr>
<tr>
<th>players live</th>
<td>${classic_players_online}</td>
</tr>
<tr>
<th>players test</th>
<td>${classic_test_players_online}</td>
</tr>
</table>
<div id="vis_classic"></div>
<select id="filter_vis_classic">
<option value="2692000">30d</option>
<option value="1209600">14d</option>
<option value="604800">7d</option>
<option value="172800">2d</option>
<option value="86400">1d</option>
<option value="43200">12h</option>
<option value="21600">6h</option>
<option value="14400">4h</option>
<option value="7200">2h</option>
<option value="3600">1h</option>
<option value="1800">30m</option>
<option value="600" selected>10m</option>
<option value="300">5m</option>
<option value="60">1m</option>
<option value="30">30s</option>
<option value="10">10s</option>
<option value="5">5s</option>
<option value="1">1s</option>
</select>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><h4>Classic - Run</h4></div>
<div class="panel-body">
<table class="table">
<tr>
<th>realm</th>
<td style="text-align: right;"><button id="btn_classic_realm_start" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-play" aria-hidden="true"></span> start</button></td>
<td style="text-align: right;"><button id="btn_classic_realm_stop" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-stop" aria-hidden="true"></span> stop</button></td>
<td style="text-align: right;"><button id="btn_classic_realm_status" class="btn-primary btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-search" aria-hidden="true"></span> status</button></td>
</tr>
<tr>
<th>world</th>
<td style="text-align: right;"><button id="btn_classic_world_start" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-play" aria-hidden="true"></span> start</button></td>
<td style="text-align: right;"><button id="btn_classic_world_stop" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-stop" aria-hidden="true"></span> stop</button></td>
<td style="text-align: right;"><button id="btn_classic_world_status" class="btn-primary btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-search" aria-hidden="true"></span> status</button></td>
</tr>
<tr>
<th>world_test</th>
<td style="text-align: right;"><button id="btn_classic_world_test_start" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-play" aria-hidden="true"></span> start</button></td>
<td style="text-align: right;"><button id="btn_classic_world_test_stop" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-stop" aria-hidden="true"></span> stop</button></td>
<td style="text-align: right;"><button id="btn_classic_world_test_status" class="btn-primary btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-search" aria-hidden="true"></span> status</button></td>
</tr>
</table>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><h4>Classic - Database <font color="red" size="2">Stop the Server first!</font></h4></div>
<div class="panel-body">
<table class="table">
<tr>
<th>realm</th>
<td style="text-align: right;"><button id="btn_db_classic_realm_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> deploy live</button></td>
<td></td>
</tr>
<tr>
<th>chars</th>
<td style="text-align: right;"><button id="btn_db_classic_chars_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> deploy live</button></td>
<td style="text-align: right;"><button id="btn_db_classic_chars_test" class="btn-warning btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> deploy test</button></td>
</tr>
<tr>
<th>world</th>
<td style="text-align: right;"><button id="btn_db_classic_world_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> deploy live</button></td>
<td style="text-align: right;"><button id="btn_db_classic_world_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> deploy test</button></td>
</tr>
</table>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><h4>Classic - Compile <font color="red" size="2">Stop the Server first!</font></h4></div>
<div class="panel-body">
<table class="table">
<tr>
<th>live</th>
<td style="text-align: right;"><button id="btn_compile_classic_live" class="btn-warning btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-wrench" aria-hidden="true"></span> compile</button></td>
</tr>
<tr>
<th>test</th>
<td style="text-align: right;"><button id="btn_compile_classic_test" class="btn-warning btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-wrench" aria-hidden="true"></span> compile</button></td>
</tr>
</table>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><h4>Classic - Log</h4></div>
<div class="panel-body">
<table class="table">
<tr>
<th>Char.log</th>
<td style="text-align: right;"><button id="btn_log_classic_chars_live" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> live</button></td>
<td style="text-align: right;"><button id="btn_logdel_classic_chars_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
<td style="text-align: right;"><button id="btn_log_classic_chars_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> test</button></td>
<td style="text-align: right;"><button id="btn_logdel_classic_chars_test" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
</tr>
<tr>
<th>DBErrors.log</th>
<td style="text-align: right;"><button id="btn_log_classic_db_live" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> live</button></td>
<td style="text-align: right;"><button id="btn_logdel_classic_db_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
<td style="text-align: right;"><button id="btn_log_classic_db_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> test</button></td>
<td style="text-align: right;"><button id="btn_logdel_classic_db_test" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
</tr>
<tr>
<th>EventAIErrors.log</th>
<td style="text-align: right;"><button id="btn_log_classic_eventai_live" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> live</button></td>
<td style="text-align: right;"><button id="btn_logdel_classic_eventai_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
<td style="text-align: right;"><button id="btn_log_classic_eventai_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> test</button></td>
<td style="text-align: right;"><button id="btn_logdel_classic_eventai_test" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
</tr>
<tr>
<th>Realmd.log</th>
<td style="text-align: right;"><button id="btn_log_classic_realm_live" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> live</button></td>
<td style="text-align: right;"><button id="btn_logdel_classic_realm_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
<td style="text-align: right;"><button id="btn_log_classic_realm_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> test</button></td>
<td style="text-align: right;"><button id="btn_logdel_classic_realm_test" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
</tr>
<tr>
<th>SD2Errors.log</th>
<td style="text-align: right;"><button id="btn_log_classic_sd2_live" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> live</button></td>
<td style="text-align: right;"><button id="btn_logdel_classic_sd2_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
<td style="text-align: right;"><button id="btn_log_classic_sd2_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> test</button></td>
<td style="text-align: right;"><button id="btn_logdel_classic_sd2_test" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
</tr>
<tr>
<th>Server.log</th>
<td style="text-align: right;"><button id="btn_log_classic_server_live" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> live</button></td>
<td style="text-align: right;"><button id="btn_logdel_classic_server_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
<td style="text-align: right;"><button id="btn_log_classic_server_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> test</button></td>
<td style="text-align: right;"><button id="btn_logdel_classic_server_test" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><h4>Output</h4></div>
<div class="panel-body">
<table>
<thead>
<tr>
<th>Path</th>
<th>Submodule</th>
<th>Action</th>
</tr>
</thead>
<tbody id="table_changes">
</tbody>
</table>
<textarea id="output_log" style="width: 100%; height: 350px;"></textarea>
<button id="btn_clear" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Clear</button>
</div>
</div>

View File

@ -56,11 +56,11 @@ function init_saimod_mojotrollz_server(){
$('#table_changes').html('');
});
register_classic();
register_tbc();
register_classic_svr();
register_tbc_svr();
}
function register_classic(){
function register_classic_svr(){
{
$('#btn_classic_realm_start').click(function(){
growl_start('Doing ... please wait')
@ -598,7 +598,7 @@ function register_classic(){
}
}
function register_tbc(){
function register_tbc_svr(){
{
$('#btn_tbc_realm_start').click(function(){
growl_start('Doing ... please wait')

View File

@ -51,12 +51,16 @@ class saimod_mojotrollz_server_handling extends \SYSTEM\SAI\SaiModule {
$log .= chmod('/home/mojotrollz/mojo/'.'classic/world',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
$log .= chmod('/home/mojotrollz/mojo/'.'classic/realm',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
$log .= chmod('/home/mojotrollz/mojo/'.'classic/db',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
$log .= chmod('/home/mojotrollz/mojo/'.'classic/server/bin/bin/run-mangosd',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
$log .= chmod('/home/mojotrollz/mojo/'.'classic/server/bin_test/bin/run-mangosd',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
$log .= chmod('/home/mojotrollz/mojo/'.'tbc/compile',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
$log .= chmod('/home/mojotrollz/mojo/'.'tbc/run',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
$log .= chmod('/home/mojotrollz/mojo/'.'tbc/world',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
$log .= chmod('/home/mojotrollz/mojo/'.'tbc/world_test',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
$log .= chmod('/home/mojotrollz/mojo/'.'tbc/realm',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
$log .= chmod('/home/mojotrollz/mojo/'.'tbc/db',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
$log .= chmod('/home/mojotrollz/mojo/'.'tbc/server/bin/bin/run-mangosd',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
$log .= chmod('/home/mojotrollz/mojo/'.'tbc/server/bin_test/bin/run-mangosd',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
} catch (\Exception $e){
$log .= 'Error: '.$e->getMessage();
}
@ -135,203 +139,7 @@ class saimod_mojotrollz_server_handling extends \SYSTEM\SAI\SaiModule {
}
return \SYSTEM\LOG\JsonResult::toString($result);
}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_log_classic_chars_live(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log/Char.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/classic/server/log/Char.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_log_classic_chars_test(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log_test/Char.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/classic/server/log_test/Char.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_log_classic_db_live(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log/DBErrors.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/classic/server/log/DBErrors.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_log_classic_db_test(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log_test/DBErrors.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/classic/server/log_test/DBErrors.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_log_classic_eventai_live(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log/EventAIErrors.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/classic/server/log/EventAIErrors.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_log_classic_eventai_test(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log_test/EventAIErrors.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/classic/server/log_test/EventAIErrors.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_log_classic_realm_live(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log/Realmd.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/classic/server/log/Realmd.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_log_classic_realm_test(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log_test/Realmd.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/classic/server/log_test/Realmd.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_log_classic_sd2_live(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log/SD2Errors.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/classic/server/log/SD2Errors.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_log_classic_sd2_test(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log_test/SD2Errors.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/classic/server/log_test/SD2Errors.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_log_classic_server_live(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log/Server.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/classic/server/log/Server.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_log_classic_server_test(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log_test/Server.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/classic/server/log_test/Server.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_log_tbc_chars_live(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log/Char.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/tbc/server/log/Char.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_log_tbc_chars_test(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log_test/Char.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/tbc/server/log_test/Char.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_log_tbc_db_live(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log/DBErrors.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/tbc/server/log/DBErrors.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_log_tbc_db_test(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log/DBErrors.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/tbc/server/log_test/DBErrors.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_log_tbc_eventai_live(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log/EventAIErrors.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/tbc/server/log/EventAIErrors.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_log_tbc_eventai_test(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log_test/EventAIErrors.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/tbc/server/log_test/EventAIErrors.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_log_tbc_realm_live(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log/Realmd.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/tbc/server/log/Realmd.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_log_tbc_realm_test(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log_test/Realmd.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/tbc/server/log_test/Realmd.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_log_tbc_sd2_live(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log/SD2Errors.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/tbc/server/log/SD2Errors.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_log_tbc_sd2_test(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log_test/SD2Errors.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/tbc/server/log_test/SD2Errors.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_log_tbc_server_live(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log/Server.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/tbc/server/log/Server.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_log_tbc_server_test(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log_test/Server.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/tbc/server/log_test/Server.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_logdel_classic_chars_live(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log/Char.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/classic/server/log/Char.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_logdel_classic_chars_test(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log_test/Char.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/classic/server/log_test/Char.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_logdel_classic_db_live(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log/DBErrors.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/classic/server/log/DBErrors.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_logdel_classic_db_test(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log_test/DBErrors.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/classic/server/log_test/DBErrors.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_logdel_classic_eventai_live(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log/EventAIErrors.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/classic/server/log/EventAIErrors.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_logdel_classic_eventai_test(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log_test/EventAIErrors.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/classic/server/log_test/EventAIErrors.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_logdel_classic_realm_live(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log/Realmd.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/classic/server/log/Realmd.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_logdel_classic_realm_test(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log_test/Realmd.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/classic/server/log_test/Realmd.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_logdel_classic_sd2_live(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log/SD2Errors.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/classic/server/log/SD2Errors.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_logdel_classic_sd2_test(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log_test/SD2Errors.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/classic/server/log_test/SD2Errors.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_logdel_classic_server_live(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log/Server.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/classic/server/log/Server.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_logdel_classic_server_test(){
if(!\file_exists('/home/mojotrollz/mojo/classic/server/log_test/Server.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/classic/server/log_test/Server.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_logdel_tbc_chars_live(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log/Char.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/tbc/server/log/Char.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_logdel_tbc_chars_test(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log_test/Char.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/tbc/server/log_test/Char.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_logdel_tbc_db_live(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log/DBErrors.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/tbc/server/log/DBErrors.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_logdel_tbc_db_test(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log_test/DBErrors.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/tbc/server/log_test/DBErrors.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_logdel_tbc_eventai_live(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log/EventAIErrors.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/tbc/server/log/EventAIErrors.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_logdel_tbc_eventai_test(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log_test/EventAIErrors.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/tbc/server/log_test/EventAIErrors.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_logdel_tbc_realm_live(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log/Realmd.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/tbc/server/log/Realmd.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_logdel_tbc_realm_test(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log_test/Realmd.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/tbc/server/log_test/Realmd.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_logdel_tbc_sd2_live(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log/SD2Errors.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/tbc/server/log/SD2Errors.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_logdel_tbc_sd2_test(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log_test/SD2Errors.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/tbc/server/log_test/SD2Errors.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_logdel_tbc_server_live(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log/Server.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/tbc/server/log/Server.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_logdel_tbc_server_test(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log_test/Server.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/tbc/server/log_test/Server.log',''));}
private static function shell_run($ver,$prog,$cmd){
return \str_replace("\n","\r\n",shell_exec('/home/mojotrollz/mojo/run '.$ver.' '.$prog.' '.$cmd.' 2>&1'));}
private static function shell_db($ver,$db,$cmd){
@ -340,21 +148,16 @@ class saimod_mojotrollz_server_handling extends \SYSTEM\SAI\SaiModule {
return \str_replace("\n","\r\n",shell_exec('/home/mojotrollz/mojo/compile '.$ver.' '.$cmd.' 2>&1'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_compile_classic_live(){
return \htmlentities(self::shell_compile('classic', 'live'));}
$log = \htmlentities(self::shell_compile('classic', 'live'));
$log .= chmod('/home/mojotrollz/mojo/'.'classic/server/bin/bin/run-mangosd',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
return $log;
}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_compile_classic_test(){
return \htmlentities(self::shell_compile('classic', 'test'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_db_classic_realm_live(){
return \htmlentities(self::shell_db('classic', 'realm', 'live'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_db_classic_chars_live(){
return \htmlentities(self::shell_db('classic', 'chars', 'live'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_db_classic_chars_test(){
return \htmlentities(self::shell_db('classic', 'chars', 'test'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_db_classic_world_live(){
return \htmlentities(self::shell_db('classic', 'world', 'live'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_db_classic_world_test(){
return \htmlentities(self::shell_db('classic', 'world', 'test'));}
$log = \htmlentities(self::shell_compile('classic', 'test'));
$log .= chmod('/home/mojotrollz/mojo/'.'classic/server/bin_test/bin/run-mangosd',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
return $log;
}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_run_classic_realm_start(){
return self::shell_run('classic', 'realm','start');}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_run_classic_world_start(){
@ -375,20 +178,15 @@ class saimod_mojotrollz_server_handling extends \SYSTEM\SAI\SaiModule {
return self::shell_run('classic', 'world_test','status');}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_compile_tbc_live(){
return \htmlentities(self::shell_compile('tbc', 'live'));}
$log = \htmlentities(self::shell_compile('tbc', 'live'));
$log .= chmod('/home/mojotrollz/mojo/'.'tbc/server/bin/bin/run-mangosd',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
return $log;
}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_compile_tbc_test(){
return \htmlentities(self::shell_compile('tbc', 'test'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_db_tbc_realm_live(){
return \htmlentities(self::shell_db('tbc', 'realm', 'live'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_db_tbc_chars_live(){
return \htmlentities(self::shell_db('tbc', 'chars', 'live'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_db_tbc_chars_test(){
return \htmlentities(self::shell_db('tbc', 'chars', 'test'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_db_tbc_world_live(){
return \htmlentities(self::shell_db('tbc', 'world', 'live'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_db_tbc_world_test(){
return \htmlentities(self::shell_db('tbc', 'world', 'test'));}
$log = \htmlentities(self::shell_compile('tbc', 'test'));
$log .= chmod('/home/mojotrollz/mojo/'.'tbc/server/bin_test/bin/run-mangosd',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
return $log;
}
public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_run_tbc_realm_start(){
return self::shell_run('tbc', 'realm','start');}

View File

@ -1,8 +1,46 @@
<div class="panel panel-default">
<div class="panel-heading"><h4>Mojotrollz Server</h4></div>
<div class="panel-body">
<button id="btn_update" class="btn-primary btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> Update</button>
<button id="btn_changes" class="btn-warning btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-search" aria-hidden="true"></span> Find Changes</button>
<div class="row">
<div class="col-md-12">
<button id="btn_update" class="btn-primary btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> Update</button>
<button id="btn_changes" class="btn-warning btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-search" aria-hidden="true"></span> Find Changes</button>
</div>
<div class="col-md-6">
<div id="vis_classic"></div>
<select id="filter_vis_classic">
<option value="2692000">30d</option>
<option value="1209600">14d</option>
<option value="604800">7d</option>
<option value="172800">2d</option>
<option value="86400">1d</option>
<option value="43200">12h</option>
<option value="21600">6h</option>
<option value="14400">4h</option>
<option value="7200">2h</option>
<option value="3600">1h</option>
<option value="1800">30m</option>
<option value="600" selected>10m</option>
</select>
</div>
<div class="col-md-6">
<div id="vis_tbc"></div>
<select id="filter_vis_tbc">
<option value="2692000">30d</option>
<option value="1209600">14d</option>
<option value="604800">7d</option>
<option value="172800">2d</option>
<option value="86400">1d</option>
<option value="43200">12h</option>
<option value="21600">6h</option>
<option value="14400">4h</option>
<option value="7200">2h</option>
<option value="3600">1h</option>
<option value="1800">30m</option>
<option value="600" selected>10m</option>
</select>
</div>
</div>
</div>
</div>
<div class="row">
@ -32,27 +70,6 @@
<td>${classic_test_players_online}</td>
</tr>
</table>
<div id="vis_classic"></div>
<select id="filter_vis_classic">
<option value="2692000">30d</option>
<option value="1209600">14d</option>
<option value="604800">7d</option>
<option value="172800">2d</option>
<option value="86400">1d</option>
<option value="43200">12h</option>
<option value="21600">6h</option>
<option value="14400">4h</option>
<option value="7200">2h</option>
<option value="3600">1h</option>
<option value="1800">30m</option>
<option value="600" selected>10m</option>
<option value="300">5m</option>
<option value="60">1m</option>
<option value="30">30s</option>
<option value="10">10s</option>
<option value="5">5s</option>
<option value="1">1s</option>
</select>
</div>
</div>
<div class="panel panel-default">
@ -80,28 +97,6 @@
</table>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><h4>Classic - Database <font color="red" size="2">Stop the Server first!</font></h4></div>
<div class="panel-body">
<table class="table">
<tr>
<th>realm</th>
<td style="text-align: right;"><button id="btn_db_classic_realm_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> deploy live</button></td>
<td></td>
</tr>
<tr>
<th>chars</th>
<td style="text-align: right;"><button id="btn_db_classic_chars_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> deploy live</button></td>
<td style="text-align: right;"><button id="btn_db_classic_chars_test" class="btn-warning btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> deploy test</button></td>
</tr>
<tr>
<th>world</th>
<td style="text-align: right;"><button id="btn_db_classic_world_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> deploy live</button></td>
<td style="text-align: right;"><button id="btn_db_classic_world_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> deploy test</button></td>
</tr>
</table>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><h4>Classic - Compile <font color="red" size="2">Stop the Server first!</font></h4></div>
<div class="panel-body">
@ -117,55 +112,6 @@
</table>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><h4>Classic - Log</h4></div>
<div class="panel-body">
<table class="table">
<tr>
<th>Char.log</th>
<td style="text-align: right;"><button id="btn_log_classic_chars_live" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> live</button></td>
<td style="text-align: right;"><button id="btn_logdel_classic_chars_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
<td style="text-align: right;"><button id="btn_log_classic_chars_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> test</button></td>
<td style="text-align: right;"><button id="btn_logdel_classic_chars_test" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
</tr>
<tr>
<th>DBErrors.log</th>
<td style="text-align: right;"><button id="btn_log_classic_db_live" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> live</button></td>
<td style="text-align: right;"><button id="btn_logdel_classic_db_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
<td style="text-align: right;"><button id="btn_log_classic_db_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> test</button></td>
<td style="text-align: right;"><button id="btn_logdel_classic_db_test" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
</tr>
<tr>
<th>EventAIErrors.log</th>
<td style="text-align: right;"><button id="btn_log_classic_eventai_live" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> live</button></td>
<td style="text-align: right;"><button id="btn_logdel_classic_eventai_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
<td style="text-align: right;"><button id="btn_log_classic_eventai_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> test</button></td>
<td style="text-align: right;"><button id="btn_logdel_classic_eventai_test" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
</tr>
<tr>
<th>Realmd.log</th>
<td style="text-align: right;"><button id="btn_log_classic_realm_live" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> live</button></td>
<td style="text-align: right;"><button id="btn_logdel_classic_realm_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
<td style="text-align: right;"><button id="btn_log_classic_realm_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> test</button></td>
<td style="text-align: right;"><button id="btn_logdel_classic_realm_test" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
</tr>
<tr>
<th>SD2Errors.log</th>
<td style="text-align: right;"><button id="btn_log_classic_sd2_live" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> live</button></td>
<td style="text-align: right;"><button id="btn_logdel_classic_sd2_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
<td style="text-align: right;"><button id="btn_log_classic_sd2_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> test</button></td>
<td style="text-align: right;"><button id="btn_logdel_classic_sd2_test" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
</tr>
<tr>
<th>Server.log</th>
<td style="text-align: right;"><button id="btn_log_classic_server_live" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> live</button></td>
<td style="text-align: right;"><button id="btn_logdel_classic_server_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
<td style="text-align: right;"><button id="btn_log_classic_server_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> test</button></td>
<td style="text-align: right;"><button id="btn_logdel_classic_server_test" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
</tr>
</table>
</div>
</div>
</div>
<div class="col-md-6">
@ -194,27 +140,6 @@
<td>${tbc_test_players_online}</td>
</tr>
</table>
<div id="vis_tbc"></div>
<select id="filter_vis_tbc">
<option value="2692000">30d</option>
<option value="1209600">14d</option>
<option value="604800">7d</option>
<option value="172800">2d</option>
<option value="86400">1d</option>
<option value="43200">12h</option>
<option value="21600">6h</option>
<option value="14400">4h</option>
<option value="7200">2h</option>
<option value="3600">1h</option>
<option value="1800">30m</option>
<option value="600" selected>10m</option>
<option value="300">5m</option>
<option value="60">1m</option>
<option value="30">30s</option>
<option value="10">10s</option>
<option value="5">5s</option>
<option value="1">1s</option>
</select>
</div>
</div>
<div class="panel panel-default">
@ -242,28 +167,6 @@
</table>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><h4>TBC - Database <font color="red" size="2">Stop the Server first!</font></h4></div>
<div class="panel-body">
<table class="table">
<tr>
<th>realm</th>
<td style="text-align: right;"><button id="btn_db_tbc_realm_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> deploy live</button></td>
<td></td>
</tr>
<tr>
<th>chars</th>
<td style="text-align: right;"><button id="btn_db_tbc_chars_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> deploy live</button></td>
<td style="text-align: right;"><button id="btn_db_tbc_chars_test" class="btn-warning btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> deploy test</button></td>
</tr>
<tr>
<th>world</th>
<td style="text-align: right;"><button id="btn_db_tbc_world_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> deploy live</button></td>
<td style="text-align: right;"><button id="btn_db_tbc_world_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> deploy test</button></td>
</tr>
</table>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><h4>TBC - Compile <font color="red" size="2">Stop the Server first!</font></h4></div>
<div class="panel-body">
@ -279,55 +182,6 @@
</table>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><h4>TBC - Log</h4></div>
<div class="panel-body">
<table class="table">
<tr>
<th>Char.log</th>
<td style="text-align: right;"><button id="btn_log_tbc_chars_live" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> live</button></td>
<td style="text-align: right;"><button id="btn_logdel_tbc_chars_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
<td style="text-align: right;"><button id="btn_log_tbc_chars_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> test</button></td>
<td style="text-align: right;"><button id="btn_logdel_tbc_chars_test" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
</tr>
<tr>
<th>DBErrors.log</th>
<td style="text-align: right;"><button id="btn_log_tbc_db_live" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> live</button></td>
<td style="text-align: right;"><button id="btn_logdel_tbc_db_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
<td style="text-align: right;"><button id="btn_log_tbc_db_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> test</button></td>
<td style="text-align: right;"><button id="btn_logdel_tbc_db_test" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
</tr>
<tr>
<th>EventAIErrors.log</th>
<td style="text-align: right;"><button id="btn_log_tbc_eventai_live" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> live</button></td>
<td style="text-align: right;"><button id="btn_logdel_tbc_eventai_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
<td style="text-align: right;"><button id="btn_log_tbc_eventai_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> test</button></td>
<td style="text-align: right;"><button id="btn_logdel_tbc_eventai_test" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
</tr>
<tr>
<th>Realmd.log</th>
<td style="text-align: right;"><button id="btn_log_tbc_realm_live" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> live</button></td>
<td style="text-align: right;"><button id="btn_logdel_tbc_realm_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
<td style="text-align: right;"><button id="btn_log_tbc_realm_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> test</button></td>
<td style="text-align: right;"><button id="btn_logdel_tbc_realm_test" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
</tr>
<tr>
<th>SD2Errors.log</th>
<td style="text-align: right;"><button id="btn_log_tbc_sd2_live" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> live</button></td>
<td style="text-align: right;"><button id="btn_logdel_tbc_sd2_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
<td style="text-align: right;"><button id="btn_log_tbc_sd2_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> test</button></td>
<td style="text-align: right;"><button id="btn_logdel_tbc_sd2_test" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
</tr>
<tr>
<th>Server.log</th>
<td style="text-align: right;"><button id="btn_log_tbc_server_live" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> live</button></td>
<td style="text-align: right;"><button id="btn_logdel_tbc_server_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
<td style="text-align: right;"><button id="btn_log_tbc_server_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> test</button></td>
<td style="text-align: right;"><button id="btn_logdel_tbc_server_test" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div class="panel panel-default">

View File

@ -0,0 +1,4 @@
<?php
require_once dirname(__FILE__).'/sql/autoload.inc';
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'SAI');
\SYSTEM\SAI\sai::register('\SAI\saimod_mojotrollz_server_tbc');

View File

@ -0,0 +1,615 @@
function init_saimod_mojotrollz_server_tbc(){
{
load_visualisation_mojotrollz_server_tbc('vis_tbc', 'stats_tbc', '#filter_vis_tbc', 'Players on WoW-TBC', 900,350);
$('#filter_vis_tbc').on('change',function(){
load_visualisation_mojotrollz_server_tbc('vis_tbc', 'stats_tbc', '#filter_vis_tbc', 'Players on WoW-TBC', 900,350);
})
}
$('#btn_clear').click(function(){
$('#output_log').html('');
$('#table_changes').html('');
});
register_tbc();
}
function register_tbc(){
{
$('#btn_tbc_realm_start').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'run_tbc_realm_start'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_tbc_realm_stop').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'run_tbc_realm_stop'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_tbc_realm_status').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'run_tbc_realm_status'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
}
{
$('#btn_tbc_world_start').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'run_tbc_world_start'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_tbc_world_stop').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'run_tbc_world_stop'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_tbc_world_status').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'run_tbc_world_status'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
}
{
$('#btn_tbc_world_test_start').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'run_tbc_world_test_start'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_tbc_world_test_stop').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'run_tbc_world_test_stop'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_tbc_world_test_status').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'run_tbc_world_test_status'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
}
{
$('#btn_compile_tbc_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'compile_tbc_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_compile_tbc_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'compile_tbc_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
}
{
$('#btn_db_tbc_realm_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'db_tbc_realm_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_db_tbc_chars_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'db_tbc_chars_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_db_tbc_chars_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'db_tbc_chars_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_db_tbc_world_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'db_tbc_world_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_db_tbc_world_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'db_tbc_world_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
}
{
$('#btn_log_tbc_chars_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'log_tbc_chars_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_log_tbc_chars_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'log_tbc_chars_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_log_tbc_db_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'log_tbc_db_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_log_tbc_db_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'log_tbc_db_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_log_tbc_eventai_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'log_tbc_eventai_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_log_tbc_eventai_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'log_tbc_eventai_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_log_tbc_realm_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'log_tbc_realm_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_log_tbc_realm_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'log_tbc_realm_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_log_tbc_sd2_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'log_tbc_sd2_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_log_tbc_sd2_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'log_tbc_sd2_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_log_tbc_server_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'log_tbc_server_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_log_tbc_server_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'log_tbc_server_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
}
{
$('#btn_logdel_tbc_chars_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'logdel_tbc_chars_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_logdel_tbc_chars_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'logdel_tbc_chars_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_logdel_tbc_db_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'logdel_tbc_db_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_logdel_tbc_db_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'logdel_tbc_db_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_logdel_tbc_eventai_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'logdel_tbc_eventai_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_logdel_tbc_eventai_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'logdel_tbc_eventai_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_logdel_tbc_realm_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'logdel_tbc_realm_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_logdel_tbc_realm_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'logdel_tbc_realm_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_logdel_tbc_sd2_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'logdel_tbc_sd2_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_logdel_tbc_sd2_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'logdel_tbc_sd2_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_logdel_tbc_server_live').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'logdel_tbc_server_live'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
$('#btn_logdel_tbc_server_test').click(function(){
growl_start('Doing ... please wait')
$.ajax({ type :'GET',
url : './sai.php',
data : { sai_mod: '.SAI.saimod_mojotrollz_server_tbc',
action: 'logdel_tbc_server_test'},
success : function(data) {
$('#output_log').append(data);
growl_end_success("Updated successfully!");
}
});
});
}
}
function growl_start(message){
$.bootstrapGrowl(message, {
ele: 'body', // which element to append to
type: 'info', // (null, 'info', 'danger', 'success')
offset: {from: 'top', amount: 50}, // 'top', or 'bottom'
align: 'right', // ('left', 'right', or 'center')
width: 250, // (integer, or 'auto')
//delay: 7000, // Time while the message will be displayed. It's not equivalent to the *demo* timeOut!
allow_dismiss: true, // If true then will display a cross to close the popup.
stackup_spacing: 10 // spacing between consecutively stacked growls.
});
}
function growl_end_success(message){
$.bootstrapGrowl(message, {
ele: 'body', // which element to append to
type: 'success', // (null, 'info', 'danger', 'success')
offset: {from: 'top', amount: 50}, // 'top', or 'bottom'
align: 'right', // ('left', 'right', or 'center')
width: 250, // (integer, or 'auto')
delay: 4500, // Time while the message will be displayed. It's not equivalent to the *demo* timeOut!
allow_dismiss: true, // If true then will display a cross to close the popup.
stackup_spacing: 10 // spacing between consecutively stacked growls.
});
}
function growl_end_error(message){
$.bootstrapGrowl(message, {
ele: 'body', // which element to append to
type: 'danger', // (null, 'info', 'danger', 'success')
offset: {from: 'top', amount: 50}, // 'top', or 'bottom'
align: 'right', // ('left', 'right', or 'center')
width: 250, // (integer, or 'auto')
delay: 4500, // Time while the message will be displayed. It's not equivalent to the *demo* timeOut!
allow_dismiss: true, // If true then will display a cross to close the popup.
stackup_spacing: 10 // spacing between consecutively stacked growls.
});
}
function load_visualisation_mojotrollz_server_tbc(div, stats, filter, name, width, height){
$.getJSON('./sai.php?sai_mod=.SAI.saimod_mojotrollz_server_tbc&action='+stats+'&filter='+$(filter).val(),function(json){
if(!json || json.status != true || !json.result){
return;}
json = json.result;
var data = new google.visualization.DataTable();
first = true;
$.each(json[0], function(key, value){
if(first){
data.addColumn('datetime',key);
first = false;
} else {
data.addColumn('number',key);
}
});
$.each(json, function(key, value){first = true; data.addRow($.map(value, function(v) { if(first){first=false;return [new Date(v)];}else{return [(v == null || parseFloat(v) <= 0) ? parseFloat(0) : parseFloat(v)];}}));});
var options = {title: name, aggregationTarget: 'category', selectionMode: 'multiple', curveType: 'function', /*focusTarget: 'category',*/ chartArea:{left:40,top:40}, vAxis:{logScale: false}, interpolateNulls: false, width: width, height: height};
new google.visualization.LineChart(document.getElementById(div)).draw(data, options);
});
}

View File

@ -0,0 +1,175 @@
<?php
namespace SAI;
class saimod_mojotrollz_server_tbc extends \SYSTEM\SAI\SaiModule {
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc(){
$vars = array();
$vars['tbc_realm_status'] = self::sai_mod__SAI_saimod_mojotrollz_server_tbc_action_run_tbc_realm_status();
$vars['tbc_world_status'] = self::sai_mod__SAI_saimod_mojotrollz_server_tbc_action_run_tbc_world_status();
$vars['tbc_world_test_status'] = self::sai_mod__SAI_saimod_mojotrollz_server_tbc_action_run_tbc_world_test_status();
$vars['tbc_players_online'] = self::online_tbc();
$vars['tbc_test_players_online'] = self::online_tbc_test();
return \SYSTEM\PAGE\replace::replaceFile(dirname(__FILE__).'/tpl/main.tpl', $vars);}
public static function html_li_menu(){return '<li class=""><a data-toggle="tooltip" data-placement="left" title="Mojotrollz TBC Server" href="#!mojotrollz_server_tbc"><span class="glyphicon glyphicon-tree-deciduous" aria-hidden="true"></span>&nbsp;&nbsp;TBC Server</a></li>';}
public static function right_public(){return false;}
public static function right_right(){return \SYSTEM\SECURITY\security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
public static function js(){return array(new \PSAI('saimod_mojotrollz_server_tbc/js/saimod_mojotrollz_server_tbc.js'));}
//public static function css(){}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_stats_tbc($filter = 600){
return \SYSTEM\LOG\JsonResult::toString(\SQL\STATS_TBC::QA(array($filter)));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_stats_classic($filter = 600){
return \SYSTEM\LOG\JsonResult::toString(\SQL\STATS_CLASSIC::QA(array($filter)));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_stats_ts($filter = 600){
return \SYSTEM\LOG\JsonResult::toString(\SQL\STATS_TS::QA(array($filter)));}
public static function online_tbc(){
return \SQL\ONLINE_PLAYERS::Q1(new \SQL\mangos_one_chars())['count'];}
public static function online_tbc_test(){
return \SQL\ONLINE_PLAYERS::Q1(new \SQL\mangos_one_chars_test())['count'];}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_log_tbc_chars_live(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log/Char.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/tbc/server/log/Char.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_log_tbc_chars_test(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log_test/Char.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/tbc/server/log_test/Char.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_log_tbc_db_live(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log/DBErrors.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/tbc/server/log/DBErrors.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_log_tbc_db_test(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log/DBErrors.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/tbc/server/log_test/DBErrors.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_log_tbc_eventai_live(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log/EventAIErrors.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/tbc/server/log/EventAIErrors.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_log_tbc_eventai_test(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log_test/EventAIErrors.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/tbc/server/log_test/EventAIErrors.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_log_tbc_realm_live(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log/Realmd.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/tbc/server/log/Realmd.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_log_tbc_realm_test(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log_test/Realmd.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/tbc/server/log_test/Realmd.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_log_tbc_sd2_live(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log/SD2Errors.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/tbc/server/log/SD2Errors.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_log_tbc_sd2_test(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log_test/SD2Errors.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/tbc/server/log_test/SD2Errors.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_log_tbc_server_live(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log/Server.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/tbc/server/log/Server.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_log_tbc_server_test(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log_test/Server.log')){
return 'File not Found';}
return \htmlentities(\file_get_contents('/home/mojotrollz/mojo/tbc/server/log_test/Server.log'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_logdel_tbc_chars_live(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log/Char.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/tbc/server/log/Char.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_logdel_tbc_chars_test(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log_test/Char.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/tbc/server/log_test/Char.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_logdel_tbc_db_live(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log/DBErrors.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/tbc/server/log/DBErrors.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_logdel_tbc_db_test(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log_test/DBErrors.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/tbc/server/log_test/DBErrors.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_logdel_tbc_eventai_live(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log/EventAIErrors.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/tbc/server/log/EventAIErrors.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_logdel_tbc_eventai_test(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log_test/EventAIErrors.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/tbc/server/log_test/EventAIErrors.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_logdel_tbc_realm_live(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log/Realmd.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/tbc/server/log/Realmd.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_logdel_tbc_realm_test(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log_test/Realmd.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/tbc/server/log_test/Realmd.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_logdel_tbc_sd2_live(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log/SD2Errors.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/tbc/server/log/SD2Errors.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_logdel_tbc_sd2_test(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log_test/SD2Errors.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/tbc/server/log_test/SD2Errors.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_logdel_tbc_server_live(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log/Server.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/tbc/server/log/Server.log',''));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_logdel_tbc_server_test(){
if(!\file_exists('/home/mojotrollz/mojo/tbc/server/log_test/Server.log')){
return 'File not Found';}
return \htmlentities(\file_put_contents('/home/mojotrollz/mojo/tbc/server/log_test/Server.log',''));}
private static function shell_run($ver,$prog,$cmd){
return \str_replace("\n","\r\n",shell_exec('/home/mojotrollz/mojo/run '.$ver.' '.$prog.' '.$cmd.' 2>&1'));}
private static function shell_db($ver,$db,$cmd){
return \str_replace("\n","\r\n",shell_exec('/home/mojotrollz/mojo/db '.$ver.' '.$db.' '.$cmd.' 2>&1'));}
private static function shell_compile($ver,$cmd){
return \str_replace("\n","\r\n",shell_exec('/home/mojotrollz/mojo/compile '.$ver.' '.$cmd.' 2>&1'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_compile_tbc_live(){
$log = \htmlentities(self::shell_compile('tbc', 'live'));
$log .= chmod('/home/mojotrollz/mojo/'.'tbc/server/bin/bin/run-mangosd',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
return $log;
}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_compile_tbc_test(){
$log = \htmlentities(self::shell_compile('tbc', 'test'));
$log .= chmod('/home/mojotrollz/mojo/'.'tbc/server/bin_test/bin/run-mangosd',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
return $log;
}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_db_tbc_realm_live(){
return \htmlentities(self::shell_db('tbc', 'realm', 'live'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_db_tbc_chars_live(){
return \htmlentities(self::shell_db('tbc', 'chars', 'live'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_db_tbc_chars_test(){
return \htmlentities(self::shell_db('tbc', 'chars', 'test'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_db_tbc_world_live(){
return \htmlentities(self::shell_db('tbc', 'world', 'live'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_db_tbc_world_test(){
return \htmlentities(self::shell_db('tbc', 'world', 'test'));}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_run_tbc_realm_start(){
return self::shell_run('tbc', 'realm','start');}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_run_tbc_world_start(){
return self::shell_run('tbc', 'world','start');}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_run_tbc_world_test_start(){
return self::shell_run('tbc', 'world_test','start');}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_run_tbc_realm_stop(){
return self::shell_run('tbc', 'realm','stop');}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_run_tbc_world_stop(){
return self::shell_run('tbc', 'world','stop');}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_run_tbc_world_test_stop(){
return self::shell_run('tbc', 'world_test','stop');}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_run_tbc_realm_status(){
return self::shell_run('tbc', 'realm','status');}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_run_tbc_world_status(){
return self::shell_run('tbc', 'world','status');}
public static function sai_mod__SAI_saimod_mojotrollz_server_tbc_action_run_tbc_world_test_status(){
return self::shell_run('tbc', 'world_test','status');}
}

View File

@ -0,0 +1,9 @@
<?php
namespace SQL;
class DATA_SAIMOD_MOJOTROLLZ_SERVER_TBC extends \SYSTEM\DB\QI {
public static function get_class(){return \get_class();}
public static function files_mysql(){
return array( (new \PSAI('/saimod_mojotrollz_server_handling/sql/mysql/system_page.sql'))->SERVERPATH(),
(new \PSAI('/saimod_mojotrollz_server_handling/sql/mysql/system_api.sql'))->SERVERPATH());
}
}

View File

@ -0,0 +1,4 @@
<?php
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'SQL');
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/qq/','SQL');
\SYSTEM\SQL\setup::register('SQL\\DATA_SAIMOD_MOJOTROLLZ_SERVER_TBC');

View File

@ -0,0 +1,3 @@
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5600, 42, 0, 0, '_SAI_saimod_mojotrollz_server_tbc', 'action', NULL);
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5620, 42, 3, 5600, NULL, 'filter', 'INT');

View File

@ -0,0 +1 @@
REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (560, 42, 'mojotrollz_server_tbc', 'mojotrollz_server_tbc', -1, 0, 0, '#content', './sai.php?sai_mod=.SAI.saimod_mojotrollz_server_tbc', 'init_saimod_mojotrollz_server_tbc', '\\SAI\\saimod_mojotrollz_server_tbc');

View File

@ -0,0 +1,8 @@
<?php
namespace SQL;
class ONLINE_PLAYERS extends \SYSTEM\DB\QQ {
public static function get_class(){return \get_class();}
public static function mysql(){return
'SELECT count(*) as count FROM characters WHERE online = 1 OR at_login = 1;';
}
}

View File

@ -0,0 +1,14 @@
<?php
namespace SQL;
class STATS_TBC extends \SYSTEM\DB\QP {
public static function get_class(){return \get_class();}
public static function mysql(){return
'SELECT DATE_FORMAT(FROM_UNIXTIME(UNIX_TIMESTAMP('.\SYSTEM\SQL\system_log::FIELD_TIME.') - MOD(UNIX_TIMESTAMP('.\SYSTEM\SQL\system_log::FIELD_TIME.'),?)),"%Y/%m/%d %H:%i:%s") as day,'
.'avg('.\SYSTEM\SQL\system_log::FIELD_CODE.') online'
.' FROM '.\SYSTEM\SQL\system_log::NAME_MYS
.' WHERE '.\SYSTEM\SQL\system_log::NAME_MYS.'.'.\SYSTEM\SQL\system_log::FIELD_CLASS.' LIKE "%PLAYER_COUNT_TBC"'
.' GROUP BY day'
.' ORDER BY day DESC'
.' LIMIT 30;';
}
}

View File

@ -0,0 +1,181 @@
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><h4>TBC - Status</h4></div>
<div class="panel-body">
<table class="table">
<tr>
<th>realm</th>
<td>${tbc_realm_status}</td>
</tr>
<tr>
<th>world</th>
<td>${tbc_world_status}</td>
</tr>
<tr>
<th>world_test</th>
<td>${tbc_world_test_status}</td>
</tr>
<tr>
<th>players live</th>
<td>${tbc_players_online}</td>
</tr>
<tr>
<th>players test</th>
<td>${tbc_test_players_online}</td>
</tr>
</table>
<div id="vis_tbc"></div>
<select id="filter_vis_tbc">
<option value="2692000">30d</option>
<option value="1209600">14d</option>
<option value="604800">7d</option>
<option value="172800">2d</option>
<option value="86400">1d</option>
<option value="43200">12h</option>
<option value="21600">6h</option>
<option value="14400">4h</option>
<option value="7200">2h</option>
<option value="3600">1h</option>
<option value="1800">30m</option>
<option value="600" selected>10m</option>
<option value="300">5m</option>
<option value="60">1m</option>
<option value="30">30s</option>
<option value="10">10s</option>
<option value="5">5s</option>
<option value="1">1s</option>
</select>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><h4>TBC - Run</h4></div>
<div class="panel-body">
<table class="table">
<tr>
<th>realm</th>
<td style="text-align: right;"><button id="btn_tbc_realm_start" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-play" aria-hidden="true"></span> start</button></td>
<td style="text-align: right;"><button id="btn_tbc_realm_stop" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-stop" aria-hidden="true"></span> stop</button></td>
<td style="text-align: right;"><button id="btn_tbc_realm_status" class="btn-primary btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-search" aria-hidden="true"></span> status</button></td>
</tr>
<tr>
<th>world</th>
<td style="text-align: right;"><button id="btn_tbc_world_start" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-play" aria-hidden="true"></span> start</button></td>
<td style="text-align: right;"><button id="btn_tbc_world_stop" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-stop" aria-hidden="true"></span> stop</button></td>
<td style="text-align: right;"><button id="btn_tbc_world_status" class="btn-primary btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-search" aria-hidden="true"></span> status</button></td>
</tr>
<tr>
<th>world_test</th>
<td style="text-align: right;"><button id="btn_tbc_world_test_start" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-play" aria-hidden="true"></span> start</button></td>
<td style="text-align: right;"><button id="btn_tbc_world_test_stop" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-stop" aria-hidden="true"></span> stop</button></td>
<td style="text-align: right;"><button id="btn_tbc_world_test_status" class="btn-primary btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-search" aria-hidden="true"></span> status</button></td>
</tr>
</table>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><h4>TBC - Database <font color="red" size="2">Stop the Server first!</font></h4></div>
<div class="panel-body">
<table class="table">
<tr>
<th>realm</th>
<td style="text-align: right;"><button id="btn_db_tbc_realm_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> deploy live</button></td>
<td></td>
</tr>
<tr>
<th>chars</th>
<td style="text-align: right;"><button id="btn_db_tbc_chars_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> deploy live</button></td>
<td style="text-align: right;"><button id="btn_db_tbc_chars_test" class="btn-warning btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> deploy test</button></td>
</tr>
<tr>
<th>world</th>
<td style="text-align: right;"><button id="btn_db_tbc_world_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> deploy live</button></td>
<td style="text-align: right;"><button id="btn_db_tbc_world_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> deploy test</button></td>
</tr>
</table>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><h4>TBC - Compile <font color="red" size="2">Stop the Server first!</font></h4></div>
<div class="panel-body">
<table class="table">
<tr>
<th>live</th>
<td style="text-align: right;"><button id="btn_compile_tbc_live" class="btn-warning btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-wrench" aria-hidden="true"></span> compile</button></td>
</tr>
<tr>
<th>test</th>
<td style="text-align: right;"><button id="btn_compile_tbc_test" class="btn-warning btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-wrench" aria-hidden="true"></span> compile</button></td>
</tr>
</table>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><h4>TBC - Log</h4></div>
<div class="panel-body">
<table class="table">
<tr>
<th>Char.log</th>
<td style="text-align: right;"><button id="btn_log_tbc_chars_live" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> live</button></td>
<td style="text-align: right;"><button id="btn_logdel_tbc_chars_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
<td style="text-align: right;"><button id="btn_log_tbc_chars_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> test</button></td>
<td style="text-align: right;"><button id="btn_logdel_tbc_chars_test" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
</tr>
<tr>
<th>DBErrors.log</th>
<td style="text-align: right;"><button id="btn_log_tbc_db_live" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> live</button></td>
<td style="text-align: right;"><button id="btn_logdel_tbc_db_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
<td style="text-align: right;"><button id="btn_log_tbc_db_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> test</button></td>
<td style="text-align: right;"><button id="btn_logdel_tbc_db_test" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
</tr>
<tr>
<th>EventAIErrors.log</th>
<td style="text-align: right;"><button id="btn_log_tbc_eventai_live" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> live</button></td>
<td style="text-align: right;"><button id="btn_logdel_tbc_eventai_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
<td style="text-align: right;"><button id="btn_log_tbc_eventai_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> test</button></td>
<td style="text-align: right;"><button id="btn_logdel_tbc_eventai_test" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
</tr>
<tr>
<th>Realmd.log</th>
<td style="text-align: right;"><button id="btn_log_tbc_realm_live" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> live</button></td>
<td style="text-align: right;"><button id="btn_logdel_tbc_realm_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
<td style="text-align: right;"><button id="btn_log_tbc_realm_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> test</button></td>
<td style="text-align: right;"><button id="btn_logdel_tbc_realm_test" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
</tr>
<tr>
<th>SD2Errors.log</th>
<td style="text-align: right;"><button id="btn_log_tbc_sd2_live" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> live</button></td>
<td style="text-align: right;"><button id="btn_logdel_tbc_sd2_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
<td style="text-align: right;"><button id="btn_log_tbc_sd2_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> test</button></td>
<td style="text-align: right;"><button id="btn_logdel_tbc_sd2_test" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
</tr>
<tr>
<th>Server.log</th>
<td style="text-align: right;"><button id="btn_log_tbc_server_live" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> live</button></td>
<td style="text-align: right;"><button id="btn_logdel_tbc_server_live" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
<td style="text-align: right;"><button id="btn_log_tbc_server_test" class="btn-success btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> test</button></td>
<td style="text-align: right;"><button id="btn_logdel_tbc_server_test" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button></td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><h4>Output</h4></div>
<div class="panel-body">
<table>
<thead>
<tr>
<th>Path</th>
<th>Submodule</th>
<th>Action</th>
</tr>
</thead>
<tbody id="table_changes">
</tbody>
</table>
<textarea id="output_log" style="width: 100%; height: 350px;"></textarea>
<button id="btn_clear" class="btn-danger btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px;"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Clear</button>
</div>
</div>