I am sorry guys, but I didn't get it done. :o I had to work alot this week and didn't have much time for coding..
-> all db-stuff works over secrets.php
-> domain via db, so client_cfg.php is dynamic now!!
-> tidied up 80-90% of the basic-code
-> broke down the req.php to 4 files
-> basic new requesthandler to avoid to let apache parse over 9000 LOC on every request!!
-> faster db-design user_data to 4 tables
-> system for autocleanup!!
-> some Acp-Stuff
But I give you some codesamples to see what I am working on and why it takes more time.
PHP Code:
<?php
ini_set('display_errors', '0'); # don't show any errors...
error_reporting(E_ALL | E_STRICT); # ...but do log them
require_once "adminui/backend/secrets.php";
require_once "gamefuncs.php";
require_once "gameconts.php";
require_once "gameclass.php";
// TODO: GET RID OF THIS
include "dtoverride.php";
include "settings.php";
/////////////////////////
try
{
$db = new PDO ( 'mysql:host=' . $mysql_host . ';dbname=' . $mysql_db . ';charset=' . $mysql_char . '', '' . $mysql_user . '', '' . $mysql_pass . '');
}
catch(Exception $e)
{
exit();
}
PHP Code:
switch ($action)
{
case $ACT_REGISTER :
require_once "acts/ACT_REGISTER.php";
break;
case $ACT_LOGIN_FOLLOW_UP :
require_once "acts/ACT_LOGIN_FOLLOW_UP.php";
break;
case $ACT_LOGIN :
require_once "acts/ACT_LOGIN.php";
break;
case $ACT_LOGOUT :
require_once "acts/ACT_LOGOUT.php";
break;
case $ACT_HERO :
require_once "acts/ACT_HERO.php";
break;
case $ACT_ARENA_ENTER :
require_once "acts/ACT_ARENA_ENTER.php";
break;
case $ACT_ARENA :
require_once "acts/ACT_ARENA.php";
break;
case $ACT_BUY_STAT :
require_once "acts/ACT_BUY_STAT.php";
break;
case $ACT_RANKING :
require_once "acts/ACT_RANKING.php";
break;
case $ACT_SCREEN_PILZDEALER :
require_once "acts/ACT_SCREEN_PILZDEALER.php";
break;
PHP Code:
<?php
include 'dtoverride.php';
dbc();
// Base-URL -> domain
$sql = "SELECT value FROM game_settings WHERE setting = 'SYS_BASEURL' LIMIT 1";
$qry = mysql_query($sql);
$arr = mysql_fetch_array($qry);
$url = $arr["value"];
$domain = explode("//", $url);
$dmn = $domain[1];
print "1 de\n";
print "2 http://img.playa-games.com/res/sfgame/\n";
print "3 http://img.playa-games.com/res/sfgame/\n";
print "7 " . $dmn . "\n";
print "8 http://" . $dmn . "/\n";
print "9 0\n";
print "10 http://www.elitepvpers.com\n";
print "11 http://" . $dmn . "/support.php\n";
print "12 http://www.gamepsf.de/\n";
print "13 http://" . $dmn . "/rules.html\n";
print "14 http://" . $dmn . "/shop.php\n";
print "17 3\n";
print "18 " . $dmn . "\n";
print "21 3\n";
print "23 1\n";
print "25 http://" . $dmn . "/req.php?req=%1&random=%2\n";
print "29 support@" . $dmn . "\n";
print "30 http://" . $dmn . "/papaya44.swf\n";
print "31 http://" . $dmn . "/papaya_cfg.php\n";
print "32 1\n";
print "34 2\n";
print "35 http://" . $dmn . "/spenden.php\n";
print "36 gamestaff@" . $dmn . "\n";
print "42 1\n";
print "43 1337\n";
print "48 http://" . $dmn . "/res/sfgame_low/\n";
print "46 de/ar/cs/da/en/es/fr/el/hu/it/ja/nl/pl/pt/pt-br/ru/sv/tr\n";
print "47 german/arabic/czech/danish/english/spanish/french/greek/hungarian/italian/japanese/dutch/polish/portuguese/brazilian portuguese/russian/swedish/turkish\n";
print "26 166;;http://" . $dmn . "/cid/cid.php?cid=%cid%&action=166&playerid=%playerid%&mushbought=%mushbought%&bid=<bid>&token=<token>&serverid=3&gameid=1\n";
print "26 1;;http://" . $dmn . "/cid/cid.php?cid=%cid%&action=1&playerid=%playerid%&mushbought=%mushbought%&bid=<bid>&token=<token>&serverid=3&gameid=1\n";
print "//26 188;;http://" . $dmn . "/cid/cid.php?cid=%cid%&action=188&playerid=%playerid%&mushbought=%mushbought%&bid=<bid>&token=<token>&serverid=3&gameid=1\n";
?>
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
I will release it, when it's done.. Today I have some hours to work on it. :)