check game ID on AJAX communications
This commit is contained in:
parent
ab4cd8eb3a
commit
92db3755c5
|
@ -67,10 +67,13 @@ switch ($_POST['act']){
|
|||
|
||||
case "fight":
|
||||
|
||||
if(($_SESSION['game'] <> "connectFou") || ((!$new) && ($_POST['gameId'] <> $_SESSION['matchId']))){
|
||||
error(500,"game non found");
|
||||
if($_SESSION['game'] <> "connectFou"){
|
||||
error(500,"game non found");
|
||||
die;
|
||||
}
|
||||
if((!$new) && ($_POST['gameId'] <> $_SESSION['matchId'])){
|
||||
error (512, "not correct gameId");
|
||||
}
|
||||
|
||||
|
||||
//What player has to play?
|
||||
if(!isset($_SESSION['currentPlayer'])){
|
||||
|
|
|
@ -80,6 +80,9 @@ function connectFour(bot1,bot2,xd_check, gameId, newGame){
|
|||
if(reponse['continue'] == 1){
|
||||
connectFour(bot1,bot2,xd_check,reponse['gameId'], false);
|
||||
}
|
||||
}else if(xhr.status == 512){
|
||||
//just forget
|
||||
return;
|
||||
}else{
|
||||
alert ('error ' + xhr.status);
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue
Block a user