本文整理汇总了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'];
}
示例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();