Ejemplo n.º 1
0
// we are in the scheduler...
error_reporting(E_ERROR);
if (!empty($_SERVER['SERVER_SOFTWARE'])) {
    echo 'The scheduler can only be called by CLI!';
    exit;
}
// #######################################################################################
// #######################################################################################
// Init
$starttime = microtime() + time();
// create logging facility
$sdl = new scheduler();
// create sql-object for db-connection
$db = new sql($config['server'] . ":" . $config['port'], $config['game_database'], $config['user'], $config['password']);
$game = new game();
$sdl->log('<br><br><br><b>-------------------------------------------------------------</b><br>' . '<b>Starting Daily script at ' . date('d.m.y H:i:s', time()) . '</b>');
// #######################################################################################
// #######################################################################################
// Reset New Registration Count
$sdl->start_job('Reset New Registration Count');
if (!$db->query('UPDATE config SET new_register = 0')) {
    $sdl->log('<b>Error:</b> cannot reset new registration count!');
}
$sdl->finish_job('Reset New Registration Count');
// #######################################################################################
// #######################################################################################
// Check sitting abuse and lock'em
$sdl->start_job('Sitting abuse check');
$sql = 'SELECT user_id,user_name,num_hits,num_sitting FROM user
        WHERE (num_sitting/(num_hits+1))>0.35 AND
              (num_sitting>50 OR (num_hits<10 AND num_sitting>30))';
Ejemplo n.º 2
0
// ########################################################################################
// Init
$starttime = microtime() + time();
include $game_path . 'include/global.php';
include $game_path . 'include/functions.php';
include $game_path . 'include/text_races.php';
include $game_path . 'include/race_data.php';
include $game_path . 'include/ship_data.php';
include $game_path . 'include/libs/moves.php';
include $game_path . 'include/libs/world.php';
// Needed by NPC BOT
$sdl = new scheduler();
$db = new sql($config['server'] . ":" . $config['port'], $config['game_database'], $config['user'], $config['password']);
// create sql-object for db-connection
$game = new game();
$sdl->log('<br><br><br><b>-------------------------------------------------------------</b><br>' . '<b>Starting Scheduler at ' . date('d.m.y H:i:s', time()) . '</b>');
if (($cfg_data = $db->queryrow('SELECT * FROM config')) === false) {
    $sdl->log('- Fatal: Could not query tick data! ABORTED');
    exit;
}
$ACTUAL_TICK = $cfg_data['tick_id'];
$NEXT_TICK = $cfg_data['tick_time'] - time();
$LAST_TICK_TIME = $cfg_data['tick_time'] - TICK_DURATION * 60;
$STARDATE = $cfg_data['stardate'];
$FUTURE_SHIP = $cfg_data['future_ship'];
if ($cfg_data['tick_stopped']) {
    $sdl->log('Finished Scheduler in ' . round(microtime() + time() - $starttime, 4) . ' secs<br>Tick has been stopped (Unlock in table "config")');
    exit;
}
if (empty($ACTUAL_TICK)) {
    $sdl->log('Finished Scheduler in ' . round(microtime() + time() - $starttime, 4) . ' secs<br>- Fatal: empty($ACTUAL_TICK) == true');
Ejemplo n.º 3
0
include 'ferengi.php';
include 'borg.php';
include 'settlers.php';
// include commons classes and functions
include 'commons.php';
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
Ejemplo n.º 4
0
// include commons classes and functions
include 'commons.php';
// ########################################################################################
// ########################################################################################
// Init
$starttime = microtime() + time();
include $game_path . 'include/global.php';
include $game_path . 'include/functions.php';
include $game_path . 'include/text_races.php';
include $game_path . 'include/race_data.php';
include $game_path . 'include/ship_data.php';
include $game_path . 'include/libs/moves.php';
$sdl = new scheduler();
$db = new sql($config['server'] . ":" . $config['port'], $config['game_database'], $config['user'], $config['password']);
// create sql-object for db-connection
$sdl->log('<br><br><br><b>-------------------------------------------------------------</b><br>' . '<b>Starting FixAll-Script at ' . date('d.m.y H:i:s', time()) . '</b>');
if (($cfg_data = $db->queryrow('SELECT * FROM config')) === false) {
    $sdl->log('- Fatal: Could not query tick data! ABORTED');
    exit;
}
$ACTUAL_TICK = $cfg_data['tick_id'];
$NEXT_TICK = $cfg_data['tick_time'] - time();
$LAST_TICK_TIME = $cfg_data['tick_time'] - 5 * 60;
$STARDATE = $cfg_data['stardate'];
if ($cfg_data['tick_stopped']) {
    $sdl->log('Finished FixAll-Script in ' . round(microtime() + time() - $starttime, 4) . ' secs<br>Tick has been stopped (Unlock in table "config")');
    exit;
}
if (empty($ACTUAL_TICK)) {
    $sdl->log('Finished FixAll-Script in ' . round(microtime() + time() - $starttime, 4) . ' secs<br>- Fatal: empty($ACTUAL_TICK) == true');
    exit;
Ejemplo n.º 5
0
// ########################################################################################
// ########################################################################################
// Init
$starttime = microtime() + time();
//include($game_path . '/include/sql.php');
include $game_path . 'include/global.php';
include $game_path . 'include/functions.php';
include $game_path . 'include/text_races.php';
include $game_path . 'include/race_data.php';
include $game_path . 'include/ship_data.php';
include $game_path . 'include/libs/moves.php';
$sdl = new scheduler();
$db = new sql($config['server'] . ":" . $config['port'], $config['game_database'], $config['user'], $config['password']);
// create sql-object for db-connection
$game = new game();
$sdl->log('<br><br><br><b>-------------------------------------------------------------</b><br>' . '<b>Starting Scheduler at ' . date('d.m.y H:i:s', time()) . '</b>');
if (($cfg_data = $db->queryrow('SELECT * FROM config')) === false) {
    $sdl->log('- Fatal: Could not query tick data! ABORTED');
    exit;
}
$ACTUAL_TICK = $cfg_data['tick_id'];
$NEXT_TICK = $cfg_data['tick_time'] - time();
$LAST_TICK_TIME = $cfg_data['tick_time'] - TICK_DURATION * 60;
$STARDATE = $cfg_data['stardate'];
if ($cfg_data['tick_stopped']) {
    $sdl->log('Finished Scheduler in ' . round(microtime() + time() - $starttime, 4) . ' secs<br>Tick has been stopped (Unlock in table "config")');
    exit;
}
if (empty($ACTUAL_TICK)) {
    $sdl->log('Finished Scheduler in ' . round(microtime() + time() - $starttime, 4) . ' secs<br>- Fatal: empty($ACTUAL_TICK) == true');
    exit;
Ejemplo n.º 6
0
include 'NPC_BOT.php';
// #######################################################################################
// #######################################################################################
// Init
$starttime = microtime() + time();
include $game_path . 'include/global.php';
include $game_path . 'include/functions.php';
include $game_path . 'include/text_races.php';
include $game_path . 'include/race_data.php';
include $game_path . 'include/ship_data.php';
include $game_path . 'include/libs/moves.php';
$sdl = new scheduler();
$db = new sql($config['server'] . ":" . $config['port'], $config['game_database'], $config['user'], $config['password']);
// create sql-object for db-connection
$game = new game();
$sdl->log('<br><br><br><b>-------------------------------------------------------------</b><br>' . '<b>Starting SixHours-Script at ' . date('d.m.y H:i:s', time()) . '</b>');
if (($cfg_data = $db->queryrow('SELECT * FROM config')) === false) {
    $sdl->log('- Fatal: Could not query tick data! ABORTED');
    exit;
}
$ACTUAL_TICK = $cfg_data['tick_id'];
$NEXT_TICK = $cfg_data['tick_time'] - time();
$LAST_TICK_TIME = $cfg_data['tick_time'] - 5 * 60;
$STARDATE = $cfg_data['stardate'];
if ($cfg_data['tick_stopped']) {
    $sdl->log('Finished SixHours-Script in ' . round(microtime() + time() - $starttime, 4) . ' secs<br>Tick has been stopped (Unlock in table "config")');
    exit;
}
if (empty($ACTUAL_TICK)) {
    $sdl->log('Finished SixHours-Script in ' . round(microtime() + time() - $starttime, 4) . ' secs<br>- Fatal: empty($ACTUAL_TICK) == true');
    exit;