mirror of
https://github.com/kuitoi/kuitoi-Server.git
synced 2025-08-17 16:25:36 +00:00
Add calling lua events
This commit is contained in:
parent
905c0a361d
commit
c068629c83
@ -599,9 +599,11 @@ class Client:
|
||||
await self._send(data, to_all=True, to_self=False)
|
||||
|
||||
async def _looper(self):
|
||||
ev.call_lua_event("onPlayerConnecting", self.cid)
|
||||
self._connect_time = time.monotonic()
|
||||
await self._send(f"P{self.cid}") # Send clientID
|
||||
await self._sync_resources()
|
||||
ev.call_lua_event("onPlayerJoining", self.cid)
|
||||
tasks = self.__tasks
|
||||
recv = asyncio.create_task(self._recv())
|
||||
tasks.append(recv)
|
||||
|
@ -74,6 +74,7 @@ class TCPServer:
|
||||
return False, client
|
||||
|
||||
ev.call_event("onPlayerAuthenticated", player=client)
|
||||
ev.call_lua_event("onPlayerAuth", client.nick, client.roles, client.guest, client.identifiers)
|
||||
|
||||
if len(self.Core.clients_by_id) > config.Game["players"]:
|
||||
# TODO: i18n
|
||||
|
Loading…
x
Reference in New Issue
Block a user