Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/StarWorldServer.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2024-03-18 23:25:44 +1100
committerKae <80987908+Novaenia@users.noreply.github.com>2024-03-18 23:25:44 +1100
commit5f01d2d4d7c19e280f02cd2e0ecd73990f2373a4 (patch)
tree916f887f91288c93a7845933e9e47bfe3f7a91c3 /source/game/StarWorldServer.cpp
parent5a48b0383ae3eccf1ea402a438822cd3e61539bc (diff)
Update StarWorldServer.cpp
Diffstat (limited to 'source/game/StarWorldServer.cpp')
-rw-r--r--source/game/StarWorldServer.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/game/StarWorldServer.cpp b/source/game/StarWorldServer.cpp
index 6543a75..680deaa 100644
--- a/source/game/StarWorldServer.cpp
+++ b/source/game/StarWorldServer.cpp
@@ -247,7 +247,12 @@ bool WorldServer::addClient(ConnectionId clientId, SpawnTarget const& spawnTarge
clientInfo->local = isLocal;
auto worldStartPacket = make_shared<WorldStartPacket>();
- worldStartPacket->templateData = m_worldTemplate->store();
+ auto& templateData = worldStartPacket->templateData = m_worldTemplate->store();
+ // this makes it possible to use custom InstanceWorlds without clients having the mod that adds their dungeon:
+ if (templateData.optQueryString("worldParameters.primaryDungeon")
+ && Root::singletonPtr()->configuration()->getPath("compatibility.customDungeonWorld").optBool().value(false))
+ worldStartPacket->templateData = worldStartPacket->templateData.setPath("worldParameters.primaryDungeon", "testarena");
+
tie(worldStartPacket->skyData, clientInfo->skyNetVersion) = m_sky->writeUpdate();
tie(worldStartPacket->weatherData, clientInfo->weatherNetVersion) = m_weather.writeUpdate();
worldStartPacket->playerStart = playerStart;