server: added more gameplay commands and determine playing order on start_game command

This commit is contained in:
2025-07-08 10:42:34 +02:00
parent 3122df893a
commit 08773d963c
4 changed files with 113 additions and 10 deletions
+13 -1
View File
@@ -117,6 +117,10 @@ func _handle_response(response: String) -> void:
"new_round_started":
print(data)
"client_submitted_bet":
print(data)
"client_played_card":
print(data)
func _handle_join(data) -> void:
match data["status"]:
@@ -173,7 +177,15 @@ func start_game() -> void:
_send_message(JSON.stringify({
"response": "start_game",
"lobby_id": _lobby_id,
"cards": CardManager.get_shuffled_cards(_connected_client_ids, 30),
"cards": CardManager.get_shuffled_cards(_connected_client_ids, 1),
}))
func start_next_round(round_count: int) -> void:
_send_message(JSON.stringify({
"response": "start_next_round",
"lobby_id": _lobby_id,
"round": round_count,
"cards": CardManager.get_shuffled_cards(_connected_client_ids, round_count),
}))
func _send_message(message: String) -> void: