more backend improvements; clients are (should be) able to submit cards and start new rounds; determining winners and scoring points is unimplemented
This commit is contained in:
@@ -41,6 +41,9 @@ signal cards_received(cards: Dictionary)
|
||||
|
||||
signal received_bet_request(disallowed_bet: int)
|
||||
|
||||
signal received_play_winner_request()
|
||||
signal request_next_round()
|
||||
|
||||
enum ConnectionStatus {
|
||||
DISCONNECTED,
|
||||
ATTEMPTING_CONNECTION,
|
||||
@@ -142,6 +145,10 @@ func _handle_response(response: String) -> void:
|
||||
print(data)
|
||||
"play_card":
|
||||
print(data)
|
||||
"determine_play_winner_request": # single card go-around
|
||||
received_play_winner_request.emit.call_deferred()
|
||||
"client_won_play":
|
||||
print(data)
|
||||
|
||||
func _handle_join(data) -> void:
|
||||
match data["status"]:
|
||||
@@ -219,5 +226,13 @@ func submit_bet(bet: int, current_round: int) -> void:
|
||||
"bet": bet,
|
||||
}))
|
||||
|
||||
func submit_round_winner(winning_client_id: String) -> void:
|
||||
_send_message(JSON.stringify({
|
||||
"response": "submit_play_winner",
|
||||
"lobby_id": _lobby_id,
|
||||
"client_id": winning_client_id,
|
||||
}))
|
||||
request_next_round.emit.call_deferred()
|
||||
|
||||
func _send_message(message: String) -> void:
|
||||
_socket.send_text(message)
|
||||
|
||||
Reference in New Issue
Block a user