.
This commit is contained in:
parent
3472aaa882
commit
f954e723d6
|
@ -86,6 +86,7 @@ function playingAT(cellKey){
|
|||
//does he win?
|
||||
|
||||
|
||||
|
||||
//To Do
|
||||
|
||||
//change player
|
||||
|
@ -124,8 +125,15 @@ function play(player){
|
|||
addLog('his awnser is: ' + xhr.responseTEXT);
|
||||
|
||||
var reponse = eval(xhr.responseTEXT);
|
||||
//test format of response
|
||||
var cellTarget= reponse['play'];
|
||||
|
||||
//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{
|
||||
addLog('player ' + p + ' n est pas joignable ' + xhr.status);
|
||||
|
|
Loading…
Reference in New Issue
Block a user