diff --git a/Admin/Templates/config.tpl b/Admin/Templates/config.tpl index ddda844f..c515a3ea 100644 --- a/Admin/Templates/config.tpl +++ b/Admin/Templates/config.tpl @@ -116,6 +116,7 @@ $editIcon = 'Medal Veteran Player 5a ?5 yearsEnabled" : "Disabled"; ?> Medal Veteran Player 10a ?10 yearsEnabled" : "Disabled"; ?> Special Medals?Special MedalsEnabled" : "Disabled"; ?> + Server Milestones?Server MilestonesEnabled" : "Disabled"; ?> diff --git a/Admin/Templates/editNewFunctions.tpl b/Admin/Templates/editNewFunctions.tpl index 226957fe..3f8db2b3 100644 --- a/Admin/Templates/editNewFunctions.tpl +++ b/Admin/Templates/editNewFunctions.tpl @@ -211,6 +211,17 @@ if($_SESSION['access'] < 9) die(ACCESS_DENIED_ADMIN); + + Server Milestones ?Enable (Disable) the "Server Milestones" widget (first player to settle a 2nd village, reach 1000 population, capture an artefact, conquer a WW, conquer a WW building plan, found an alliance, or conquer a village from another player) shown at the top of Statistics » General +
Not present in config.php yet — saving this form once will add it (defaults to False until then). + + + + + diff --git a/Admin/Templates/natars.tpl b/Admin/Templates/natars.tpl index 667b09dd..0424c00d 100644 --- a/Admin/Templates/natars.tpl +++ b/Admin/Templates/natars.tpl @@ -24,7 +24,7 @@ $deletedArtifacts = $database->getDeletedArtifacts(); + + + diff --git a/install/data/constant_format.tpl b/install/data/constant_format.tpl index 281eeacf..65cefc81 100644 --- a/install/data/constant_format.tpl +++ b/install/data/constant_format.tpl @@ -333,6 +333,7 @@ define("NEW_FUNCTIONS_MEDAL_3YEAR", %NEW_FUNCTIONS_MEDAL_3YEAR%); define("NEW_FUNCTIONS_MEDAL_5YEAR", %NEW_FUNCTIONS_MEDAL_5YEAR%); define("NEW_FUNCTIONS_MEDAL_10YEAR", %NEW_FUNCTIONS_MEDAL_10YEAR%); define("NEW_FUNCTIONS_SPECIAL_MEDALS_SYSTEM", %NEW_FUNCTIONS_SPECIAL_MEDALS_SYSTEM%); +define("NEW_FUNCTIONS_MILESTONES", %NEW_FUNCTIONS_MILESTONES%); ////////////////////////////////////////// @@ -392,7 +393,7 @@ $requse = 0; ## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ## ## --------------------------------------------------------------------------- ## ## Filename config.php ## -## Version 4.8.5 ## +## Version 10.0 Full Refactor & Security ## ## Developed by: Dzoki and Dixie Edited by Advocaite ## ## License: TravianZ Project ## ## Copyright: TravianZ (c) 2010-2026. All rights reserved. ## diff --git a/install/process.php b/install/process.php index 3956fc72..6e012d02 100644 --- a/install/process.php +++ b/install/process.php @@ -169,6 +169,7 @@ class Process { $findReplace["%NEW_FUNCTIONS_MEDAL_5YEAR%"] = $_POST['new_functions_medal_5year']; $findReplace["%NEW_FUNCTIONS_MEDAL_10YEAR%"] = $_POST['new_functions_medal_10year']; $findReplace["%NEW_FUNCTIONS_SPECIAL_MEDALS_SYSTEM%"] = $_POST['new_functions_special_medals_system']; + $findReplace["%NEW_FUNCTIONS_MILESTONES%"] = $_POST['new_functions_milestones']; fwrite($gameConfig, str_replace(array_keys($findReplace), array_values($findReplace), $text)); diff --git a/install/templates/config.tpl b/install/templates/config.tpl index e00471dc..816279bf 100644 --- a/install/templates/config.tpl +++ b/install/templates/config.tpl @@ -206,7 +206,8 @@ $mechs = [ 'new_functions_medal_3year' => 'Medal 3y', 'new_functions_medal_5year' => 'Medal 5y', 'new_functions_medal_10year' => 'Medal 10y', - 'new_functions_special_medals_system' => 'Special Medals System' + 'new_functions_special_medals_system' => 'Special Medals System', + 'new_functions_milestones' => 'Server Milestones' ]; foreach($mechs as $k => $l){ diff --git a/var/db/struct.sql b/var/db/struct.sql index becc97c4..bd7cdf1e 100644 --- a/var/db/struct.sql +++ b/var/db/struct.sql @@ -1856,4 +1856,25 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%debug_log` ( -- Dumping data for table `%PREFIX%debug_log` -- INSERT INTO `%PREFIX%debug_log` (`id`, `active`, `lvl_warning`, `lvl_notice`, `lvl_deprecated`, `lvl_fatal`, `max_size_mb`, `auto_off_hours`, `started_by`, `started_at`) VALUES -(1, 0, 1, 1, 1, 1, 5, 6, NULL, NULL); \ No newline at end of file +(1, 0, 1, 1, 1, 1, 5, 6, NULL, NULL); + +-- +-- Table structure for `%PREFIX%milestones` +-- +-- Records server "first player to..." achievements (NEW_FUNCTIONS_MILESTONES). +-- One row per milestone_key, EVER: the UNIQUE KEY makes the very first +-- INSERT for a given key the permanent, race-condition-safe winner — any +-- later attempt to insert the same key is silently ignored by the DB itself. +-- + +CREATE TABLE IF NOT EXISTS `%PREFIX%milestones` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `milestone_key` varchar(50) NOT NULL, + `uid` int(11) NULL, + `vref` int(11) NULL DEFAULT '0', + `extra` varchar(100) NULL DEFAULT '', + `achieved_time` int(11) NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `milestone_key` (`milestone_key`), + KEY `uid` (`uid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; \ No newline at end of file