feat: onInit event now calls by Websocket server

This commit is contained in:
AURUMVORXX
2025-04-16 12:46:48 +03:00
parent 99a6861f2e
commit 441b0d012c
2 changed files with 1 additions and 10 deletions

View File

@@ -30,16 +30,6 @@ addEventHandler("onBan", function(banInfo)
_PyG2O_Send(data); _PyG2O_Send(data);
}); });
addEventHandler("onInit", function()
{
local data = {
event = "onInit",
args = {}
}
_PyG2O_Send(data);
});
addEventHandler("onExit", function() addEventHandler("onExit", function()
{ {
local data = { local data = {

View File

@@ -36,6 +36,7 @@ class PythonWebsocketServer:
): ):
logging.info(f'[PyG2O] Server is started at ws://{self.host}:{self.port}') logging.info(f'[PyG2O] Server is started at ws://{self.host}:{self.port}')
PythonWebsocketServer._current_server = self PythonWebsocketServer._current_server = self
asyncio.create_task(callEvent('onInit', **{}))
await self._stop_event.wait() await self._stop_event.wait()
async def stop(self): async def stop(self):