add lua invoke when the client enters and leaves the planet.

This commit is contained in:
ErodeesFleurs 2024-03-27 10:21:13 +08:00
parent 77d7f8eb81
commit 2a116c945e

View File

@ -268,6 +268,9 @@ bool WorldServer::addClient(ConnectionId clientId, SpawnTarget const& spawnTarge
clientInfo->outgoingPackets.append(make_shared<CentralStructureUpdatePacket>(m_centralStructure.store())); clientInfo->outgoingPackets.append(make_shared<CentralStructureUpdatePacket>(m_centralStructure.store()));
for (auto& p : m_scriptContexts)
p.second->invoke("addClient", clientId, isLocal);
return true; return true;
} }
@ -297,6 +300,9 @@ List<PacketPtr> WorldServer::removeClient(ConnectionId clientId) {
packets.append(make_shared<WorldStopPacket>("Removed")); packets.append(make_shared<WorldStopPacket>("Removed"));
for (auto& p : m_scriptContexts)
p.second->invoke("removeClient", clientId);
return packets; return packets;
} }