added commands for requesting and receiving bets and starting rounds
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user