mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 12:11:33 -06:00
MultiServer and clients: async coroutine starter in Utils.py (#1143)
* async coroutine starter in Utils.py * refactor from static class to function * async_start docstring
This commit is contained in:
5
kvui.py
5
kvui.py
@@ -49,6 +49,7 @@ fade_in_animation = Animation(opacity=0, duration=0) + Animation(opacity=1, dura
|
||||
|
||||
|
||||
from NetUtils import JSONtoTextParser, JSONMessagePart, SlotType
|
||||
from Utils import async_start
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
import CommonClient
|
||||
@@ -427,9 +428,9 @@ class GameManager(App):
|
||||
if self.ctx.server:
|
||||
self.ctx.server_address = None
|
||||
self.ctx.username = None
|
||||
asyncio.create_task(self.ctx.disconnect())
|
||||
async_start(self.ctx.disconnect())
|
||||
else:
|
||||
asyncio.create_task(self.ctx.connect(self.server_connect_bar.text.replace("/connect ", "")))
|
||||
async_start(self.ctx.connect(self.server_connect_bar.text.replace("/connect ", "")))
|
||||
|
||||
def on_stop(self):
|
||||
# "kill" input tasks
|
||||
|
Reference in New Issue
Block a user