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


PHP CR3DCQuery::TGameStatus方法代码示例

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


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

示例1: GetStringFromStringTable

        if ($oR3DCQuery->TGameStatus($GID)) {
            $oR3DCQuery->GetTGameBoard($config, $GID, $_SESSION['sid'], $_SESSION['id'], $clrl, $clrd);
            if ($oR3DCQuery->IsPlayersTurn($config, $_SESSION['id'], $GID)) {
                //echo "Its, ".$_SESSION['user']." turn to play.";
                echo str_replace("['user']", $_SESSION['user'], GetStringFromStringTable("IDS_TGAME_TXT_3", $config));
            }
        } else {
            echo "<br>" . GetStringFromStringTable("IDS_TGAME_TXT_3", $config) . "";
        }
    }
    $oR3DCQuery->Close();
    unset($oR3DCQuery);
} else {
    //Instantiate theCR3DCQuery Class
    $oR3DCQuery = new CR3DCQuery($config);
    if ($oR3DCQuery->TimeForTGame($config, $GID) == false) {
        echo "<br>" . GetStringFromStringTable("IDS_TGAME_TXT_1", $config) . "";
    } else {
        if ($oR3DCQuery->TGameStatus($GID)) {
            $oR3DCQuery->GetTGameBoard($config, $GID, "", 0, $clrl, $clrd);
        } else {
            echo "<br>" . GetStringFromStringTable("IDS_TGAME_TXT_2", $config) . "";
        }
    }
    $oR3DCQuery->Close();
    unset($oR3DCQuery);
}
?>

</body>
</html>
开发者ID:robertohernando,项目名称:phpchess,代码行数:31,代码来源:t_game.php

示例2: elseif

		window.location.reload(true)
    } 
}
window.onload=starttime



<?php 
////////////
//Instantiate theCR3DCQuery Class
$oR3DCQuery = new CR3DCQuery($config);
if ($oR3DCQuery->IsPlayersTurn($config, $_SESSION['id'], $GID) && $oR3DCQuery->TimeForTGame($config, $GID)) {
    echo "parent.frames['chessboard'].location.reload();";
} elseif ($oR3DCQuery->IsPlayersTurn($config, $_SESSION['id'], $GID) == false && $oR3DCQuery->TimeForTGame($config, $GID) == false) {
    echo "parent.frames['chessboard'].location.reload();";
} elseif ($oR3DCQuery->TGameStatus($GID) == false) {
    echo "parent.frames['chessboard'].location.reload();";
}
$oR3DCQuery->Close();
unset($oR3DCQuery);
///////////
?>

</script>
<body>

<textarea cols='32' rows='24' class='post'>

<?php 
//Instantiate theCR3DCQuery Class
$oR3DCQuery = new CR3DCQuery($config);
开发者ID:robertohernando,项目名称:phpchess,代码行数:31,代码来源:t_chat.php

示例3:

$cmdResign = $_GET['cmdResign'];
if ($cmdResign != "") {
    if ($isblack) {
        $oR3DCQuery->UpdateGameStatus($config, $gid, "C", "W");
    } else {
        $oR3DCQuery->UpdateGameStatus($config, $gid, "C", "B");
    }
}
$oR3DCQuery->Close();
unset($oR3DCQuery);
$txtmovefrom = $_GET['txtmovefrom'];
$txtmoveto = $_GET['txtmoveto'];
if (isset($_SESSION['sid']) && isset($_SESSION['user']) && isset($_SESSION['id']) && $GID != "" && $txtmovefrom != "" && $txtmoveto != "") {
    //Instantiate theCR3DCQuery Class
    $oR3DCQuery = new CR3DCQuery($config);
    if ($oR3DCQuery->IsPlayersTurn($config, $_SESSION['id'], $GID) && $oR3DCQuery->TimeForTGame($config, $GID) && $oR3DCQuery->TGameStatus($GID)) {
        $movestr2 = $txtmovefrom . "-" . $txtmoveto;
        // get the fen for the game
        $fen = $oR3DCQuery->GetHackedFEN($_SESSION['sid'], $GID);
        //check to see if the move is valid
        if (is_Move_legal($fen, $movestr2)) {
            //if ! promotion screen
            if (!($move_promotion_figur && strlen($movestr2) == 5)) {
                $Move = $txtmovefrom . "," . $txtmoveto;
                $oR3DCQuery->CurrentGameMovePiece($config, $gid, $_SESSION['sid'], $_SESSION['id'], $Move);
                //checkmate
                if (get_GameState() == 1) {
                    if ($w_player_id == $_SESSION['id']) {
                        $oR3DCQuery->UpdateGameStatus($config, $gid, "C", "B");
                        $bmove_error = false;
                    } else {
开发者ID:robertohernando,项目名称:phpchess,代码行数:31,代码来源:t_ctrls.php


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