// * // * I n c l u d e s h e r e // * // ******************************** require_once 'config.inc'; require_once LIB . 'Default/SmrMySqlDatabase.class.inc'; require_once ENGINE . 'Default/smr.inc'; require_once get_file_loc('SmrSession.class.inc'); require_once get_file_loc('SmrAccount.class.inc'); // ******************************** // * // * S e s s i o n // * // ******************************** if (SmrSession::$account_id > 0) { // creates a new user account object $account =& SmrAccount::getAccount(SmrSession::$account_id); // update last login column $account->updateLastLogin(); $href = SmrSession::getNewHREF(create_container('login_check_processing.php'), true); SmrSession::update(); header('Location: ' . $href); exit; } if (isset($_REQUEST['msg'])) { $template->assign('Message', htmlentities(trim($_REQUEST['msg']), ENT_COMPAT, 'utf-8')); } require_once LIB . 'Login/loginSmarty.php'; } catch (Exception $e) { handleException($e); }
function do_voodoo() { ob_clean(); global $lock, $var; foreach ($GLOBALS as $key => $value) { ${$key} =& $GLOBALS[$key]; } // initialize objects we usually need, like player, ship if (SmrSession::$game_id > 0) { $db = new SmrMySqlDatabase(); // We need to acquire locks BEFORE getting the player information // Otherwise we could be working on stale information $db->query('SELECT sector_id FROM player WHERE account_id=' . SmrSession::$old_account_id . ' AND game_id=' . SmrSession::$game_id . ' LIMIT 1'); $db->next_record(); $sector_id = $db->f('sector_id'); if (!$lock && $var['body'] != 'error.php' && !isset($var['ForwardError'])) { if (!acquire_lock($sector_id)) { create_error("Failed to acquire sector lock"); } } // Now that they've acquire a lock we can move on $player = new SMR_PLAYER(SmrSession::$old_account_id, SmrSession::$game_id); if ($player->dead == 'TRUE' && $var['body'] != 'death.php' && !isset($var['override_death'])) { $container = array(); $container["url"] = "skeleton.php"; $container["body"] = "death.php"; forward($container); } $ship = new SMR_SHIP(SmrSession::$old_account_id, SmrSession::$game_id); // update turns on that player $player->update_turns($ship->speed); if ($player->newbie_turns <= 20 && $player->newbie_warning == "TRUE" && $var["body"] != "newbie_warning.php") { forward(create_container("skeleton.php", "newbie_warning.php")); } } require get_file_loc($var["url"]); SmrSession::update(); if ($lock) { release_lock($lock); } exit; }