This commit is contained in:
Gnieark 2016-06-13 13:53:28 +02:00
parent 47267c634f
commit 49d338e564

View File

@ -127,13 +127,14 @@ function better_col($board,$me){
} }
$in=preg_replace('/""/','" "',file_get_contents('php://input')); $in=preg_replace('/""/','" "',file_get_contents('php://input'));
echo $in;
$params=json_decode($in, TRUE); $params=json_decode($in, TRUE);
switch($params['action']){ switch($params['action']){
case "init": case "init":
echo '{"name":"Gnieark"}'; echo '{"name":"Gnieark"}';
break; break;
case "play-turn": case "play-turn":
echo $in;
echo '{"play":"'.better_col($params['board'],$params['you']).'"}'; echo '{"play":"'.better_col($params['board'],$params['you']).'"}';
break; break;
default: default: