scheisse
This commit is contained in:
3
Game.py
3
Game.py
@@ -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())
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user