chore: TODOs

parent d3c23dfc
# Credits
- Byron Knoll
\ No newline at end of file
......@@ -153,10 +153,15 @@ class LobbyManager(ClientManager):
extras["youBet"] = False
if message:
print("Creating game task...")
game = asyncio.create_task(self.maybe_start_game())
print("Sending message...")
await self.send(sender, message, extras)
print("Awaiting game...")
await game
print("LOBBY: Message handled.")
def which_player(self, sid) -> Player:
sender: Optional[Player] = None
for name, metadata in self.metadata.items():
......@@ -169,6 +174,18 @@ class LobbyManager(ClientManager):
async def send_waiting_for(self, player: Player):
game = self.game_with(player)
# FIXME: Seems to block here, game doesn't move past Asking for...
# BET
# MSGIN| c38442e3785f4c2eb13e95368bfaa151 (Sumatran Elephant): BET.
# Lobby| Player Sumatran Elephant just announced bet=Ace of ♥|Ace of ♣|Ace of ♦|Ace of ♠.
# LOBBY: Message handled.
# received event "message" from c38442e3785f4c2eb13e95368bfaa151 [/]
# INFO: received event "message" from c38442e3785f4c2eb13e95368bfaa151 [/]
# INFO: 127.0.0.1:51452 - "POST /socket.io/?EIO=3&transport=polling&t=N6J1ZS7&sid=3c5e8962c4db465aaf2fd916bea2acc9 HTTP/1.1" 200 OK
# [WS] Message MENTEUR
# MSGIN| 3c5e8962c4db465aaf2fd916bea2acc9 (Chihuahua): MENTEUR.
# LOBBY: Message handled.
# received
await self.send(player, MessageToPlayer.YourTurn, extras={"bet": game.current_bet.json()})
for p in [p for p in game.players if p != player]:
await self.send(p, MessageToPlayer.Waiting, extras={"waitingFor": p.name})
......@@ -26,6 +26,7 @@ class ClientPlayer(Player):
print(f"Asking Client {self.name} for announce...")
while not metadata.last_announce and metadata.fresh_announce:
print("While, send_waiting_for")
await lobby.send_waiting_for(self)
print(f"Still waiting for {self.name}'s announce...")
sleep(2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment