當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SmrSession::update方法代碼示例

本文整理匯總了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);
}
開發者ID:smrealms,項目名稱:smrv2.0,代碼行數:31,代碼來源:login.php

示例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;
}
開發者ID:smrealms,項目名稱:smrv2.0,代碼行數:42,代碼來源:loader2.php


注:本文中的SmrSession::update方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。