예제 #1
0
        }
    }
}
$sdl->finish_job('Future Humans Rewards');
// ########################################################################################
// ########################################################################################
//BOT
ini_set('memory_limit', '500M');
define('FILE_PATH_hg', $game_path);
define('TICK_LOG_FILE_NPC', $game_path . 'logs/NPC_BOT_tick_' . date('d-m-Y', time()) . '.log');
include 'NPC_BOT.php';
include 'ferengi.php';
include 'borg.php';
include 'settlers.php';
$sdl->start_job('Ramona comes over - oh women are so wonderful');
$quark = new Ferengi($db, $sdl);
$quark->Execute(1, "Normal operation in the test round", 0, "#DEEB24");
$sdl->finish_job('Ramona comes over - oh women are so wonderful');
$sdl->start_job('SevenOfNine is coming - oh borg are not so beautiful');
$borg = new Borg($db, $sdl);
$borg->Execute(1);
$sdl->finish_job('SevenOfNine is coming - oh borg are not so beautiful');
$sdl->start_job('Mayflower is coming - settlers are the real workforce');
$settlers = new Settlers($db, $sdl);
$settlers->Execute(1);
$sdl->finish_job('Mayflower is coming - settlers are the real workforce');
// ########################################################################################
// ########################################################################################
// Update Tick-ID
// (here, everything is completed, which is based on the ticking ID)
if (substr($STARDATE, -1, 1) == '9') {
예제 #2
0
error_reporting(E_ERROR);
if (!empty($_SERVER['SERVER_SOFTWARE'])) {
    echo 'The scheduler can only be called by CLI!';
    exit;
}
// ########################################################################################
// ########################################################################################
// Init
$starttime = microtime() + time();
$sdl = new scheduler();
$sdl->log('<br><b>-------------------------------------------------------------</b><br>' . '<b>Starting Install BOTs at ' . date('d.m.y H:i:s', time()) . '</b>', INSTALL_LOG_FILE_NPC);
// create sql-object for db-connection
$db = new sql($config['server'] . ":" . $config['port'], $config['game_database'], $config['user'], $config['password']);
$game = new game();
// Install Quark BOT
$quark = new Ferengi($db, $sdl);
$quark->Install();
// Install SevenOfNine BOT
$borg = new Borg($db, $sdl);
$borg->Install();
// Install Settlers BOT
$settlers = new Settlers($db, $sdl);
$settlers->Install();
// ########################################################################################
// ########################################################################################
// Quit and close log
$db->close();
$sdl->log('<b>Finished Install BOTs in <font color=#009900>' . round(microtime() + time() - $starttime, 4) . ' secs</font><br>Executed Queries: <font color=#ff0000>' . $db->i_query . '</font></b>', INSTALL_LOG_FILE_NPC);
?>