limit time awnser close #97
This commit is contained in:
parent
bdee84f9ab
commit
dc2069f303
14
README.md
14
README.md
|
@ -19,6 +19,20 @@ I'd better like you to help me to improve [bot's Arena](https://botsarena.tinad.
|
||||||
* Apache/tomcat document root starts at ./html
|
* Apache/tomcat document root starts at ./html
|
||||||
* copy src/config.php.empty to src/config.php
|
* copy src/config.php.empty to src/config.php
|
||||||
|
|
||||||
|
Apache RewriteRules are given on the file html/.htaccess
|
||||||
|
|
||||||
|
For nginx in server directive:
|
||||||
|
|
||||||
|
rewrite '^/([a-zA-Z]{1,})/doc-([a-z]{2})$' /index.php?doc=$1&lang=$2 last;
|
||||||
|
rewrite '^/p/([a-zA-Z]{1,})/(.*)-([a-z]{2})$' /index.php?page=$1¶ms=$2&lang=$3 last;
|
||||||
|
rewrite '^/p/([a-zA-Z]{1,})/(.*)$' /index.php?page=$1¶ms=$2 last;
|
||||||
|
rewrite '^/p/(.*)-([a-z]{2})$' /index.php?page=$1&lang=$2 last;
|
||||||
|
rewrite '^/p/(.*)$' index.php?page=$1 last;
|
||||||
|
rewrite '^/([a-zA-Z]{1,})/scores$' /index.php?scores=$1 last;
|
||||||
|
rewrite '^/([a-zA-Z]{1,})-([a-z]{2})$' /index.php?arena=$1&lang=$2 last;
|
||||||
|
rewrite '^/([a-zA-Z]{1,})/doc$' /index.php?doc=$1 last;
|
||||||
|
rewrite '^/([a-zA-Z]{1,})$' /index.php?arena=$1 last;
|
||||||
|
|
||||||
# License
|
# License
|
||||||
Bot's Arena , Website for Artificials intelligences duels.
|
Bot's Arena , Website for Artificials intelligences duels.
|
||||||
|
|
||||||
|
|
15
html/nging-rewrite.txt
Normal file
15
html/nging-rewrite.txt
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
RewriteEngine On
|
||||||
|
RewriteBase /
|
||||||
|
RewriteRule ^p/([a-zA-Z]{1,})/(.*)-([a-z]{2})$ index\.php?page=$1¶ms=$2&lang=$3 [L]
|
||||||
|
RewriteRule ^p/([a-zA-Z]{1,})/(.*)$ index\.php?page=$1¶ms=$2 [L]
|
||||||
|
RewriteRule ^p/(.*)-([a-z]{2})$ index\.php?page=$1&lang=$2 [L]
|
||||||
|
RewriteRule ^p/(.*)$ index\.php?page=$1 [L]
|
||||||
|
RewriteRule ^([a-zA-Z]{1,})/doc-([a-z]{2})$ index\.php?doc=$1&lang=$2 [L]
|
||||||
|
RewriteRule ^([a-zA-Z]{1,})/doc$ index\.php?doc=$1 [L]
|
||||||
|
RewriteRule ^([a-zA-Z]{1,})/scores$ index\.php?scores=$1 [L]
|
||||||
|
RewriteRule ^([a-zA-Z]{1,})-([a-z]{2})$ index\.php?arena=$1&lang=$2 [L]
|
||||||
|
RewriteRule ^([a-zA-Z]{1,})$ index\.php?arena=$1 [L]
|
||||||
|
RewriteRule ^-([a-z]{2})$ index\.php?lang=$1 [L]
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
|
RewriteRule ^index.php$ index.php/ [L]
|
|
@ -106,6 +106,7 @@ class TronGame
|
||||||
curl_setopt($ch[$i], CURLOPT_SSL_VERIFYPEER, false);
|
curl_setopt($ch[$i], CURLOPT_SSL_VERIFYPEER, false);
|
||||||
curl_setopt($ch[$i], CURLOPT_POSTFIELDS, $data_string);
|
curl_setopt($ch[$i], CURLOPT_POSTFIELDS, $data_string);
|
||||||
curl_setopt($ch[$i], CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch[$i], CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($ch[$i], CURLOPT_CONNECTTIMEOUT, 10);
|
||||||
curl_setopt($ch[$i], CURLOPT_HTTPHEADER, array(
|
curl_setopt($ch[$i], CURLOPT_HTTPHEADER, array(
|
||||||
'Content-Type: application/json',
|
'Content-Type: application/json',
|
||||||
'Content-Length: ' . strlen($data_string))
|
'Content-Length: ' . strlen($data_string))
|
||||||
|
|
|
@ -271,6 +271,7 @@ function save_battle($game,$bot1,$bot2,$result,$nameOrIds = 'name'){
|
||||||
'1')
|
'1')
|
||||||
ON DUPLICATE KEY UPDATE ".$field." = ".$field." + 1;
|
ON DUPLICATE KEY UPDATE ".$field." = ".$field." + 1;
|
||||||
");
|
");
|
||||||
|
|
||||||
}
|
}
|
||||||
function get_unique_id(){
|
function get_unique_id(){
|
||||||
//increment the number
|
//increment the number
|
||||||
|
@ -345,6 +346,7 @@ function get_IA_Response($iaUrl,$postParams){
|
||||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
||||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
||||||
'Content-Type: application/json',
|
'Content-Type: application/json',
|
||||||
'Content-Length: ' . strlen($data_string))
|
'Content-Length: ' . strlen($data_string))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user