This commit is contained in:
Gnieark 2016-06-02 17:21:14 +02:00
parent 3472aaa882
commit f954e723d6

View File

@ -84,6 +84,7 @@ function playingAT(cellKey){
} }
//does he win? //does he win?
//To Do //To Do
@ -124,8 +125,15 @@ function play(player){
addLog('his awnser is: ' + xhr.responseTEXT); addLog('his awnser is: ' + xhr.responseTEXT);
var reponse = eval(xhr.responseTEXT); var reponse = eval(xhr.responseTEXT);
var cellTarget= reponse['play'];
//test format of response //test format of response
var reg = '/^[0-2]\-[0-2]$/';
if (!reg.test(cellTarget)){
addLog('player ' + p + ' a fait une réponse non conforme: ' + xhr.responseTEXT);
return;
}
playingAT(cellTarget);
}else{ }else{
addLog('player ' + p + ' n est pas joignable ' + xhr.status); addLog('player ' + p + ' n est pas joignable ' + xhr.status);