本文整理汇总了PHP中SmrSession::update方法的典型用法代码示例。如果您正苦于以下问题:PHP SmrSession::update方法的具体用法?PHP SmrSession::update怎么用?PHP SmrSession::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SmrSession
的用法示例。
在下文中一共展示了SmrSession::update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_file_loc
// *
// * 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);
}
示例2: do_voodoo
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;
}