mirror of
https://github.com/kuitoi/kuitoi-Server.git
synced 2025-08-18 00:35: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)
|
await self._send(data, to_all=True, to_self=False)
|
||||||
|
|
||||||
async def _looper(self):
|
async def _looper(self):
|
||||||
|
ev.call_lua_event("onPlayerConnecting", self.cid)
|
||||||
self._connect_time = time.monotonic()
|
self._connect_time = time.monotonic()
|
||||||
await self._send(f"P{self.cid}") # Send clientID
|
await self._send(f"P{self.cid}") # Send clientID
|
||||||
await self._sync_resources()
|
await self._sync_resources()
|
||||||
|
ev.call_lua_event("onPlayerJoining", self.cid)
|
||||||
tasks = self.__tasks
|
tasks = self.__tasks
|
||||||
recv = asyncio.create_task(self._recv())
|
recv = asyncio.create_task(self._recv())
|
||||||
tasks.append(recv)
|
tasks.append(recv)
|
||||||
|
@ -74,6 +74,7 @@ class TCPServer:
|
|||||||
return False, client
|
return False, client
|
||||||
|
|
||||||
ev.call_event("onPlayerAuthenticated", player=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"]:
|
if len(self.Core.clients_by_id) > config.Game["players"]:
|
||||||
# TODO: i18n
|
# TODO: i18n
|
||||||
|
Loading…
x
Reference in New Issue
Block a user