예제 #1
0
function isSessionIDValid($config, $xsid)
{
    $bValid = false;
    //Instantiate the CR3DCQuery Class
    $oR3DCQuery = new CR3DCQuery($config);
    //$oR3DCQuery->CheckSIDTimeout();
    CSession::initialise($config);
    CSession::CheckSIDTimeout();
    if ($xsid != "") {
        //if($oR3DCQuery->CheckLogin($config, $xsid))
        if (CSession::CheckLogin($xsid)) {
            $session = base64_decode($xsid);
            // list($uniq, $player_id) = preg_split("/\|/", $session);
            list($uniq, $player_id) = explode("|", $session);
            if ($uniq != "" && is_numeric($player_id)) {
                $bValid = true;
                //$oR3DCQuery->UpdateSIDTimeout($config, $xsid);
                CSession::UpdateSIDTimeout($xsid);
                $oR3DCQuery->SetPlayerCreditsInit($player_id);
            }
        }
    }
    if ($oR3DCQuery->ELOIsActive()) {
        $oR3DCQuery->ELOCreateRatings();
    }
    $oR3DCQuery->MangeGameTimeOuts();
    $oR3DCQuery->Close();
    unset($oR3DCQuery);
    return $bValid;
}
예제 #2
0
echo $conf['chat_refresh_rate'];
?>
 * 1000, move: <?php 
echo $conf['last_move_check_rate'];
?>
 * 1000, game_over: <?php 
echo $conf['last_move_check_rate'];
?>
 * 2000};
	
	settings['initial_game_state'] = "<?php 
include $Root_Path . "CChess2.php";
include $Root_Path . "CChessBoard.php";
include $Root_Path . "CChessBoardUtilities.php";
include $Root_Path . "CSession.php";
CSession::initialise($config);
ChessHelper::load_chess_game($gid);
$str = "<RESPONSE><PGN>";
$str .= ChessHelper::get_game_pgn();
$str .= "</PGN>\n";
$pieces = ChessHelper::get_captured_pieces();
$str .= "<CAPTURED_BY_WHITE>" . join(', ', $pieces['white']) . "</CAPTURED_BY_WHITE>\n";
$str .= "<CAPTURED_BY_BLACK>" . join(', ', $pieces['black']) . "</CAPTURED_BY_BLACK>\n";
$str .= "<GAME_STATE>";
$str .= ChessHelper::get_game_state();
$str .= "</GAME_STATE>\n";
$str .= "<GAME_RESULT>";
$str .= ChessHelper::get_game_result();
$str .= "</GAME_RESULT>\n";
$str .= "<DRAWCODE>";
$str .= $oR3DCQuery->IsRequestDraw($config, $_GET['gameid'], $player == 'black' ? TRUE : FALSE);