From 9c2f3eb26a810920afaf55e64b9ee032afd106a6 Mon Sep 17 00:00:00 2001 From: Gnieark Date: Wed, 29 Jun 2016 16:56:24 +0200 Subject: [PATCH] try to draw 1000*1000 svg grig --- src/arenas/tron/act.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/arenas/tron/act.php b/src/arenas/tron/act.php index e825e0c..3a7e539 100644 --- a/src/arenas/tron/act.php +++ b/src/arenas/tron/act.php @@ -11,9 +11,35 @@ # -- END LICENSE BLOCK ----------------------------------------- require_once(__DIR__."/functions.php"); + + switch ($_POST['act']){ case "initGame": + //check if bots exists + $bots=get_Bots_Array('tron'); + + $bot1Exists = false; + $bot2Exists = false; + foreach($bots as $bot){ + if($bot['id'] == $_POST['bot1']){ + $_SESSION['bots'][]=new TronPlayer($bot['id']); + $bot1Exists =true; + } + if($bot['id'] == $_POST['bot2']){ + $_SESSION['bots'][]=new TronPlayer($bot['id']); + $bot2Exists =true; + } + if ($bot1Exists && $bot2Exists){ + break; + } + } + if ((!$bot1Exists) OR (!$bot2Exists)){ + error (500,"missing parameter 2"); + } + + echo "plop"; + break; default: