scheisse
This commit is contained in:
3
Game.py
3
Game.py
@@ -15,8 +15,7 @@ class Game:
|
|||||||
print('Received SIGINT. Stopping Game :-)')
|
print('Received SIGINT. Stopping Game :-)')
|
||||||
self.is_running.release()
|
self.is_running.release()
|
||||||
|
|
||||||
@asyncio.coroutine
|
async def run(self):
|
||||||
def run(self):
|
|
||||||
self.is_running.acquire()
|
self.is_running.acquire()
|
||||||
asyncio.run(self.input_handler.handleInputs())
|
asyncio.run(self.input_handler.handleInputs())
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,7 @@ class InputHandler:
|
|||||||
self.isRunning = True
|
self.isRunning = True
|
||||||
self.targets = targets
|
self.targets = targets
|
||||||
|
|
||||||
@asyncio.coroutine
|
async def handleInputs(self):
|
||||||
def handleInputs(self):
|
|
||||||
self.isRunning = True
|
self.isRunning = True
|
||||||
while self.isRunning:
|
while self.isRunning:
|
||||||
event = await Networking().getInputEvent()
|
event = await Networking().getInputEvent()
|
||||||
|
|||||||
@@ -48,8 +48,7 @@ class Networking(metaclass=Singleton):
|
|||||||
def writeDisplayScore(self, display, score):
|
def writeDisplayScore(self, display, score):
|
||||||
self.get("/displays/" + display + "/write_score/" + str(score))
|
self.get("/displays/" + display + "/write_score/" + str(score))
|
||||||
|
|
||||||
@asyncio.coroutine
|
async def getInputEvent(self):
|
||||||
def getInputEvent(self):
|
|
||||||
header = list()
|
header = list()
|
||||||
while b'\x02' not in header:
|
while b'\x02' not in header:
|
||||||
byte = self.input_socket.recv(1)
|
byte = self.input_socket.recv(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user