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

summaryrefslogtreecommitdiff
path: root/source/game
diff options
context:
space:
mode:
authorErodeesFleurs <3353309908@qq.com>2024-03-27 10:21:13 +0800
committerErodeesFleurs <3353309908@qq.com>2024-03-27 10:21:13 +0800
commit2a116c945ec087d18818d2edfde86a43a09db24c (patch)
treef6291d821bd5810a2d318a5d3321e16a0188a925 /source/game
parent77d7f8eb81af21dd231f6384951fc2c14c149d5c (diff)
add lua invoke when the client enters and leaves the planet.
Diffstat (limited to 'source/game')
-rw-r--r--source/game/StarWorldServer.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/game/StarWorldServer.cpp b/source/game/StarWorldServer.cpp
index 680deaa..9860fb1 100644
--- a/source/game/StarWorldServer.cpp
+++ b/source/game/StarWorldServer.cpp
@@ -268,6 +268,9 @@ bool WorldServer::addClient(ConnectionId clientId, SpawnTarget const& spawnTarge
clientInfo->outgoingPackets.append(make_shared<CentralStructureUpdatePacket>(m_centralStructure.store()));
+ for (auto& p : m_scriptContexts)
+ p.second->invoke("addClient", clientId, isLocal);
+
return true;
}
@@ -297,6 +300,9 @@ List<PacketPtr> WorldServer::removeClient(ConnectionId clientId) {
packets.append(make_shared<WorldStopPacket>("Removed"));
+ for (auto& p : m_scriptContexts)
+ p.second->invoke("removeClient", clientId);
+
return packets;
}