This commit is contained in:
Jonas Zeunert
2020-02-14 00:48:38 +01:00
parent 49ecf0f244
commit 22cb3fa229
3 changed files with 3 additions and 6 deletions

View File

@@ -15,8 +15,7 @@ class Game:
print('Received SIGINT. Stopping Game :-)')
self.is_running.release()
@asyncio.coroutine
def run(self):
async def run(self):
self.is_running.acquire()
asyncio.run(self.input_handler.handleInputs())

View File

@@ -7,8 +7,7 @@ class InputHandler:
self.isRunning = True
self.targets = targets
@asyncio.coroutine
def handleInputs(self):
async def handleInputs(self):
self.isRunning = True
while self.isRunning:
event = await Networking().getInputEvent()

View File

@@ -48,8 +48,7 @@ class Networking(metaclass=Singleton):
def writeDisplayScore(self, display, score):
self.get("/displays/" + display + "/write_score/" + str(score))
@asyncio.coroutine
def getInputEvent(self):
async def getInputEvent(self):
header = list()
while b'\x02' not in header:
byte = self.input_socket.recv(1)