diff --git a/README b/README index d7095c8a..5b0f6cac 100644 --- a/README +++ b/README @@ -48,6 +48,7 @@ martinambrus changes: 36. fixed OK message in Admin when resetting All Players' PLUS 37. new config option to show Support messages in Admin's mailbox 38. new feature: allowing messages to be sent as Support from in-game when user is Admin + it's allowed in config +39. not allowing installation if old data are still in database to prevent multiple worlds generation and game misbehavior Shadowss changes: diff --git a/install/include/oasis.php b/install/include/oasis.php index 32e01f0c..da3048b0 100644 --- a/install/include/oasis.php +++ b/install/include/oasis.php @@ -9,10 +9,13 @@ include ("../../GameEngine/Database.php"); include ("../../GameEngine/Admin/database.php"); - - $conn = mysqli_connect(SQL_SERVER, SQL_USER, SQL_PASS); - mysqli_select_db($conn, SQL_DB); - + // check if we don't already have world data + $data_exist = $database->query_return("SELECT * FROM " . TB_PREFIX . "odata LIMIT 1"); + if (count($data_exist)) { + header("Location: ../index.php?s=6&err=1"); + exit; + } + $database->populateOasisdata(); $database->populateOasis(); $database->populateOasisUnits2(); diff --git a/install/include/wdata.php b/install/include/wdata.php index 628aa56c..76f2c137 100644 --- a/install/include/wdata.php +++ b/install/include/wdata.php @@ -12,6 +12,12 @@ include("database.php"); +// check if we don't already have world data +$data_exist = $database->query_return("SELECT * FROM " . TB_PREFIX . "wdata LIMIT 1"); +if (count($data_exist)) { + header("Location: ../index.php?s=3&err=1"); + exit; +} $xyas=(1+(2*WORLD_MAX)); diff --git a/install/templates/field.tpl b/install/templates/field.tpl index 812b2000..99e478f9 100644 --- a/install/templates/field.tpl +++ b/install/templates/field.tpl @@ -16,7 +16,11 @@ ################################################################################# if(isset($_GET['c']) && $_GET['c'] == 1) { -echo "