mysql powa

pull/13/head
Gnieark 9 years ago
parent f3b3a24d3f
commit 2935c21349

@ -4,7 +4,7 @@ require_once(__DIR__."/functions.php");
switch ($_POST['act']){
case "fight":
$bots=get_Bots_Array();
$bots=get_Bots_Array('tictactoe');
//clean $_POST vars
$postParams=get_Post_Params(count($bots));
if(!$postParams){

@ -16,6 +16,7 @@ function get_Post_Params($botsCount){
return array('bot1' => $_POST['bot1'],'bot2' => $_POST['bot2']);
}
/*
function get_Bots_Array(){
//Recupérer la liste des Bots
$bots=array();
@ -29,6 +30,7 @@ function get_Bots_Array(){
}
return $bots;
}
*/
function get_IA_Response($youChar,$iaBaseUrl,$grille){
/*transforme la grille en parametres http GET
* et fait la requete vers $iaBaseUrl

@ -1,3 +0,0 @@
stupidAI http://morpionmaster.tinad.fr/stupidIa.php
moul http://tictactoe.m.42.am/
Gnieark http://morpionmaster.tinad.fr/gnieark.php

@ -1,7 +1,7 @@
<?php
require_once(__DIR__."/functions.php");
$bots=get_Bots_Array();
$bots=get_Bots_Array('tictactoe');
$postParams=get_Post_Params(count($bots));
if(!$postParams){
$bot1="";

@ -3,6 +3,29 @@ function get_arenas_list(){
include (__DIR__."/arenas_lists.php");
return $arenas;
}
function(get_Bots_Array($arena,$activeOnly=true){
global $lnMysql;
//$bots[]=array("name" => $name, "url" =>$url);
if($activeOnly){
$addClause=" AND active='1'";
}else{
$addClause="";
}
$rs=mysqli_query($lnMysql,
"SELECT id,name,url,description FROM bots WHERE game='".mysqli_real_escape_string($lnMysql,$arena)."'".$addClause);
$bots=array();
while($r=mysqli_fetch_row($rs)){
$bots[]=array(
'id' => $r[0],
'name'=> $r[1],
'url' => $r[2],
'description' => $r[3]
)
}
return $bots;
}
function rand_str($length = 32, $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890'){
$chars_length = (strlen($chars) - 1);
@ -14,6 +37,7 @@ function rand_str($length = 32, $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijkl
}
return $string;
}
function xd_check_input($id=1){
/*
*On génére un hash aléatoire qui sera

Loading…
Cancel
Save