From 6388a96fa9a60a05c98dfad0cf32f35c48436ed4 Mon Sep 17 00:00:00 2001 From: WarrentyExpired Date: Mon, 21 Sep 2026 09:00:23 -0400 Subject: [PATCH] #W# Change: [Go menu now uses 1 file Data/go.json. It also excepts a 'map' destination. --- .gitignore | 1 + .../Configuration/FeatureFlags/flags.json | 128 ++++++++++++++++++ .../FeatureFlags/gump-blocks.json | 1 + .../FeatureFlags/item-blocks.json | 1 + .../FeatureFlags/skill-blocks.json | 1 + .../FeatureFlags/spell-blocks.json | 1 + Distribution/Configuration/antimacro.json | 66 +++++++++ Distribution/Configuration/assistants.json | 33 +++++ Distribution/Configuration/auto-denylist.json | 5 + Distribution/Configuration/bans.json | 6 + Distribution/Configuration/blocklist.json | 8 ++ Distribution/Configuration/crowdsec.json | 9 ++ .../Configuration/email-settings.json | 15 ++ Distribution/Configuration/expansion.json | 79 +++++++++++ Distribution/Configuration/firewall.json | 3 + Distribution/Configuration/ip-allowlist.json | 7 + .../Configuration/login-allowlist.json | 8 ++ Distribution/Configuration/modernuo.json | 107 +++++++++++++++ Distribution/Configuration/throttles.json | 6 + Distribution/Data/go.json | 11 ++ Projects/UOContent/Gumps/Go/GoGump.cs | 17 ++- Projects/UOContent/Gumps/Go/GoLocation.cs | 4 +- Projects/UOContent/Gumps/Go/GoLocations.cs | 40 +----- 23 files changed, 519 insertions(+), 38 deletions(-) create mode 100644 Distribution/Configuration/FeatureFlags/flags.json create mode 100644 Distribution/Configuration/FeatureFlags/gump-blocks.json create mode 100644 Distribution/Configuration/FeatureFlags/item-blocks.json create mode 100644 Distribution/Configuration/FeatureFlags/skill-blocks.json create mode 100644 Distribution/Configuration/FeatureFlags/spell-blocks.json create mode 100644 Distribution/Configuration/antimacro.json create mode 100644 Distribution/Configuration/assistants.json create mode 100644 Distribution/Configuration/auto-denylist.json create mode 100644 Distribution/Configuration/bans.json create mode 100644 Distribution/Configuration/blocklist.json create mode 100644 Distribution/Configuration/crowdsec.json create mode 100644 Distribution/Configuration/email-settings.json create mode 100644 Distribution/Configuration/expansion.json create mode 100644 Distribution/Configuration/firewall.json create mode 100644 Distribution/Configuration/ip-allowlist.json create mode 100644 Distribution/Configuration/login-allowlist.json create mode 100644 Distribution/Configuration/modernuo.json create mode 100644 Distribution/Configuration/throttles.json create mode 100644 Distribution/Data/go.json diff --git a/.gitignore b/.gitignore index 7552738be..fc0de7f7d 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ /Distribution/Backups /Distribution/Saves /Distribution/docs +/Distribution/Client /docs/ /Distribution/temp /Distribution/*.dylib diff --git a/Distribution/Configuration/FeatureFlags/flags.json b/Distribution/Configuration/FeatureFlags/flags.json new file mode 100644 index 000000000..08bf9ab8e --- /dev/null +++ b/Distribution/Configuration/FeatureFlags/flags.json @@ -0,0 +1,128 @@ +[ + { + "Key": "player_trading", + "Description": "Allow secure trades between players", + "Enabled": true, + "DefaultEnabled": true, + "Category": "Economy", + "LastModified": "2026-09-21T12:58:21.3413169Z", + "LastModifiedBy": "System" + }, + { + "Key": "pvp_combat", + "Description": "Allow player vs player combat", + "Enabled": true, + "DefaultEnabled": true, + "Category": "Combat", + "LastModified": "2026-09-21T12:58:21.3413169Z", + "LastModifiedBy": "System" + }, + { + "Key": "bank_access", + "Description": "Allow players to access their bank boxes", + "Enabled": true, + "DefaultEnabled": true, + "Category": "Economy", + "LastModified": "2026-09-21T12:58:21.3413169Z", + "LastModifiedBy": "System" + }, + { + "Key": "speedhack_detection", + "Description": "Enable speedhack detection", + "Enabled": false, + "DefaultEnabled": false, + "Category": "System", + "LastModified": "2026-09-21T12:58:21.3413169Z", + "LastModifiedBy": "System" + }, + { + "Key": "insurance", + "Description": "Enable item insurance", + "Enabled": false, + "DefaultEnabled": false, + "Category": "Economy", + "LastModified": "2026-09-21T12:58:21.3413169Z", + "LastModifiedBy": "System" + }, + { + "Key": "vendor_purchase", + "Description": "Allow purchasing from NPC vendors", + "Enabled": true, + "DefaultEnabled": true, + "Category": "Economy", + "LastModified": "2026-09-21T12:58:21.3413169Z", + "LastModifiedBy": "System" + }, + { + "Key": "vendor_sell", + "Description": "Allow selling to NPC vendors", + "Enabled": true, + "DefaultEnabled": true, + "Category": "Economy", + "LastModified": "2026-09-21T12:58:21.3413169Z", + "LastModifiedBy": "System" + }, + { + "Key": "player_vendors", + "Description": "Allow player vendor interactions", + "Enabled": true, + "DefaultEnabled": true, + "Category": "Economy", + "LastModified": "2026-09-21T12:58:21.3413169Z", + "LastModifiedBy": "System" + }, + { + "Key": "house_placement", + "Description": "Allow new house placements", + "Enabled": true, + "DefaultEnabled": true, + "Category": "Housing", + "LastModified": "2026-09-21T12:58:21.3413169Z", + "LastModifiedBy": "System" + }, + { + "Key": "boat_placement", + "Description": "Allow new boat placements", + "Enabled": true, + "DefaultEnabled": true, + "Category": "Housing", + "LastModified": "2026-09-21T12:58:21.3413169Z", + "LastModifiedBy": "System" + }, + { + "Key": "bulk_orders", + "Description": "Allow bulk order deeds", + "Enabled": true, + "DefaultEnabled": true, + "Category": "Crafting", + "LastModified": "2026-09-21T12:58:21.3413169Z", + "LastModifiedBy": "System" + }, + { + "Key": "passive_detect_hidden", + "Description": "Enable passive detect hidden", + "Enabled": true, + "DefaultEnabled": true, + "Category": "System", + "LastModified": "2026-09-21T12:58:21.3413169Z", + "LastModifiedBy": "System" + }, + { + "Key": "young_player_system", + "Description": "Enable the young player system", + "Enabled": true, + "DefaultEnabled": true, + "Category": "System", + "LastModified": "2026-09-21T12:58:21.3413169Z", + "LastModifiedBy": "System" + }, + { + "Key": "bitmap_pathfinding_cache", + "Description": "Enable the bitmap pathfinding cache", + "Enabled": true, + "DefaultEnabled": true, + "Category": "Performance", + "LastModified": "2026-09-21T12:58:21.3413169Z", + "LastModifiedBy": "System" + } +] \ No newline at end of file diff --git a/Distribution/Configuration/FeatureFlags/gump-blocks.json b/Distribution/Configuration/FeatureFlags/gump-blocks.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/Distribution/Configuration/FeatureFlags/gump-blocks.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/Distribution/Configuration/FeatureFlags/item-blocks.json b/Distribution/Configuration/FeatureFlags/item-blocks.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/Distribution/Configuration/FeatureFlags/item-blocks.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/Distribution/Configuration/FeatureFlags/skill-blocks.json b/Distribution/Configuration/FeatureFlags/skill-blocks.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/Distribution/Configuration/FeatureFlags/skill-blocks.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/Distribution/Configuration/FeatureFlags/spell-blocks.json b/Distribution/Configuration/FeatureFlags/spell-blocks.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/Distribution/Configuration/FeatureFlags/spell-blocks.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/Distribution/Configuration/antimacro.json b/Distribution/Configuration/antimacro.json new file mode 100644 index 000000000..082137204 --- /dev/null +++ b/Distribution/Configuration/antimacro.json @@ -0,0 +1,66 @@ +{ + "Allowance": 3, + "LocationSize": 5, + "Enabled": false, + "Expire": "00:05:00", + "SkillsThatUseAntiMacro": { + "Alchemy": false, + "Anatomy": true, + "AnimalLore": true, + "ItemID": true, + "ArmsLore": true, + "Parry": false, + "Begging": true, + "Blacksmith": false, + "Fletching": false, + "Peacemaking": true, + "Camping": true, + "Carpentry": false, + "Cartography": false, + "Cooking": false, + "DetectHidden": true, + "Discordance": true, + "EvalInt": true, + "Healing": true, + "Fishing": true, + "Forensics": true, + "Herding": true, + "Hiding": true, + "Provocation": true, + "Inscribe": false, + "Lockpicking": true, + "Magery": true, + "MagicResist": true, + "Tactics": false, + "Snooping": true, + "Musicianship": true, + "Poisoning": true, + "Archery": false, + "SpiritSpeak": true, + "Stealing": true, + "Tailoring": false, + "AnimalTaming": true, + "TasteID": true, + "Tinkering": false, + "Tracking": true, + "Veterinary": true, + "Swords": false, + "Macing": false, + "Fencing": false, + "Wrestling": false, + "Lumberjacking": true, + "Mining": true, + "Meditation": true, + "Stealth": true, + "RemoveTrap": true, + "Necromancy": true, + "Focus": false, + "Chivalry": true, + "Bushido": true, + "Ninjitsu": true, + "Spellweaving": true, + "Mysticism": true, + "Imbuing": true, + "Throwing": false + } +} \ No newline at end of file diff --git a/Distribution/Configuration/assistants.json b/Distribution/Configuration/assistants.json new file mode 100644 index 000000000..689864309 --- /dev/null +++ b/Distribution/Configuration/assistants.json @@ -0,0 +1,33 @@ +{ + "warnOnFailure": true, + "kickOnFailure": true, + "disallowedFeatures": { + "FilterWeather": false, + "FilterLight": false, + "SmartTarget": false, + "RangedTarget": false, + "AutoOpenDoors": false, + "DequipOnCast": false, + "AutoPotionEquip": false, + "PoisonedChecks": false, + "LoopedMacros": false, + "UseOnceAgent": false, + "RestockAgent": false, + "SellAgent": false, + "BuyAgent": false, + "PotionHotkeys": false, + "RandomTargets": false, + "ClosestTargets": false, + "OverheadHealth": false, + "AutolootAgent": false, + "BoneCutterAgent": false, + "JScriptMacros": false, + "AutoRemount": false, + "AutoBandage": false, + "EnemyTargetShare": false, + "FilterSeason": false, + "SpellTargetShare": false + }, + "disconnectDelay": "00:00:15", + "warningMessage": "The server was unable to negotiate features with your assistant. You must download and run an updated version of UOSteam or Razor.

Make sure you've checked the option Negotiate features with server, once you have this box checked you may log in and play normally.

You will be disconnected shortly." +} \ No newline at end of file diff --git a/Distribution/Configuration/auto-denylist.json b/Distribution/Configuration/auto-denylist.json new file mode 100644 index 000000000..9ba21f04a --- /dev/null +++ b/Distribution/Configuration/auto-denylist.json @@ -0,0 +1,5 @@ +{ + "enabled": true, + "duration": "00:15:00", + "maxEntries": 324449 +} \ No newline at end of file diff --git a/Distribution/Configuration/bans.json b/Distribution/Configuration/bans.json new file mode 100644 index 000000000..ec0c1c330 --- /dev/null +++ b/Distribution/Configuration/bans.json @@ -0,0 +1,6 @@ +{ + "reportRateLimitTrips": true, + "autoBanDuration": "04:00:00", + "reportBadConnects": true, + "badConnectDuration": "04:00:00" +} \ No newline at end of file diff --git a/Distribution/Configuration/blocklist.json b/Distribution/Configuration/blocklist.json new file mode 100644 index 000000000..fdb20c0a5 --- /dev/null +++ b/Distribution/Configuration/blocklist.json @@ -0,0 +1,8 @@ +{ + "enabled": false, + "file": "Configuration/ip-blocklist.txt", + "reloadInterval": "00:01:00", + "reportHits": true, + "banDuration": "06:00:00", + "promoteSuppression": "00:01:00" +} \ No newline at end of file diff --git a/Distribution/Configuration/crowdsec.json b/Distribution/Configuration/crowdsec.json new file mode 100644 index 000000000..e0a77fe6d --- /dev/null +++ b/Distribution/Configuration/crowdsec.json @@ -0,0 +1,9 @@ +{ + "lapiUrl": "http://127.0.0.1:8080", + "machineId": "", + "password": "", + "origin": "modernuo", + "manualBanDuration": "7.00:00:00", + "flushInterval": "00:00:01", + "maxQueue": 10000 +} \ No newline at end of file diff --git a/Distribution/Configuration/email-settings.json b/Distribution/Configuration/email-settings.json new file mode 100644 index 000000000..ee04379aa --- /dev/null +++ b/Distribution/Configuration/email-settings.json @@ -0,0 +1,15 @@ +{ + "enabled": false, + "fromAddress": "support@modernuo.com", + "fromName": "ModernUO Team", + "crashAddress": "crashes@modernuo.com", + "crashName": "Crash Log", + "speechLogPageAddress": "support@modernuo.com", + "speechLogPageName": "GM Support Conversation", + "emailServer": "smtp.gmail.com", + "emailPort": 465, + "emailUsername": "support@modernuo.com", + "emailPassword": "Some Password 123", + "emailSendRetryCount": 5, + "emailSendRetryDelay": 3 +} \ No newline at end of file diff --git a/Distribution/Configuration/expansion.json b/Distribution/Configuration/expansion.json new file mode 100644 index 000000000..d3f504955 --- /dev/null +++ b/Distribution/Configuration/expansion.json @@ -0,0 +1,79 @@ +{ + "Id": 2, + "Name": "Renaissance", + "ClientFlags": "Trammel", + "SupportedFeatures": { + "ExpansionT2A": true, + "T2A": true, + "UOR": true, + "UOTD": false, + "LBR": false, + "AOS": false, + "SixthCharacterSlot": false, + "SE": false, + "ML": false, + "EighthAge": false, + "NinthAge": false, + "TenthAge": false, + "IncreasedStorage": false, + "SeventhCharacterSlot": false, + "RoleplayFaces": false, + "TrialAccount": false, + "LiveAccount": false, + "SA": false, + "HS": false, + "Gothic": false, + "Rustic": false, + "Jungle": false, + "Shadowguard": false, + "TOL": false, + "EJ": false + }, + "CharacterListFlags": { + "Unk1": false, + "OverwriteConfigButton": false, + "OneCharacterSlot": false, + "ExpansionNone": true, + "ExpansionUOTD": true, + "ExpansionLBR": true, + "ExpansionT2A": true, + "ExpansionUOR": true, + "ContextMenus": true, + "SlotLimit": false, + "AOS": false, + "SixthCharacterSlot": false, + "SE": false, + "ML": false, + "KR": false, + "UO3DClientType": false, + "Unk3": false, + "SeventhCharacterSlot": false, + "Unk4": false, + "NewMovementSystem": false, + "NewFeluccaAreas": false + }, + "HousingFlags": { + "AOS": false, + "HousingAOS": false, + "SE": false, + "ML": false, + "Crystal": false, + "SA": false, + "HS": false, + "Gothic": false, + "Rustic": false, + "Jungle": false, + "Shadowguard": false, + "TOL": false, + "EJ": false + }, + "MobileStatusVersion": 3, + "MapSelectionFlags": { + "Felucca": true, + "Trammel": true, + "Ilshenar": false, + "Malas": false, + "Tokuno": false, + "TerMur": false + } +} \ No newline at end of file diff --git a/Distribution/Configuration/firewall.json b/Distribution/Configuration/firewall.json new file mode 100644 index 000000000..c43cb320f --- /dev/null +++ b/Distribution/Configuration/firewall.json @@ -0,0 +1,3 @@ +{ + "entries": [] +} \ No newline at end of file diff --git a/Distribution/Configuration/ip-allowlist.json b/Distribution/Configuration/ip-allowlist.json new file mode 100644 index 000000000..b588dbca1 --- /dev/null +++ b/Distribution/Configuration/ip-allowlist.json @@ -0,0 +1,7 @@ +{ + "enabled": false, + "files": [ + "Configuration/ip-allowlist*.txt" + ], + "reloadInterval": "00:01:00" +} \ No newline at end of file diff --git a/Distribution/Configuration/login-allowlist.json b/Distribution/Configuration/login-allowlist.json new file mode 100644 index 000000000..be8521524 --- /dev/null +++ b/Distribution/Configuration/login-allowlist.json @@ -0,0 +1,8 @@ +{ + "enabled": true, + "file": "Configuration/login-allowlist.txt", + "ttl": "90.00:00:00", + "flushInterval": "01:00:00", + "escalateAfterStrikes": 10, + "strikeWindow": "01:00:00" +} \ No newline at end of file diff --git a/Distribution/Configuration/modernuo.json b/Distribution/Configuration/modernuo.json new file mode 100644 index 000000000..24ac88c6c --- /dev/null +++ b/Distribution/Configuration/modernuo.json @@ -0,0 +1,107 @@ +{ + "assemblyDirectories": [ + "./Assemblies" + ], + "dataDirectories": [ + "Client" + ], + "listeners": [ + "0.0.0.0:2593" + ], + "settings": { + "accountHandler.enableAutoAccountCreation": "True", + "accountHandler.enablePlayerPasswordCommand": "False", + "accountHandler.maxAccountsPerIP": "1", + "accountSecurity.encryptionAlgorithm": "Argon2", + "assistants.enableNegotiation": "False", + "autoArchive.archiveLocally": "True", + "autoArchive.archivePath": "Archives", + "autoArchive.backupMaxAge": "30", + "autoArchive.backupPath": "Backups", + "autoArchive.compressionLevel": "3", + "autoArchive.dailyRetention": "30", + "autoArchive.enableArchivePruning": "True", + "autoArchive.hourlyRetention": "24", + "autoArchive.monthlyRetention": "12", + "autoArchive.retryCount": "3", + "autoArchive.retryDelayMs": "500", + "autoArchive.verifyArchives": "True", + "autosave.enabled": "True", + "autosave.saveDelay": "00:05:00", + "autosave.warningDelay": "00:00:00", + "buffIcons.enable": "False", + "bulletinboards.creationTimeDelay": "00:02:00", + "bulletinboards.expireDuration": "06:00:00", + "bulletinboards.replyDelay": "00:00:30", + "chat.enabled": "False", + "clientVerification.ageLeniency": "10.00:00:00", + "clientVerification.enable": "True", + "clientVerification.gameTimeLeniency": "1.01:00:00", + "clientVerification.invalidClientResponse": "Kick", + "clientVerification.kickDelay": "00:00:20", + "commandsystem.prefix": "[", + "crashGuard.enabled": "True", + "crashGuard.generateReport": "True", + "crashGuard.restartServer": "True", + "crashGuard.saveBackup": "True", + "ethics.enable": "False", + "houseDecay.enable": "True", + "movement.delay.runFoot": "200", + "movement.delay.runMount": "100", + "movement.delay.turn": "0", + "movement.delay.walkFoot": "400", + "movement.delay.walkMount": "200", + "movementThrottle.definiteRateThreshold": "1.100000023841858", + "movementThrottle.hardQueueLimit": "10", + "movementThrottle.maxChainGap": "2000", + "movementThrottle.maxCredit": "200", + "movementThrottle.maxRttBonus": "150", + "movementThrottle.minSamplesForRate": "8", + "movementThrottle.movementHistorySize": "20", + "movementThrottle.speedHackNotificationCooldown": "300000", + "movementThrottle.suspiciousRateThreshold": "1.0499999523162842", + "murderSystem.bountiesEnabled": "True", + "murderSystem.bountyExpiry": "14.00:00:00", + "murderSystem.longTermMurderDuration": "1.16:00:00", + "murderSystem.recentlyReportedDelay": "00:10:00", + "murderSystem.shortTermMurderDuration": "08:00:00", + "network.initialBufferSlabs": "1", + "network.maxBufferSlabs": "128", + "network.maxOutstandingSends": "32", + "network.memoryCeilingPercent": "80", + "network.sendBufferGrowthBudget": "268435456", + "network.sendBufferMaxSize": "2097152", + "network.sendBufferSize": "262144", + "pages.discordWebhookUrl": null, + "pathfinding.enable": "True", + "pathfinding.maxResidentChunks": "8192", + "pathfinding.maxSearchNodes": "1000", + "pathfinding.prebakeMaps": "False", + "pathfinding.recorder.enable": "False", + "pathfinding.recorder.path": "/home/warrentyexpired/Projects/SovereignRealm/Server/Distribution/Data/Pathfinding/recordings/pathfinds.jsonl", + "pingServer.enabled": "True", + "questSystem.enableMLQuests": "False", + "serverListing.address": null, + "serverListing.autoDetect": "True", + "serverListing.serverName": "Sovereign Realm", + "stamina.additionalLossWhenBelow": "0.1", + "stamina.baseOverweightLoss": "5", + "stamina.cannotRunWhenFatigued": "True", + "stamina.cannotWalkWhenFatigued": "False", + "stamina.enableMountStamina": "True", + "stamina.stonesOverweightAllowance": "4", + "stamina.stonesPerOverweightLoss": "25", + "stats.gainChanceMultiplier": "1", + "stats.statMax": "100", + "testCenter.enable": "False", + "timer.initialPoolCapacity": "1024", + "timer.maxPoolCapacity": "16384", + "uogateway.enabled": "True", + "vetRewards.enable": "True", + "vetRewards.rewardInterval": "30.00:00:00", + "vetRewards.skillCapRewards": "True", + "world.enableAutoRestart": "False", + "world.savePath": "Saves", + "world.useMultithreadedSaves": "True" + } +} \ No newline at end of file diff --git a/Distribution/Configuration/throttles.json b/Distribution/Configuration/throttles.json new file mode 100644 index 000000000..ee8fa7be3 --- /dev/null +++ b/Distribution/Configuration/throttles.json @@ -0,0 +1,6 @@ +{ + "0x03": 25, + "0x12": 25, + "0x75": 500, + "0xAD": 25 +} \ No newline at end of file diff --git a/Distribution/Data/go.json b/Distribution/Data/go.json new file mode 100644 index 000000000..3a21710aa --- /dev/null +++ b/Distribution/Data/go.json @@ -0,0 +1,11 @@ +{ + "name": "The World", + "categories": [ + { "name": "Fel", "categories": [ + { "name": "Towns", "locations": [ + { "name": "Brit Fel", "location": [1592, 1680, 10], "map": "Felucca" } ] } ] }, + { "name": "Tram", "categories": [ + { "name": "Towns", "locations": [ + { "name": "Brit Tram", "location": [1592, 1680, 10], "map": "Trammel" } ] } ] } + ] +} diff --git a/Projects/UOContent/Gumps/Go/GoGump.cs b/Projects/UOContent/Gumps/Go/GoGump.cs index e33d441cb..e066e7ba0 100644 --- a/Projects/UOContent/Gumps/Go/GoGump.cs +++ b/Projects/UOContent/Gumps/Go/GoGump.cs @@ -159,10 +159,23 @@ public class GoGump : DynamicGump index -= _node.Categories.Length; if (index < _node.Locations.Length) { - from.MoveToWorld(_node.Locations[index].Location, _tree.Map); + //from.MoveToWorld(_node.Locations[index].Location, _tree.Map); + var loc = _node.Locations[index]; + Map targetMap = _tree.Map; + if (!string.IsNullOrEmpty(loc.MapName)) + { + foreach (Map m in Map.AllMaps) + { + if (m != null && string.Equals(m.Name, loc.MapName, StringComparison.OrdinalIgnoreCase)) + { + targetMap = m; + break; + } + } + } + from.MoveToWorld(loc.Location, targetMap); } } - break; } } diff --git a/Projects/UOContent/Gumps/Go/GoLocation.cs b/Projects/UOContent/Gumps/Go/GoLocation.cs index c766f9e63..50d52bbc1 100644 --- a/Projects/UOContent/Gumps/Go/GoLocation.cs +++ b/Projects/UOContent/Gumps/Go/GoLocation.cs @@ -9,4 +9,6 @@ public class GoLocation [JsonPropertyName("name")] public string Name { get; set; } [JsonPropertyName("location")] public Point3D Location { get; set; } -} \ No newline at end of file + + [JsonPropertyName("map")] public string MapName { get; set; } +} diff --git a/Projects/UOContent/Gumps/Go/GoLocations.cs b/Projects/UOContent/Gumps/Go/GoLocations.cs index ad45b66ec..24633168d 100644 --- a/Projects/UOContent/Gumps/Go/GoLocations.cs +++ b/Projects/UOContent/Gumps/Go/GoLocations.cs @@ -11,48 +11,18 @@ public static class GoLocations { private static readonly ILogger logger = LogFactory.GetLogger(typeof(GoLocations)); - private static LocationTree _felucca; - private static LocationTree _trammel; - private static LocationTree _ilshenar; - private static LocationTree _malas; - private static LocationTree _tokuno; - private static LocationTree _terMur; + private static LocationTree _world; public static LocationTree GetLocations(Map map) { - if (map == Map.Ilshenar) - { - return _ilshenar ??= LoadLocations("ilshenar", Map.Ilshenar); - } - - if (map == Map.TerMur) - { - return _terMur ??= LoadLocations("termur", Map.TerMur); - } - - if (map == Map.Trammel) - { - return _trammel ??= LoadLocations("trammel", Map.Trammel); - } - - if (map == Map.Malas) - { - return _malas ??= LoadLocations("malas", Map.Malas); - } - - if (map == Map.Tokuno) - { - return _tokuno ??= LoadLocations("tokuno", Map.Tokuno); - } - - return _felucca ??= LoadLocations("felucca", Map.Felucca); + // Always return the same world tree, regardless of which map 'GetLocations' is called with + return _world ??= LoadLocations("go", Map.Felucca); } private static LocationTree LoadLocations(string fileName, Map map) { var lastBranch = new Dictionary(); - - var path = Path.Combine($"Data/Locations/{fileName}.json"); + var path = Path.Combine($"Data/{fileName}.json"); try { @@ -67,7 +37,7 @@ public static class GoLocations catch (Exception e) { logger.Error(e, "Failed to load file {Path}.", path); - return new LocationTree(map, [], null); + return new LocationTree(map, lastBranch, new GoCategory { Name = "Error", Categories = [], Locations = [] }); } } }