From 464df559dc3552ebd63741196d05af9c17375c68 Mon Sep 17 00:00:00 2001 From: Gnieark Date: Tue, 29 Nov 2016 18:33:39 +0100 Subject: [PATCH] back --- countBattles.txt | 2 +- html/index.php | 66 ++--------------------------------- src/DUEL.php | 10 ++++++ src/arenas/tron/Direction.php | 2 +- 4 files changed, 14 insertions(+), 66 deletions(-) diff --git a/countBattles.txt b/countBattles.txt index 645efcf..d081bc1 100755 --- a/countBattles.txt +++ b/countBattles.txt @@ -1 +1 @@ -1865 \ No newline at end of file +1836 \ No newline at end of file diff --git a/html/index.php b/html/index.php index 76fd88f..a5b940b 100755 --- a/html/index.php +++ b/html/index.php @@ -13,11 +13,9 @@ @session_start(); require_once("../src/functions.php"); -//load classes -require_once ("../src/ARENAS.php"); -require_once ("../src/BOTS.php"); - $lnMysql=conn_bdd(); +$arenas=get_arenas_list(); +$lang=get_language_array(); //check type of page //$_GET['arena'] -> an arena @@ -26,66 +24,6 @@ $lnMysql=conn_bdd(); //$_GET['page'] -> a simple page like about page, legals etc... //Nothing -> home page - -if(isset($_GET['arena'])){ - $arenaId = $_GET['arena']; -}elseif(isset($_GET['doc'])){ - $arenaId = $_GET['doc']; -}elseif(isset($_GET['scores'])){ - $arenaId = $_GET['scores']; -}else{ - $arenaId = ""; -} - -//hydrate -require_once ("../src/arenas_lists.php"); -$exists = false; -foreach($arenas as $arena){ - - if($arenaId == "") break; - - if($arena['id'] == $arenaId){ - $currentArena = new ARENA($arenaId); - $currentArena->hydrate($arena); - //add Bots on arena - $rs=mysqli_query($lnMysql, - "SELECT id,name,url,description,ELO - FROM bots - WHERE game='".mysqli_real_escape_string($lnMysql,$currentArena->get_id())."' - AND active='1';" - ); - while($r=mysqli_fetch_array($rs)){ - $bot = new BOT("plop"); - $bot->hydrate($r); - $currentArena->addBot($bot); - } - $exists = true; - break; - } -} -if((!$exists)&& ($arenaId <> ""))error(404,"Page not found ".$arenaId); //l'arene passée en url n'existe pass - - - -if($arenaId == ""){ - echo "accueil"; -}else{ - foreach($currentArena->bots as $bot){ - echo $bot->name."\n"; - } -} - -die(); -//**********************rewriting this file! *************** - -//**********OLD code from here ************************************ - - - - - - - $permitIndex=true; //will be set to false for pages that google or other bot must not index if(isset($_GET['arena'])){ diff --git a/src/DUEL.php b/src/DUEL.php index ca00537..0b158c5 100644 --- a/src/DUEL.php +++ b/src/DUEL.php @@ -31,6 +31,16 @@ class DUEL{ } } + + + + + + + + + + class ELO { public $rank = 1500; //default rank diff --git a/src/arenas/tron/Direction.php b/src/arenas/tron/Direction.php index 8cadfed..69105e2 100755 --- a/src/arenas/tron/Direction.php +++ b/src/arenas/tron/Direction.php @@ -1,6 +1,6 @@