feat: onInit event now calls by Websocket server
This commit is contained in:
@@ -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 = {
|
||||||
|
|||||||
@@ -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):
|
||||||
|
|||||||
Reference in New Issue
Block a user