added commands for requesting and receiving bets and starting rounds

This commit is contained in:
2025-07-09 16:48:45 +02:00
parent cf7a53f111
commit 59ff9a429a
4 changed files with 108 additions and 12 deletions
+16 -1
View File
@@ -131,7 +131,13 @@ func _handle_response(response: String) -> void:
cards_received.emit.call_deferred(received_cards)
"client_submitted_bet":
print(data)
"client_played_card":
"request_bet":
print(data)
"begin_playing_cards":
print(data)
"request_card":
print(data)
"play_card":
print(data)
func _handle_join(data) -> void:
@@ -201,5 +207,14 @@ func start_next_round(round_count: int) -> void:
"cards": CardManager.get_shuffled_cards(_connected_client_ids, round_count),
}))
func submit_bet(bet: int, current_round: int) -> void:
_send_message(JSON.stringify({
"response": "submit_bet",
"lobby_id": _lobby_id,
"client_id": _client_id,
"round": current_round,
"bet": bet,
}))
func _send_message(message: String) -> void:
_socket.send_text(message)