Beispiel #1
0
 if ($_GET['user'] != "" && $_GET['pass'] != "") {
     $session = base64_decode($xsid);
     list($uniq, $player_id) = preg_split("/\\|/", $session);
     //Instantiate theCR3DCQuery Class
     $oR3DCQuery = new CR3DCQuery($config);
     $bAuth = $oR3DCQuery->CheckLoginCredentialsForMobile($ConfigFile, $_GET['user'], $_GET['pass']);
     $oR3DCQuery->Close();
     unset($oR3DCQuery);
     if ($bAuth) {
         // Instantiate the CAdmin Class
         $oAdmin = new CAdmin($config);
         $oAdmin->DisablePlayer($player_id);
         $oAdmin->Close();
         unset($oAdmin);
         //Instantiate the CChess Class
         $oChess = new CChess($config);
         $sid = $oChess->delete_session($config, $xsid);
         unset($oChess);
         echo "<RESPONSE>\n";
         echo "<CLOSED>true</CLOSED>\n";
         echo "</RESPONSE>\n";
     } else {
         echo "<RESPONSE>\n";
         echo "<ERROR>IDS_INVALID_PASS_OR_USER</ERROR>\n";
         echo "</RESPONSE>\n";
     }
 } else {
     echo "<RESPONSE>\n";
     echo "<ERROR>IDS_INVALID_PARAM_PASSED</ERROR>\n";
     echo "</RESPONSE>\n";
 }
Beispiel #2
0
 function RegisterNewPlayer($Name, $Email)
 {
     $returncode = "";
     //Instantiate the CChess Class
     $oChess = new CChess($this->ChessCFGFileLocation);
     $returncode = $oChess->register($this->ChessCFGFileLocation, $Name, $Email);
     unset($oChess);
     return $returncode;
 }
 function GetActualFEN($sid, $GameID)
 {
     //Instantiate the CChess Class
     $oChess = new CChess($this->ChessCFGFileLocation);
     $returncode = $oChess->request_FEN($this->ChessCFGFileLocation, $GameID);
     unset($oChess);
     $returncode = "0000000000" . $returncode;
     // Format/Decode the FEN
     list($one, $two, $three, $four, $five, $six, $seven, $eight) = explode("/", substr(str_replace(strrchr($returncode, "/"), "", $returncode), 10), 8);
     //Get the rest of the fen string
     list($j1, $j2, $j3, $j4, $j5, $j6, $j7) = explode(" ", $returncode, 7);
     $backfen = trim($j2 . " " . $j3 . " " . $j4 . " " . $j5 . " " . $j6 . " " . $j7);
     //convert the fen
     $one = $this->ConvertFenRow($one);
     $two = $this->ConvertFenRow($two);
     $three = $this->ConvertFenRow($three);
     $four = $this->ConvertFenRow($four);
     $five = $this->ConvertFenRow($five);
     $six = $this->ConvertFenRow($six);
     $seven = $this->ConvertFenRow($seven);
     $eight = $this->ConvertFenRow($eight);
     $returncode = $eight . "/" . $seven . "/" . $six . "/" . $five . "/" . $four . "/" . $three . "/" . $two . "/" . $one . " " . $backfen;
     return $returncode;
 }
<?php

////////////////////////////////////////////////////////////////////////////
//
// (c) phpChess Limited, 2004-2006, in association with Goliath Systems.
// All rights reserved. Please observe respective copyrights.
// phpChess - Chess at its best
// you can find us at http://www.phpchess.com.
//
////////////////////////////////////////////////////////////////////////////
define('CHECK_PHPCHESS', true);
ini_set("output_buffering", "1");
session_start();
require "./bin/CChess.php";
$config = "./bin/config.php";
//Instantiate the CChess Class
$oChess = new CChess($config);
$sid = $oChess->delete_session($config, $_SESSION['sid']);
unset($oChess);
$_SESSION = array();
if (isset($_COOKIE['TestCookie'])) {
    setcookie("TestCookie", '', time() - 360000);
}
session_destroy();
header("Location: ./index.php");