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


PHP SmrSession::retrieveVar方法代碼示例

本文整理匯總了PHP中SmrSession::retrieveVar方法的典型用法代碼示例。如果您正苦於以下問題:PHP SmrSession::retrieveVar方法的具體用法?PHP SmrSession::retrieveVar怎麽用?PHP SmrSession::retrieveVar使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SmrSession的用法示例。


在下文中一共展示了SmrSession::retrieveVar方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: get_file_loc

 // *
 // * g e t   S e s s i o n
 // *
 // ********************************
 $sn = $_REQUEST['sn'];
 // check if we got a sn number with our url
 if (empty($sn)) {
     if (!USING_AJAX) {
         require_once get_file_loc('smr.inc');
         create_error('Your browser lost the SN. Try to reload the page!');
     } else {
         exit;
     }
 }
 // do we have such a container object in the db?
 if (!($var = SmrSession::retrieveVar($sn))) {
     if (!USING_AJAX) {
         require_once get_file_loc('smr.inc');
         create_error('Please avoid using the back button!');
     } else {
         exit;
     }
 }
 //used for include if we need a spec game script outside of the game
 $overrideGameID = 0;
 if (isset($var['game_id']) && is_numeric($var['game_id'])) {
     $overrideGameID = $var['game_id'];
 }
 if ($overrideGameID == 0 && isset($var['GameID']) && is_numeric($var['GameID'])) {
     $overrideGameID = $var['GameID'];
 }
開發者ID:smrealms,項目名稱:smrv2.0,代碼行數:31,代碼來源:loader.php

示例2:

                        $template->assign('MoveMessage', 'You have just checkmated your opponent, congratulations!');
                        break;
                    case 2:
                        $template->assign('MoveMessage', 'There is no piece in that square.');
                        break;
                    case 3:
                        $template->assign('MoveMessage', 'You cannot end your turn in check.');
                        break;
                    case 4:
                        $template->assign('MoveMessage', 'It is not your turn to move.');
                        break;
                    case 5:
                        $template->assign('MoveMessage', 'The game is over.');
                        break;
                }
            } else {
                //				this.logger.error('Player tried to move from an empty tile: username = ' + username + ', x = ' + xIn + ', y = ' + yIn + ', toX = ' + toXIn + ', toY = ' + toYIn);
            }
        } else {
            //			this.logger.error('Player tried to move in an ended game');
            $template->assign('MoveMessage', 'It is not your turn to move.');
        }
    } else {
        $template->assign('MoveMessage', 'This game is over.');
        //		this.logger.error('Player tried to move when it was not their turn: x = ' + xIn + ', y = ' + yIn + ', toX = ' + toXIn + ', toY = ' + toYIn);
    }
} else {
    //	this.logger.error('Player supplied an invalid number: x = ' + xIn + ', y = ' + yIn + ', toX = ' + toXIn + ', toY = ' + toYIn);
}
$var = SmrSession::retrieveVar(SmrSession::$lastSN);
do_voodoo();
開發者ID:smrealms,項目名稱:smrv2.0,代碼行數:31,代碼來源:chess_move_processing.php


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