added winning determination algorithm (not entirely working yet)
This commit is contained in:
+8
-2
@@ -220,7 +220,7 @@ class LobbyManager:
|
||||
json.dumps({
|
||||
"response": "client_played_card",
|
||||
"client_id": client_id,
|
||||
"card": played_card,
|
||||
"played_card": played_card,
|
||||
}),
|
||||
)
|
||||
|
||||
@@ -466,6 +466,8 @@ async def process_input(message: str, websocket) -> None:
|
||||
}),
|
||||
)
|
||||
|
||||
print("Sent game start")
|
||||
|
||||
playing_client_id = lobby_manager.get_lobby(lobby_id).client_playing_order[0]
|
||||
|
||||
await lobby_manager.send_message(
|
||||
@@ -475,6 +477,8 @@ async def process_input(message: str, websocket) -> None:
|
||||
"response": "request_card",
|
||||
}),
|
||||
)
|
||||
|
||||
print(f"Playing client is {playing_client_id}")
|
||||
else:
|
||||
# bets are not finished; continue asking for bets
|
||||
disallowed_bet = -1
|
||||
@@ -506,7 +510,7 @@ async def process_input(message: str, websocket) -> None:
|
||||
lobby_id,
|
||||
lobby_manager.get_lobby_host_client_id(lobby_id),
|
||||
json.dumps({
|
||||
"response": "determine_round_winner_request",
|
||||
"response": "determine_play_winner_request",
|
||||
})
|
||||
)
|
||||
else:
|
||||
@@ -527,6 +531,8 @@ async def process_input(message: str, websocket) -> None:
|
||||
data_object["client_id"],
|
||||
)
|
||||
|
||||
print(f"DING DING DING we have a winner!!! {data_object['client_id']}")
|
||||
|
||||
if __name__ == '__main__':
|
||||
run_local = False
|
||||
# Run locally without SSL certificate
|
||||
|
||||
Reference in New Issue
Block a user