From d9b6eadd1bcc08fc5d0fffb3c311aa185a976c08 Mon Sep 17 00:00:00 2001 From: Martin Ambrus Date: Mon, 9 Oct 2017 19:45:56 +0200 Subject: [PATCH] fix: extra settings correctly keep PLUS and other server settings --- Admin/Templates/editExtraSet.tpl | 2 +- GameEngine/Admin/Mods/editExtraSet.php | 61 ++++++++++++-------------- 2 files changed, 29 insertions(+), 34 deletions(-) diff --git a/Admin/Templates/editExtraSet.tpl b/Admin/Templates/editExtraSet.tpl index a12d1b05..664c374c 100644 --- a/Admin/Templates/editExtraSet.tpl +++ b/Admin/Templates/editExtraSet.tpl @@ -14,7 +14,7 @@ if (!isset($_SESSION)) { if($_SESSION['access'] < 9) die(ACCESS_DENIED_ADMIN); ?>

Server Configuration

-
+
diff --git a/GameEngine/Admin/Mods/editExtraSet.php b/GameEngine/Admin/Mods/editExtraSet.php index 1b50ee13..0572c460 100755 --- a/GameEngine/Admin/Mods/editExtraSet.php +++ b/GameEngine/Admin/Mods/editExtraSet.php @@ -35,14 +35,11 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $LOG_WAR=(LOG_WAR==false)? "false":"true"; $LOG_MARKET=(LOG_MARKET==false)? "false":"true"; $LOG_ILLEGAL=(LOG_ILLEGAL==false)? "false":"true"; - $NEWSBOX1=(NEWSBOX1==false)? "false":"true"; - $NEWSBOX2=(NEWSBOX2==false)? "false":"true"; - $NEWSBOX3=(NEWSBOX3==false)? "false":"true"; $INCLUDE_ADMIN=(INCLUDE_ADMIN==false)? "false":"true"; $text = file_get_contents("constant_format.tpl"); - $text = preg_replace("'%ERRORREPORT%'", $ERRORREPORT, $text); - $text = preg_replace("'%ERROR%'", $ERRORREPORT, $text); + $text = preg_replace("'%ERRORREPORT%'", ERROR_REPORT, $text); + $text = preg_replace("'%ERROR%'", ERROR_REPORT, $text); $text = preg_replace("'%SERVERNAME%'", SERVER_NAME, $text); $text = preg_replace("'%STIMEZONE%'", TIMEZONE, $text); $text = preg_replace("'%STARTTIME%'", COMMENCE, $text); @@ -51,8 +48,8 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%LANG%'", LANG, $text); $text = preg_replace("'%SPEED%'", SPEED, $text); $text = preg_replace("'%MAX%'", WORLD_MAX, $text); - $text = preg_replace("'%GP%'", $GP_ENABLE, $text); - $text = preg_replace("'%GP_LOCATE%'", "gpack/travian_default/", $text); + $text = preg_replace("'%GP%'", GP_ENABLE, $text); + $text = preg_replace("'%GP_LOCATE%'", GP_LOCATE, $text); $text = preg_replace("'%INCSPEED%'", INCREASE_SPEED, $text); $text = preg_replace("'%EVASIONSPEED%'", EVASION_SPEED, $text); $text = preg_replace("'%TRADERCAP%'", TRADER_CAPACITY, $text); @@ -60,47 +57,45 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%TRAPPERCAP%'", TRAPPER_CAPACITY, $text); $text = preg_replace("'%VILLAGE_EXPAND%'", CP, $text); $text = preg_replace("'%DEMOLISH%'", DEMOLISH_LEVEL_REQ, $text); - $text = preg_replace("'%STORAGE_MULTIPLIER%'", STORAGE_MULTIPLIER, $text); - $text = preg_replace("'%QUEST%'", $QUEST, $text); + $text = preg_replace("'%STORAGE_MULTIPLIER%'", STORAGE_MULTIPLIER, $text); + $text = preg_replace("'%QUEST%'", QUEST, $text); $text = preg_replace("'%QTYPE%'", QTYPE, $text); $text = preg_replace("'%BEGINNER%'", PROTECTION, $text); - $text = preg_replace("'%WW%'", $WW, $text); - $text = preg_replace("'%SHOW_NATARS%'", $SHOW_NATARS, $text); + $text = preg_replace("'%WW%'", (WW ? 'true' : 'false'), $text); + $text = preg_replace("'%SHOW_NATARS%'", (SHOW_NATARS ? 'true' : 'false'), $text); $text = preg_replace("'%NATARS_UNITS%'", NATARS_UNITS, $text); $text = preg_replace("'%NATURE_REGTIME%'", NATURE_REGTIME, $text); - $text = preg_replace("'%T4_COMING%'", $T4, $text); - $text = preg_replace("'%ACTIVATE%'", $AUTH_EMAIL, $text); - $text = preg_replace("'%PLUS_TIME%'", PLUS_TIME, $text); - $text = preg_replace("'%PLUS_PRODUCTION%'", PLUS_PRODUCTION, $text); + $text = preg_replace("'%T4_COMING%'", (T4_COMING ? 'true' : 'false'), $text); + $text = preg_replace("'%ACTIVATE%'", (AUTH_EMAIL ? 'true' : 'false'), $text); $text = preg_replace("'%MEDALINTERVAL%'", MEDALINTERVAL, $text); - $text = preg_replace("'%GREAT_WKS%'", $GREAT_WKS, $text); + $text = preg_replace("'%GREAT_WKS%'", (GREAT_WKS ? 'true' : 'false'), $text); $text = preg_replace("'%TS_THRESHOLD%'", TS_THRESHOLD, $text); - $text = preg_replace("'%REG_OPEN%'", $REG_OPEN, $text); + $text = preg_replace("'%REG_OPEN%'", REG_OPEN, $text); $text = preg_replace("'%PEACE%'", PEACE, $text); - $text = preg_replace("'%LOGBUILD%'", $LOG_BUILD, $text); - $text = preg_replace("'%LOGTECH%'", $LOG_TECH, $text); - $text = preg_replace("'%LOGLOGIN%'", $LOG_LOGIN, $text); - $text = preg_replace("'%LOGGOLDFIN%'", $LOG_GOLD_FIN, $text); - $text = preg_replace("'%LOGADMIN%'", $LOG_ADMIN, $text); - $text = preg_replace("'%LOGWAR%'", $LOG_WAR, $text); - $text = preg_replace("'%LOGMARKET%'", $LOG_MARKET, $text); - $text = preg_replace("'%LOGILLEGAL%'", $LOG_ILLEGAL, $text); - $text = preg_replace("'%BOX1%'", $NEWSBOX1, $text); - $text = preg_replace("'%BOX2%'", $NEWSBOX2, $text); - $text = preg_replace("'%BOX3%'", $NEWSBOX3, $text); + $text = preg_replace("'%LOGBUILD%'", (LOG_BUILD ? 'true' : 'false'), $text); + $text = preg_replace("'%LOGTECH%'", (LOG_TECH ? 'true' : 'false'), $text); + $text = preg_replace("'%LOGLOGIN%'", (LOG_LOGIN ? 'true' : 'false'), $text); + $text = preg_replace("'%LOGGOLDFIN%'", (LOG_GOLD_FIN ? 'true' : 'false'), $text); + $text = preg_replace("'%LOGADMIN%'", (LOG_ADMIN ? 'true' : 'false'), $text); + $text = preg_replace("'%LOGWAR%'", (LOG_WAR ? 'true' : 'false'), $text); + $text = preg_replace("'%LOGMARKET%'", (LOG_MARKET ? 'true' : 'false'), $text); + $text = preg_replace("'%LOGILLEGAL%'", (LOG_ILLEGAL ? 'true' : 'false'), $text); + $text = preg_replace("'%BOX1%'", (NEWSBOX1 ? 'true' : 'false'), $text); + $text = preg_replace("'%BOX2%'", (NEWSBOX2 ? 'true' : 'false'), $text); + $text = preg_replace("'%BOX3%'", (NEWSBOX3 ? 'true' : 'false'), $text); $text = preg_replace("'%SSERVER%'", SQL_SERVER, $text); $text = preg_replace("'%SUSER%'", SQL_USER, $text); $text = preg_replace("'%SPASS%'", SQL_PASS, $text); $text = preg_replace("'%SDB%'", SQL_DB, $text); $text = preg_replace("'%PREFIX%'", TB_PREFIX, $text); - $text = preg_replace("'%CONNECTT%'", DB_TYPE, $text); + $text = preg_replace("'%CONNECTT%'", DB_TYPE, $text); $text = preg_replace("'%LIMIT_MAILBOX%'", $_POST['limit_mailbox'], $text); - $text = preg_replace("'%MAX_MAILS%'", 30, $text); - $text = preg_replace("'%ARANK%'", $INCLUDE_ADMIN, $text); + $text = preg_replace("'%MAX_MAILS%'", MAX_MAIL, $text); + $text = preg_replace("'%ARANK%'", (INCLUDE_ADMIN ? 'true' : 'false'), $text); $text = preg_replace("'%AEMAIL%'", ADMIN_EMAIL, $text); $text = preg_replace("'%ANAME%'", ADMIN_NAME, $text); - $text = preg_replace("'%UTRACK%'", "", $text); - $text = preg_replace("'%UTOUT%'", "", $text); + $text = preg_replace("'%UTRACK%'", "TRACK_USR", $text); // not in use, text only in a comment + $text = preg_replace("'%UTOUT%'", "USER_TIMEOUT", $text); // not in use, text only in a comment $text = preg_replace("'%DOMAIN%'", DOMAIN, $text); $text = preg_replace("'%HOMEPAGE%'", HOMEPAGE, $text); $text = preg_replace("'%SERVER%'", SERVER, $text);