当前位置: 首页>>代码示例>>PHP>>正文


PHP Game::is_player方法代码示例

本文整理汇总了PHP中Game::is_player方法的典型用法代码示例。如果您正苦于以下问题:PHP Game::is_player方法的具体用法?PHP Game::is_player怎么用?PHP Game::is_player使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Game的用法示例。


在下文中一共展示了Game::is_player方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Game

// load the game
// always refresh the game data, there may be more than one person online
try {
    $Game = new Game((int) $_SESSION['game_id']);
    $players = $Game->get_players();
} catch (MyException $e) {
    if (!defined('DEBUG') || !DEBUG) {
        Flash::store('Error Accessing Game !');
    } else {
        call('ERROR ACCESSING GAME :' . $e->outputMessage());
    }
    exit;
}
// MOST FORM SUBMISSIONS ARE AJAXED THROUGH /scripts/game.js
// game buttons and moves are passed through the game controller
if (!$Game->is_player($_SESSION['player_id'])) {
    $Game->watch_mode = true;
    $chat_html = '';
    unset($Chat);
}
if (!$Game->watch_mode || $GLOBALS['Player']->is_admin) {
    $Chat = new Chat($_SESSION['player_id'], $_SESSION['game_id']);
    $chat_data = $Chat->get_box_list();
    $chat_html = '
			<div id="chatbox">
				<form action="' . $_SERVER['REQUEST_URI'] . '" method="post"><div>
					<input id="chat" type="text" name="chat" />
					<label for="private" class="inline"><input type="checkbox" name="private" id="private" value="yes" /> Private</label>
				</div></form>
				<dl id="chats">';
    if (is_array($chat_data)) {
开发者ID:benjamw,项目名称:pharaoh,代码行数:31,代码来源:game.php

示例2: htmlentities

        }
        // preserve spaces in the chat text
        $chat['message'] = htmlentities($chat['message'], ENT_QUOTES, 'ISO-8859-1', false);
        $chat['message'] = str_replace("\t", '    ', $chat['message']);
        $chat['message'] = str_replace('  ', ' &nbsp;', $chat['message']);
        $chat_html .= '
				<dt class="' . $color . '"><span>' . $chat['create_date'] . '</span> ' . $chat['username'] . '</dt>
				<dd' . ($chat['private'] ? ' class="private"' : '') . '>' . $chat['message'] . '</dd>';
    }
    $chat_html .= '
			</dl> <!-- #chats -->';
}
$chat_html .= '
		</div> <!-- #chatbox -->';
// hide the chat from non-players
if ('Finished' == $Game->state && !$Game->is_player($_SESSION['player_id'])) {
    $chat_html = '';
}
$win_text = '';
$turn = $Game->get_my_turn() ? 'Your Turn' : $Game->name . '\'s Turn';
$no_turn = false;
if ($Game->paused) {
    $turn = 'PAUSED';
    $no_turn = true;
} elseif ('Finished' == $Game->state) {
    $turn = 'GAME OVER';
    $no_turn = true;
    list($win_text, $outcome, $outcome_data) = $Game->get_outcome($_SESSION['player_id']);
}
$info_bar = '<span class="turn">' . $turn . '</span>';
$matching_methods = $Game->get_matching_methods();
开发者ID:benjamw,项目名称:quarto,代码行数:31,代码来源:game.php

示例3: catch

        Flash::store('Game Invitations Sent Successfully');
    } catch (MyException $e) {
        Flash::store('Game Invite FAILED !');
    }
}
if (isset($_POST['start'])) {
    test_token();
    try {
        $Game->start((int) $_POST['player_id']);
        Flash::store('Game Started Successfully', 'game.php?id=' . $_POST['game_id']);
    } catch (MyException $e) {
        Flash::store('Game Start FAILED !', true);
    }
}
// test if we are already in this game or not
$joined = $Game->is_player($_SESSION['player_id']);
$color_selection = '';
foreach ($Game->get_avail_colors() as $color) {
    $color_selection .= '<option class="' . strtolower(substr($color, 0, 3)) . '">' . ucfirst($color) . '</option>';
}
$password_box = '';
if ('' != $Game->passhash) {
    $password_box = '<li><label for="password">Password</label><input type="password" id="password" name="password" /></li>';
}
$meta['title'] = 'Join Game';
$meta['head_data'] = '
	<script type="text/javascript">//<![CDATA[
		$(document).ready( function( ) {
			$("#show_conquer_limit_table").fancybox({
				title: null,
				beforeLoad: function( ) {
开发者ID:studywithyou,项目名称:webrisk,代码行数:31,代码来源:join.php


注:本文中的Game::is_player方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。