clients now auto-connect to server, omitting the connection step and hiding the server URL from the frontend
This commit is contained in:
+9
-3
@@ -33,9 +33,6 @@ func _send_chat_message() -> void:
|
|||||||
message_sent.emit(message_input.text.strip_edges())
|
message_sent.emit(message_input.text.strip_edges())
|
||||||
message_input.text = ""
|
message_input.text = ""
|
||||||
|
|
||||||
func _on_web_client_user_message_received(sender: String, message: String) -> void:
|
|
||||||
put_chat_message(sender, message)
|
|
||||||
|
|
||||||
func _on_message_input_text_changed(new_text: String) -> void:
|
func _on_message_input_text_changed(new_text: String) -> void:
|
||||||
send_message_button.disabled = new_text.is_empty()
|
send_message_button.disabled = new_text.is_empty()
|
||||||
|
|
||||||
@@ -45,3 +42,12 @@ func _on_message_input_gui_input(event: InputEvent) -> void:
|
|||||||
|
|
||||||
func _on_send_message_button_pressed() -> void:
|
func _on_send_message_button_pressed() -> void:
|
||||||
_send_chat_message()
|
_send_chat_message()
|
||||||
|
|
||||||
|
|
||||||
|
func _on_web_client_connection_status_changed(new_status: WebClient.ConnectionStatus) -> void:
|
||||||
|
if new_status == WebClient.ConnectionStatus.JOINED:
|
||||||
|
message_input.editable = true
|
||||||
|
send_message_button.disabled = false
|
||||||
|
else:
|
||||||
|
message_input.editable = false
|
||||||
|
send_message_button.disabled = true
|
||||||
|
|||||||
@@ -1,16 +1,12 @@
|
|||||||
class_name ClientInterface
|
class_name ClientInterface
|
||||||
extends Control
|
extends Control
|
||||||
|
|
||||||
@export var client: WebClientTCP
|
@export var client: WebClient
|
||||||
|
|
||||||
@export var connect_button: Button
|
|
||||||
@export var create_lobby_button: Button
|
@export var create_lobby_button: Button
|
||||||
@export var join_lobby_button: Button
|
@export var join_lobby_button: Button
|
||||||
@export var leave_lobby_button: Button
|
@export var leave_lobby_button: Button
|
||||||
|
|
||||||
@export var chat_message_input: LineEdit
|
|
||||||
@export var send_chat_message_button: Button
|
|
||||||
|
|
||||||
@export var connected_players_label: Label
|
@export var connected_players_label: Label
|
||||||
|
|
||||||
@export var name_input: LineEdit
|
@export var name_input: LineEdit
|
||||||
@@ -25,9 +21,6 @@ func _write_line(text: String) -> void:
|
|||||||
func _on_create_lobby_button_pressed() -> void:
|
func _on_create_lobby_button_pressed() -> void:
|
||||||
client.create_lobby(name_input.text.strip_edges())
|
client.create_lobby(name_input.text.strip_edges())
|
||||||
|
|
||||||
func _on_connect_button_pressed() -> void:
|
|
||||||
client.connect_to_server($MarginContainer/VBoxContainer/ServerInputs/URLInput.text)
|
|
||||||
|
|
||||||
func _on_join_lobby_button_pressed() -> void:
|
func _on_join_lobby_button_pressed() -> void:
|
||||||
client.join_lobby(lobby_code_input.text.strip_edges(), name_input.text.strip_edges())
|
client.join_lobby(lobby_code_input.text.strip_edges(), name_input.text.strip_edges())
|
||||||
|
|
||||||
@@ -39,7 +32,8 @@ func _on_web_client_tcp_connected_to_server() -> void:
|
|||||||
_write_line("You are connected to the server")
|
_write_line("You are connected to the server")
|
||||||
|
|
||||||
func _on_web_client_tcp_connection_error_occurred() -> void:
|
func _on_web_client_tcp_connection_error_occurred() -> void:
|
||||||
connect_button.disabled = false
|
#connect_button.disabled = false
|
||||||
|
pass
|
||||||
|
|
||||||
func _on_web_client_tcp_disconnected_from_server() -> void:
|
func _on_web_client_tcp_disconnected_from_server() -> void:
|
||||||
_write_line("You were disconnected from the server")
|
_write_line("You were disconnected from the server")
|
||||||
@@ -62,60 +56,45 @@ func _on_web_client_tcp_client_left_lobby(client_name: String, connected_client_
|
|||||||
_write_line("{client_name} left the lobby".format({"client_name": client_name}))
|
_write_line("{client_name} left the lobby".format({"client_name": client_name}))
|
||||||
_update_connected_players(connected_client_names)
|
_update_connected_players(connected_client_names)
|
||||||
|
|
||||||
func _on_web_client_tcp_connection_status_changed(new_status: WebClientTCP.ConnectionStatus) -> void:
|
func _on_web_client_tcp_connection_status_changed(new_status: WebClient.ConnectionStatus) -> void:
|
||||||
match new_status:
|
match new_status:
|
||||||
WebClientTCP.ConnectionStatus.DISCONNECTED:
|
WebClient.ConnectionStatus.DISCONNECTED:
|
||||||
connect_button.disabled = false
|
|
||||||
create_lobby_button.disabled = true
|
create_lobby_button.disabled = true
|
||||||
join_lobby_button.disabled = true
|
join_lobby_button.disabled = true
|
||||||
leave_lobby_button.disabled = true
|
leave_lobby_button.disabled = true
|
||||||
name_input.editable = true
|
name_input.editable = true
|
||||||
lobby_code_input.editable = false
|
lobby_code_input.editable = false
|
||||||
lobby_code_input.text = ""
|
lobby_code_input.text = ""
|
||||||
chat_message_input.editable = false
|
|
||||||
send_chat_message_button.disabled = true
|
|
||||||
|
|
||||||
WebClientTCP.ConnectionStatus.ATTEMPTING_CONNECTION:
|
WebClient.ConnectionStatus.ATTEMPTING_CONNECTION:
|
||||||
connect_button.disabled = true
|
|
||||||
create_lobby_button.disabled = true
|
create_lobby_button.disabled = true
|
||||||
join_lobby_button.disabled = true
|
join_lobby_button.disabled = true
|
||||||
leave_lobby_button.disabled = true
|
leave_lobby_button.disabled = true
|
||||||
name_input.editable = true
|
name_input.editable = true
|
||||||
lobby_code_input.editable = false
|
lobby_code_input.editable = false
|
||||||
lobby_code_input.text = ""
|
lobby_code_input.text = ""
|
||||||
chat_message_input.editable = false
|
|
||||||
send_chat_message_button.disabled = true
|
|
||||||
|
|
||||||
WebClientTCP.ConnectionStatus.LOBBYLESS:
|
WebClient.ConnectionStatus.LOBBYLESS:
|
||||||
connect_button.disabled = true
|
|
||||||
create_lobby_button.disabled = false
|
create_lobby_button.disabled = false
|
||||||
join_lobby_button.disabled = false
|
join_lobby_button.disabled = false
|
||||||
leave_lobby_button.disabled = true
|
leave_lobby_button.disabled = true
|
||||||
name_input.editable = true
|
name_input.editable = true
|
||||||
lobby_code_input.editable = true
|
lobby_code_input.editable = true
|
||||||
lobby_code_input.text = ""
|
lobby_code_input.text = ""
|
||||||
chat_message_input.editable = false
|
|
||||||
send_chat_message_button.disabled = true
|
|
||||||
|
|
||||||
WebClientTCP.ConnectionStatus.ATTEMPTING_JOIN:
|
WebClient.ConnectionStatus.ATTEMPTING_JOIN:
|
||||||
connect_button.disabled = true
|
|
||||||
create_lobby_button.disabled = true
|
create_lobby_button.disabled = true
|
||||||
join_lobby_button.disabled = true
|
join_lobby_button.disabled = true
|
||||||
leave_lobby_button.disabled = true
|
leave_lobby_button.disabled = true
|
||||||
name_input.editable = false
|
name_input.editable = false
|
||||||
lobby_code_input.editable = false
|
lobby_code_input.editable = false
|
||||||
chat_message_input.editable = false
|
|
||||||
send_chat_message_button.disabled = true
|
|
||||||
|
|
||||||
WebClientTCP.ConnectionStatus.JOINED:
|
WebClient.ConnectionStatus.JOINED:
|
||||||
connect_button.disabled = true
|
|
||||||
create_lobby_button.disabled = true
|
create_lobby_button.disabled = true
|
||||||
join_lobby_button.disabled = true
|
join_lobby_button.disabled = true
|
||||||
leave_lobby_button.disabled = false
|
leave_lobby_button.disabled = false
|
||||||
name_input.editable = false
|
name_input.editable = false
|
||||||
lobby_code_input.editable = false
|
lobby_code_input.editable = false
|
||||||
chat_message_input.editable = true
|
|
||||||
send_chat_message_button.disabled = false
|
|
||||||
|
|
||||||
func _on_web_client_tcp_received_connection_message(message: String) -> void:
|
func _on_web_client_tcp_received_connection_message(message: String) -> void:
|
||||||
_write_line(message)
|
_write_line(message)
|
||||||
|
|||||||
+278
-134
@@ -1,169 +1,313 @@
|
|||||||
class_name WebClient
|
class_name WebClient
|
||||||
extends Node
|
extends Node
|
||||||
|
|
||||||
@export var name_input: LineEdit
|
## Sender tag for system messages displayed in the chat.
|
||||||
@export var session_code_input: LineEdit
|
const SENDER_SYSTEM: String = "SYSTEM"
|
||||||
@export var output: Label
|
|
||||||
@export var create_lobby_button: Button
|
|
||||||
@export var join_lobby_button: Button
|
|
||||||
@export var disconnect_lobby_button: Button
|
|
||||||
|
|
||||||
#var _peer: ENetMultiplayerPeer = ENetMultiplayerPeer.new()
|
## Server address to connect to.
|
||||||
var _address: String = "127.0.0.1"
|
## Local: 127.0.0.1:9974
|
||||||
var _port: int = 9974
|
## Remote: wss://denizk0461.dev/magsrv
|
||||||
|
const SERVER_ADDRESS: String = "127.0.0.1:9974"
|
||||||
|
|
||||||
var _udp: PacketPeerUDP = PacketPeerUDP.new()
|
#var _tcp := StreamPeerTCP.new()
|
||||||
var _stream := StreamPeerTCP.new()
|
var _socket := WebSocketPeer.new()
|
||||||
|
|
||||||
var _session_id: String
|
var _new_status: int = WebSocketPeer.STATE_CLOSED
|
||||||
|
var _processed_status: int = -1
|
||||||
|
|
||||||
|
var _lobby_id: String
|
||||||
var _client_id: String
|
var _client_id: String
|
||||||
var _client_name: String
|
var _client_name: String
|
||||||
|
|
||||||
var _is_in_lobby: bool = false
|
var received_data: Array
|
||||||
|
var cached_response: String
|
||||||
|
|
||||||
const MSG_CREATE_LOBBY: String = "cr"
|
var _is_first_play: bool = false
|
||||||
const MSG_JOIN_LOBBY: String = "jn"
|
|
||||||
const MSG_LEAVE_LOBBY: String = "lv"
|
|
||||||
|
|
||||||
const REMOTE_CREATE_SESSION_SUCCESS: String = "c0"
|
var _connected_client_ids: Array[String] = []
|
||||||
const REMOTE_ERR_CREATE_SESSION: String = "c1"
|
var _connected_client_names: Array[String] = []
|
||||||
const REMOTE_JOIN_SESSION_SUCCESS: String = "j0"
|
|
||||||
const REMOTE_JOIN_SESSION_DUPLICATE: String = "j1"
|
|
||||||
const REMOTE_JOIN_SESSION_MISSING: String = "j2"
|
|
||||||
const REMOTE_JOIN_SESSION_FULL: String = "j3"
|
|
||||||
const REMOTE_EXIT_SESSION: String = "ex"
|
@export var chat_panel: ChatPanel
|
||||||
|
|
||||||
|
signal connected_to_server()
|
||||||
|
signal connection_error_occurred()
|
||||||
|
signal disconnected_from_server()
|
||||||
|
|
||||||
|
signal connected_to_lobby(lobby_id: String)
|
||||||
|
signal disconnected_from_lobby()
|
||||||
|
signal received_client_id(client_id: String)
|
||||||
|
|
||||||
|
signal client_joined_lobby(client_name: String, connected_client_names: Array[String])
|
||||||
|
signal client_left_lobby(client_name: String, connected_client_names: Array[String])
|
||||||
|
|
||||||
|
signal received_connection_message(message: String)
|
||||||
|
signal received_chat_message(client_name: String, message: String)
|
||||||
|
|
||||||
|
signal connection_status_changed(new_status: ConnectionStatus)
|
||||||
|
|
||||||
|
# This signal is messy as fuck
|
||||||
|
signal client_order_received(client_ids: Array[String], client_ids_playing_order: Array[String], client_names: Array[String])
|
||||||
|
|
||||||
|
signal client_played_card(client_id: String, card_id: int)
|
||||||
|
signal received_expected_bet(client_id: String, expected_bet: int)
|
||||||
|
signal new_round_started()
|
||||||
|
signal cards_received(cards: Dictionary)
|
||||||
|
signal trump_received(trump_id: int)
|
||||||
|
signal received_bet_request(disallowed_bet: int, current_round: int)
|
||||||
|
signal received_win()
|
||||||
|
signal received_winning_client(client_id: String)
|
||||||
|
signal notify_play_card_request()
|
||||||
|
signal reset_first_card()
|
||||||
|
signal received_first_card(card_id: int)
|
||||||
|
signal received_played_card(client_id: String, card_id: int)
|
||||||
|
signal received_play_winner_request()
|
||||||
|
signal received_end_game_request()
|
||||||
|
signal request_next_play()
|
||||||
|
signal request_next_round()
|
||||||
|
|
||||||
|
enum ConnectionStatus {
|
||||||
|
DISCONNECTED,
|
||||||
|
ATTEMPTING_CONNECTION,
|
||||||
|
LOBBYLESS, # == connected
|
||||||
|
ATTEMPTING_JOIN,
|
||||||
|
JOINED,
|
||||||
|
}
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
_write_output("me client, you jane.")
|
connect_to_server(SERVER_ADDRESS)
|
||||||
|
|
||||||
func _process(delta: float) -> void:
|
func _process(_delta: float) -> void:
|
||||||
if _udp.get_available_packet_count() > 0:
|
_socket.poll()
|
||||||
var packet_str = _udp.get_packet().get_string_from_ascii()
|
_new_status = _socket.get_ready_state()
|
||||||
print(packet_str)
|
if not _processed_status == _new_status:
|
||||||
match packet_str.substr(0, 2):
|
match _new_status:
|
||||||
# Session creation
|
WebSocketPeer.STATE_OPEN:
|
||||||
REMOTE_CREATE_SESSION_SUCCESS:
|
print("open")
|
||||||
_write_output("Created and joined lobby successfully.")
|
connected_to_server.emit()
|
||||||
_write_output("Lobby code: {session_id}".format({
|
connection_status_changed.emit(ConnectionStatus.LOBBYLESS)
|
||||||
"session_id": _session_id
|
WebSocketPeer.STATE_CONNECTING:
|
||||||
}))
|
print("connecting")
|
||||||
_write_output("Your player code: {client_id}".format({
|
connection_status_changed.emit(ConnectionStatus.ATTEMPTING_CONNECTION)
|
||||||
"client_id": _client_id
|
WebSocketPeer.STATE_CLOSING:
|
||||||
}))
|
print("closing")
|
||||||
_on_lobby_connected()
|
pass
|
||||||
|
WebSocketPeer.STATE_CLOSED:
|
||||||
|
print("closed")
|
||||||
|
connection_status_changed.emit(ConnectionStatus.DISCONNECTED)
|
||||||
|
|
||||||
REMOTE_ERR_CREATE_SESSION:
|
_processed_status = _new_status
|
||||||
_write_output("Could not create lobby.")
|
|
||||||
_write_output("A lobby with the code {session_id} already exists.".format({
|
|
||||||
"session_id": _session_id
|
|
||||||
}))
|
|
||||||
|
|
||||||
REMOTE_JOIN_SESSION_SUCCESS:
|
if _processed_status == WebSocketPeer.STATE_OPEN:
|
||||||
_write_output("Joined lobby successfully.")
|
while _socket.get_available_packet_count():
|
||||||
_write_output("Your player code: {client_id}".format({"client_id": _client_id}))
|
cached_response = _socket.get_packet().get_string_from_utf8()
|
||||||
_on_lobby_connected()
|
#print(cached_response)
|
||||||
|
#cached_response += (received_data[1] as PackedByteArray).get_string_from_utf8()
|
||||||
|
if cached_response.ends_with("}"):
|
||||||
|
#print(cached_response)
|
||||||
|
_handle_response(cached_response)
|
||||||
|
cached_response = ""
|
||||||
|
|
||||||
# Session joining
|
func _listen_for_data() -> void:
|
||||||
REMOTE_JOIN_SESSION_DUPLICATE:
|
while true:
|
||||||
_write_output("Could not join lobby {session_id}.".format({
|
if _socket.get_available_packet_count():
|
||||||
"session_id": _session_id
|
cached_response = _socket.get_packet().get_string_from_utf8()
|
||||||
}))
|
print(cached_response)
|
||||||
_write_output("A player with the code {client_id} is already registered in the lobby.".format({
|
if cached_response.ends_with("}"):
|
||||||
"client_id": _client_id,
|
_handle_response(cached_response)
|
||||||
}))
|
cached_response = ""
|
||||||
|
|
||||||
REMOTE_JOIN_SESSION_MISSING:
|
func _handle_response(response: String) -> void:
|
||||||
_write_output("No lobby exists with the code {session_id}.".format({
|
var data = JSON.parse_string(response)
|
||||||
"session_id": _session_id
|
match data["response"]:
|
||||||
}))
|
"create_lobby":
|
||||||
|
if data["status"] == "ok":
|
||||||
|
_lobby_id = data["lobby_id"]
|
||||||
|
_client_id = data["client_id"]
|
||||||
|
received_client_id.emit.call_deferred(_client_id)
|
||||||
|
connected_to_lobby.emit.call_deferred(_lobby_id)
|
||||||
|
connection_status_changed.emit.call_deferred(ConnectionStatus.JOINED)
|
||||||
|
"join_lobby_response":
|
||||||
|
_handle_join(data)
|
||||||
|
"client_joined_lobby":
|
||||||
|
print(data["connected_client_ids"])
|
||||||
|
_connected_client_ids.assign(data["connected_client_ids"])
|
||||||
|
_connected_client_names.assign(data["connected_client_names"])
|
||||||
|
client_joined_lobby.emit.call_deferred(data["new_client_name"], _connected_client_names)
|
||||||
|
"leave_lobby_request":
|
||||||
|
leave_lobby()
|
||||||
|
"leave_lobby":
|
||||||
|
if data["status"] == "ok":
|
||||||
|
client_left_lobby.emit.call_deferred(data["client_name"])
|
||||||
|
"client_left_lobby":
|
||||||
|
_connected_client_ids.assign(data["connected_client_ids"])
|
||||||
|
_connected_client_names.assign(data["connected_client_names"])
|
||||||
|
client_left_lobby.emit.call_deferred(data["client_name"], _connected_client_names)
|
||||||
|
|
||||||
REMOTE_JOIN_SESSION_FULL:
|
## A chat message has been received
|
||||||
_write_output("Could not join lobby {session_id}.".format({
|
"receive_chat_message":
|
||||||
"session_id": _session_id
|
# Relay message to be displayed in the chat panel
|
||||||
}))
|
chat_panel.put_chat_message(data["client_name"], data["message"])
|
||||||
_write_output("The lobby has reached the maximum player count.")
|
|
||||||
|
|
||||||
# Session exit
|
"new_round_started":
|
||||||
REMOTE_EXIT_SESSION:
|
if data["current_round"] == 1:
|
||||||
_on_lobby_disconnected()
|
var playing_order: Array[String] = []
|
||||||
|
playing_order.assign(data["playing_order"])
|
||||||
|
client_order_received.emit.call_deferred(playing_order, _connected_client_ids, _connected_client_names)
|
||||||
|
|
||||||
func _exit_tree() -> void:
|
var received_cards = data["cards"]
|
||||||
_disconnect_from_lobby()
|
new_round_started.emit.call_deferred()
|
||||||
|
cards_received.emit.call_deferred(received_cards)
|
||||||
|
trump_received.emit.call_deferred(data["trump"])
|
||||||
|
"client_submitted_bet":
|
||||||
|
received_expected_bet.emit.call_deferred(
|
||||||
|
data["client_id"],
|
||||||
|
data["bet"],
|
||||||
|
)
|
||||||
|
"request_bet":
|
||||||
|
received_bet_request.emit.call_deferred(data["disallowed_bet"], data["round"])
|
||||||
|
"begin_playing_cards":
|
||||||
|
# all players know it's time to play
|
||||||
|
print(data)
|
||||||
|
_is_first_play = true
|
||||||
|
reset_first_card.emit.call_deferred()
|
||||||
|
"request_card":
|
||||||
|
# individual player asked to play card
|
||||||
|
notify_play_card_request.emit.call_deferred()
|
||||||
|
"begin_next_play":
|
||||||
|
print("beginning next play!")
|
||||||
|
_is_first_play = true
|
||||||
|
reset_first_card.emit.call_deferred()
|
||||||
|
"play_card":
|
||||||
|
print(data)
|
||||||
|
#client_played_card.emit.call_deferred(data["client_id"], data["played_card"])
|
||||||
|
"determine_play_winner_request": # single card go-around
|
||||||
|
received_play_winner_request.emit.call_deferred()
|
||||||
|
"end_game_request":
|
||||||
|
received_end_game_request.emit.call_deferred()
|
||||||
|
"client_played_card":
|
||||||
|
print("RECEIVED FOLLOWING CARD ID: " + str(data["played_card"]))
|
||||||
|
if _is_first_play:
|
||||||
|
print("set first card")
|
||||||
|
received_first_card.emit.call_deferred(data["played_card"])
|
||||||
|
if not CardManager.get_card_color(data["played_card"]) == Card.CardColor.WHITE:
|
||||||
|
_is_first_play = false
|
||||||
|
received_played_card.emit.call_deferred(data["client_id"], data["played_card"])
|
||||||
|
"client_won_play":
|
||||||
|
if data["client_id"] == _client_id:
|
||||||
|
received_win.emit.call_deferred()
|
||||||
|
received_winning_client.emit.call_deferred(data["client_id"])
|
||||||
|
|
||||||
func _generate_code() -> String:
|
func _handle_join(data) -> void:
|
||||||
# use a local randomized RNG to keep the global RNG reproducible
|
match data["status"]:
|
||||||
var rng = RandomNumberGenerator.new()
|
"lobby_not_found":
|
||||||
rng.randomize()
|
received_connection_message.emit.call_deferred("Could not join; lobby does not exist")
|
||||||
var length = 6
|
connection_status_changed.emit.call_deferred(ConnectionStatus.LOBBYLESS)
|
||||||
var result = ''
|
"lobby_full":
|
||||||
for _n in range(length):
|
received_connection_message.emit.call_deferred("Could not join; lobby is full")
|
||||||
var ascii = rng.randi_range(0, 25) + 65
|
connection_status_changed.emit.call_deferred(ConnectionStatus.LOBBYLESS)
|
||||||
result += '%c' % ascii
|
"ok":
|
||||||
return result
|
_client_id = data["client_id"]
|
||||||
|
connected_to_lobby.emit.call_deferred(_lobby_id)
|
||||||
|
received_client_id.emit.call_deferred(_client_id)
|
||||||
|
connection_status_changed.emit.call_deferred(ConnectionStatus.JOINED)
|
||||||
|
|
||||||
func _on_peer_connected(id: int) -> void:
|
func _exit_tree() -> void:
|
||||||
$Label.text += "connected to id: " + str(id)
|
disconnect_from_server()
|
||||||
|
|
||||||
func _get_client_string(remote_code: String, session_id: String, client_id: String, client_name: String) -> PackedByteArray:
|
func connect_to_server(text: String) -> void:
|
||||||
return "{remote_code}:{session_id}:{client_id}:{client_name}".format({
|
var err = _socket.connect_to_url(text)
|
||||||
"remote_code": remote_code,
|
if err != OK:
|
||||||
"session_id": session_id,
|
print("didn't work!")
|
||||||
"client_id": client_id,
|
|
||||||
"client_name": client_name,
|
|
||||||
}).to_utf8_buffer()
|
|
||||||
|
|
||||||
func _disconnect_from_lobby() -> void:
|
func disconnect_from_server() -> void:
|
||||||
if _is_in_lobby:
|
_socket.close()
|
||||||
_udp.put_packet(_get_client_string(MSG_LEAVE_LOBBY, _session_id, _client_id, _client_name))
|
disconnected_from_server.emit()
|
||||||
_udp.close()
|
connection_status_changed.emit(ConnectionStatus.DISCONNECTED)
|
||||||
|
|
||||||
func _write_output(text: String) -> void:
|
func create_lobby(client_name: String) -> void:
|
||||||
output.text += text + "\n"
|
_client_name = client_name
|
||||||
|
|
||||||
func _on_lobby_connected() -> void:
|
_send_message(TCPMessages.create_lobby(client_name))
|
||||||
_is_in_lobby = true
|
|
||||||
create_lobby_button.disabled = true
|
|
||||||
join_lobby_button.disabled = true
|
|
||||||
disconnect_lobby_button.disabled = false
|
|
||||||
|
|
||||||
func _on_lobby_disconnected() -> void:
|
func join_lobby(lobby_id: String, client_name: String) -> void:
|
||||||
_write_output("Connection with lobby {session_id} ended.".format({
|
_lobby_id = lobby_id
|
||||||
"session_id": _session_id
|
_client_name = client_name
|
||||||
|
|
||||||
|
_send_message(TCPMessages.join_lobby(_lobby_id, client_name))
|
||||||
|
connection_status_changed.emit.call_deferred(ConnectionStatus.ATTEMPTING_JOIN)
|
||||||
|
|
||||||
|
func leave_lobby() -> void:
|
||||||
|
_send_message(TCPMessages.leave_lobby(_lobby_id, _client_id))
|
||||||
|
|
||||||
|
_lobby_id = ""
|
||||||
|
_client_id = ""
|
||||||
|
_client_name = ""
|
||||||
|
|
||||||
|
disconnected_from_lobby.emit.call_deferred()
|
||||||
|
connection_status_changed.emit.call_deferred(ConnectionStatus.LOBBYLESS)
|
||||||
|
|
||||||
|
func send_chat_message(message: String) -> void:
|
||||||
|
#_send_message(TCPMessages.send_chat_message(_lobby_id, _client_id, message))
|
||||||
|
pass
|
||||||
|
|
||||||
|
func start_game() -> void:
|
||||||
|
_send_message(JSON.stringify({
|
||||||
|
"response": "start_game",
|
||||||
|
"lobby_id": _lobby_id,
|
||||||
|
"cards": CardManager.get_shuffled_cards(_connected_client_ids, 1),
|
||||||
}))
|
}))
|
||||||
_udp.close()
|
|
||||||
_is_in_lobby = false
|
|
||||||
name_input.editable = true
|
|
||||||
session_code_input.editable = true
|
|
||||||
session_code_input.text = ""
|
|
||||||
_session_id = ""
|
|
||||||
create_lobby_button.disabled = false
|
|
||||||
join_lobby_button.disabled = false
|
|
||||||
disconnect_lobby_button.disabled = true
|
|
||||||
|
|
||||||
# Create new session
|
func start_next_play() -> void:
|
||||||
func _on_create_lobby_button_pressed() -> void:
|
_send_message(JSON.stringify({
|
||||||
_udp.set_dest_address(_address, _port)
|
"response": "start_next_play",
|
||||||
_session_id = _generate_code()
|
"lobby_id": _lobby_id,
|
||||||
session_code_input.text = _session_id
|
}))
|
||||||
name_input.editable = false
|
|
||||||
session_code_input.editable = false
|
|
||||||
_client_id = _generate_code()
|
|
||||||
_client_name = name_input.text.strip_edges()
|
|
||||||
|
|
||||||
_udp.put_packet(_get_client_string(MSG_CREATE_LOBBY, _session_id, _client_id, _client_name))
|
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),
|
||||||
|
}))
|
||||||
|
|
||||||
# Connect to existing session
|
func end_game() -> void:
|
||||||
func _on_join_lobby_button_pressed() -> void:
|
_send_message(JSON.stringify({
|
||||||
_udp.set_dest_address(_address, _port)
|
"response": "end_game",
|
||||||
name_input.editable = false
|
"lobby_id": _lobby_id,
|
||||||
session_code_input.editable = false
|
}))
|
||||||
|
|
||||||
_session_id = session_code_input.text.strip_edges()
|
func play_card(card_id: int) -> void:
|
||||||
_client_id = _generate_code()
|
_send_message(JSON.stringify({
|
||||||
_client_name = name_input.text.strip_edges()
|
"response": "play_card",
|
||||||
|
"lobby_id": _lobby_id,
|
||||||
|
"client_id": _client_id,
|
||||||
|
"played_card": card_id,
|
||||||
|
}))
|
||||||
|
|
||||||
_udp.put_packet(_get_client_string(MSG_JOIN_LOBBY, _session_id, _client_id, _client_name))
|
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 _on_disconnect_lobby_button_pressed() -> void:
|
func submit_play_winner(winning_client_id: String) -> void:
|
||||||
_disconnect_from_lobby()
|
_send_message(JSON.stringify({
|
||||||
_on_lobby_disconnected()
|
"response": "submit_play_winner",
|
||||||
|
"lobby_id": _lobby_id,
|
||||||
|
"client_id": winning_client_id,
|
||||||
|
}))
|
||||||
|
request_next_play.emit.call_deferred()
|
||||||
|
#request_next_round.emit.call_deferred()
|
||||||
|
|
||||||
|
func _send_message(message: String) -> void:
|
||||||
|
_socket.send_text(message)
|
||||||
|
|
||||||
|
func _on_chat_panel_message_sent(message: String) -> void:
|
||||||
|
_send_message(TCPMessages.send_chat_message(_lobby_id, _client_id, message))
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
uid://bfaxxdr7v0emr
|
uid://p5gvnyhjqe6o
|
||||||
|
|||||||
@@ -1,311 +0,0 @@
|
|||||||
class_name WebClientTCP
|
|
||||||
extends Node
|
|
||||||
|
|
||||||
## Sender tag for system messages displayed in the chat
|
|
||||||
const SENDER_SYSTEM: String = "SYSTEM"
|
|
||||||
|
|
||||||
#var _tcp := StreamPeerTCP.new()
|
|
||||||
var _socket := WebSocketPeer.new()
|
|
||||||
|
|
||||||
var _new_status: int = WebSocketPeer.STATE_CLOSED
|
|
||||||
var _processed_status: int = -1
|
|
||||||
|
|
||||||
var _lobby_id: String
|
|
||||||
var _client_id: String
|
|
||||||
var _client_name: String
|
|
||||||
|
|
||||||
var received_data: Array
|
|
||||||
var cached_response: String
|
|
||||||
|
|
||||||
var _thread: Thread
|
|
||||||
var _stop_thread: bool = false
|
|
||||||
|
|
||||||
var _is_first_play: bool = false
|
|
||||||
|
|
||||||
var _connected_client_ids: Array[String] = []
|
|
||||||
var _connected_client_names: Array[String] = []
|
|
||||||
|
|
||||||
signal connected_to_server()
|
|
||||||
signal connection_error_occurred()
|
|
||||||
signal disconnected_from_server()
|
|
||||||
|
|
||||||
signal connected_to_lobby(lobby_id: String)
|
|
||||||
signal disconnected_from_lobby()
|
|
||||||
signal received_client_id(client_id: String)
|
|
||||||
|
|
||||||
signal client_joined_lobby(client_name: String, connected_client_names: Array[String])
|
|
||||||
signal client_left_lobby(client_name: String, connected_client_names: Array[String])
|
|
||||||
|
|
||||||
signal received_connection_message(message: String)
|
|
||||||
signal received_chat_message(client_name: String, message: String)
|
|
||||||
|
|
||||||
signal connection_status_changed(new_status: ConnectionStatus)
|
|
||||||
|
|
||||||
# This signal is messy as fuck
|
|
||||||
signal client_order_received(client_ids: Array[String], client_ids_playing_order: Array[String], client_names: Array[String])
|
|
||||||
|
|
||||||
signal client_played_card(client_id: String, card_id: int)
|
|
||||||
signal received_expected_bet(client_id: String, expected_bet: int)
|
|
||||||
signal new_round_started()
|
|
||||||
signal cards_received(cards: Dictionary)
|
|
||||||
signal trump_received(trump_id: int)
|
|
||||||
signal received_bet_request(disallowed_bet: int, current_round: int)
|
|
||||||
signal received_win()
|
|
||||||
signal received_winning_client(client_id: String)
|
|
||||||
signal notify_play_card_request()
|
|
||||||
signal reset_first_card()
|
|
||||||
signal received_first_card(card_id: int)
|
|
||||||
signal received_played_card(client_id: String, card_id: int)
|
|
||||||
signal received_play_winner_request()
|
|
||||||
signal received_end_game_request()
|
|
||||||
signal request_next_play()
|
|
||||||
signal request_next_round()
|
|
||||||
|
|
||||||
# new signals
|
|
||||||
## Emitted when a message that needs to be displayed to the player has been received.
|
|
||||||
signal user_message_received(sender: String, message: String)
|
|
||||||
|
|
||||||
enum ConnectionStatus {
|
|
||||||
DISCONNECTED,
|
|
||||||
ATTEMPTING_CONNECTION,
|
|
||||||
LOBBYLESS, # == connected
|
|
||||||
ATTEMPTING_JOIN,
|
|
||||||
JOINED,
|
|
||||||
}
|
|
||||||
|
|
||||||
func _process(_delta: float) -> void:
|
|
||||||
_socket.poll()
|
|
||||||
_new_status = _socket.get_ready_state()
|
|
||||||
if not _processed_status == _new_status:
|
|
||||||
match _new_status:
|
|
||||||
WebSocketPeer.STATE_OPEN:
|
|
||||||
print("open")
|
|
||||||
_stop_thread = false
|
|
||||||
#_thread = Thread.new()
|
|
||||||
#_thread.start(_listen_for_data)
|
|
||||||
connected_to_server.emit()
|
|
||||||
connection_status_changed.emit(ConnectionStatus.LOBBYLESS)
|
|
||||||
WebSocketPeer.STATE_CONNECTING:
|
|
||||||
print("connecting")
|
|
||||||
connection_status_changed.emit(ConnectionStatus.ATTEMPTING_CONNECTION)
|
|
||||||
WebSocketPeer.STATE_CLOSING:
|
|
||||||
print("closing")
|
|
||||||
pass
|
|
||||||
WebSocketPeer.STATE_CLOSED:
|
|
||||||
print("closed")
|
|
||||||
#_clean_up_thread()
|
|
||||||
connection_status_changed.emit(ConnectionStatus.DISCONNECTED)
|
|
||||||
|
|
||||||
_processed_status = _new_status
|
|
||||||
|
|
||||||
if _processed_status == WebSocketPeer.STATE_OPEN:
|
|
||||||
while _socket.get_available_packet_count():
|
|
||||||
cached_response = _socket.get_packet().get_string_from_utf8()
|
|
||||||
#print(cached_response)
|
|
||||||
#cached_response += (received_data[1] as PackedByteArray).get_string_from_utf8()
|
|
||||||
if cached_response.ends_with("}"):
|
|
||||||
#print(cached_response)
|
|
||||||
_handle_response(cached_response)
|
|
||||||
cached_response = ""
|
|
||||||
|
|
||||||
func _listen_for_data() -> void:
|
|
||||||
while true:
|
|
||||||
if _socket.get_available_packet_count():
|
|
||||||
cached_response = _socket.get_packet().get_string_from_utf8()
|
|
||||||
print(cached_response)
|
|
||||||
if cached_response.ends_with("}"):
|
|
||||||
_handle_response(cached_response)
|
|
||||||
cached_response = ""
|
|
||||||
|
|
||||||
func _handle_response(response: String) -> void:
|
|
||||||
var data = JSON.parse_string(response)
|
|
||||||
match data["response"]:
|
|
||||||
"create_lobby":
|
|
||||||
if data["status"] == "ok":
|
|
||||||
_lobby_id = data["lobby_id"]
|
|
||||||
_client_id = data["client_id"]
|
|
||||||
received_client_id.emit.call_deferred(_client_id)
|
|
||||||
connected_to_lobby.emit.call_deferred(_lobby_id)
|
|
||||||
connection_status_changed.emit.call_deferred(ConnectionStatus.JOINED)
|
|
||||||
"join_lobby_response":
|
|
||||||
_handle_join(data)
|
|
||||||
"client_joined_lobby":
|
|
||||||
print(data["connected_client_ids"])
|
|
||||||
_connected_client_ids.assign(data["connected_client_ids"])
|
|
||||||
_connected_client_names.assign(data["connected_client_names"])
|
|
||||||
client_joined_lobby.emit.call_deferred(data["new_client_name"], _connected_client_names)
|
|
||||||
"leave_lobby_request":
|
|
||||||
leave_lobby()
|
|
||||||
"leave_lobby":
|
|
||||||
if data["status"] == "ok":
|
|
||||||
client_left_lobby.emit.call_deferred(data["client_name"])
|
|
||||||
"client_left_lobby":
|
|
||||||
_connected_client_ids.assign(data["connected_client_ids"])
|
|
||||||
_connected_client_names.assign(data["connected_client_names"])
|
|
||||||
client_left_lobby.emit.call_deferred(data["client_name"], _connected_client_names)
|
|
||||||
|
|
||||||
## A chat message has been received
|
|
||||||
"receive_chat_message":
|
|
||||||
# Relay message to be displayed in the chat panel
|
|
||||||
user_message_received.emit.call_deferred(data["client_name"], data["message"])
|
|
||||||
|
|
||||||
"new_round_started":
|
|
||||||
if data["current_round"] == 1:
|
|
||||||
var playing_order: Array[String] = []
|
|
||||||
playing_order.assign(data["playing_order"])
|
|
||||||
client_order_received.emit.call_deferred(playing_order, _connected_client_ids, _connected_client_names)
|
|
||||||
|
|
||||||
var received_cards = data["cards"]
|
|
||||||
new_round_started.emit.call_deferred()
|
|
||||||
cards_received.emit.call_deferred(received_cards)
|
|
||||||
trump_received.emit.call_deferred(data["trump"])
|
|
||||||
"client_submitted_bet":
|
|
||||||
received_expected_bet.emit.call_deferred(
|
|
||||||
data["client_id"],
|
|
||||||
data["bet"],
|
|
||||||
)
|
|
||||||
"request_bet":
|
|
||||||
received_bet_request.emit.call_deferred(data["disallowed_bet"], data["round"])
|
|
||||||
"begin_playing_cards":
|
|
||||||
# all players know it's time to play
|
|
||||||
print(data)
|
|
||||||
_is_first_play = true
|
|
||||||
reset_first_card.emit.call_deferred()
|
|
||||||
"request_card":
|
|
||||||
# individual player asked to play card
|
|
||||||
notify_play_card_request.emit.call_deferred()
|
|
||||||
"begin_next_play":
|
|
||||||
print("beginning next play!")
|
|
||||||
_is_first_play = true
|
|
||||||
reset_first_card.emit.call_deferred()
|
|
||||||
"play_card":
|
|
||||||
print(data)
|
|
||||||
#client_played_card.emit.call_deferred(data["client_id"], data["played_card"])
|
|
||||||
"determine_play_winner_request": # single card go-around
|
|
||||||
received_play_winner_request.emit.call_deferred()
|
|
||||||
"end_game_request":
|
|
||||||
received_end_game_request.emit.call_deferred()
|
|
||||||
"client_played_card":
|
|
||||||
print("RECEIVED FOLLOWING CARD ID: " + str(data["played_card"]))
|
|
||||||
if _is_first_play:
|
|
||||||
print("set first card")
|
|
||||||
received_first_card.emit.call_deferred(data["played_card"])
|
|
||||||
if not CardManager.get_card_color(data["played_card"]) == Card.CardColor.WHITE:
|
|
||||||
_is_first_play = false
|
|
||||||
received_played_card.emit.call_deferred(data["client_id"], data["played_card"])
|
|
||||||
"client_won_play":
|
|
||||||
if data["client_id"] == _client_id:
|
|
||||||
received_win.emit.call_deferred()
|
|
||||||
received_winning_client.emit.call_deferred(data["client_id"])
|
|
||||||
|
|
||||||
func _handle_join(data) -> void:
|
|
||||||
match data["status"]:
|
|
||||||
"lobby_not_found":
|
|
||||||
received_connection_message.emit.call_deferred("Could not join; lobby does not exist")
|
|
||||||
connection_status_changed.emit.call_deferred(ConnectionStatus.LOBBYLESS)
|
|
||||||
"lobby_full":
|
|
||||||
received_connection_message.emit.call_deferred("Could not join; lobby is full")
|
|
||||||
connection_status_changed.emit.call_deferred(ConnectionStatus.LOBBYLESS)
|
|
||||||
"ok":
|
|
||||||
_client_id = data["client_id"]
|
|
||||||
connected_to_lobby.emit.call_deferred(_lobby_id)
|
|
||||||
received_client_id.emit.call_deferred(_client_id)
|
|
||||||
connection_status_changed.emit.call_deferred(ConnectionStatus.JOINED)
|
|
||||||
|
|
||||||
func _exit_tree() -> void:
|
|
||||||
disconnect_from_server()
|
|
||||||
|
|
||||||
func connect_to_server(text: String) -> void:
|
|
||||||
var err = _socket.connect_to_url(text)
|
|
||||||
if err != OK:
|
|
||||||
print("didn't work!")
|
|
||||||
|
|
||||||
func disconnect_from_server() -> void:
|
|
||||||
_socket.close()
|
|
||||||
disconnected_from_server.emit()
|
|
||||||
connection_status_changed.emit(ConnectionStatus.DISCONNECTED)
|
|
||||||
|
|
||||||
func create_lobby(client_name: String) -> void:
|
|
||||||
_client_name = client_name
|
|
||||||
|
|
||||||
_send_message(TCPMessages.create_lobby(client_name))
|
|
||||||
|
|
||||||
func join_lobby(lobby_id: String, client_name: String) -> void:
|
|
||||||
_lobby_id = lobby_id
|
|
||||||
_client_name = client_name
|
|
||||||
|
|
||||||
_send_message(TCPMessages.join_lobby(_lobby_id, client_name))
|
|
||||||
connection_status_changed.emit.call_deferred(ConnectionStatus.ATTEMPTING_JOIN)
|
|
||||||
|
|
||||||
func leave_lobby() -> void:
|
|
||||||
_send_message(TCPMessages.leave_lobby(_lobby_id, _client_id))
|
|
||||||
|
|
||||||
_lobby_id = ""
|
|
||||||
_client_id = ""
|
|
||||||
_client_name = ""
|
|
||||||
|
|
||||||
disconnected_from_lobby.emit.call_deferred()
|
|
||||||
connection_status_changed.emit.call_deferred(ConnectionStatus.LOBBYLESS)
|
|
||||||
|
|
||||||
func send_chat_message(message: String) -> void:
|
|
||||||
#_send_message(TCPMessages.send_chat_message(_lobby_id, _client_id, message))
|
|
||||||
pass
|
|
||||||
|
|
||||||
func start_game() -> void:
|
|
||||||
_send_message(JSON.stringify({
|
|
||||||
"response": "start_game",
|
|
||||||
"lobby_id": _lobby_id,
|
|
||||||
"cards": CardManager.get_shuffled_cards(_connected_client_ids, 1),
|
|
||||||
}))
|
|
||||||
|
|
||||||
func start_next_play() -> void:
|
|
||||||
_send_message(JSON.stringify({
|
|
||||||
"response": "start_next_play",
|
|
||||||
"lobby_id": _lobby_id,
|
|
||||||
}))
|
|
||||||
|
|
||||||
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 end_game() -> void:
|
|
||||||
_send_message(JSON.stringify({
|
|
||||||
"response": "end_game",
|
|
||||||
"lobby_id": _lobby_id,
|
|
||||||
}))
|
|
||||||
|
|
||||||
func play_card(card_id: int) -> void:
|
|
||||||
_send_message(JSON.stringify({
|
|
||||||
"response": "play_card",
|
|
||||||
"lobby_id": _lobby_id,
|
|
||||||
"client_id": _client_id,
|
|
||||||
"played_card": card_id,
|
|
||||||
}))
|
|
||||||
|
|
||||||
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 submit_play_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_play.emit.call_deferred()
|
|
||||||
#request_next_round.emit.call_deferred()
|
|
||||||
|
|
||||||
func _send_message(message: String) -> void:
|
|
||||||
_socket.send_text(message)
|
|
||||||
|
|
||||||
func _on_chat_panel_message_sent(message: String) -> void:
|
|
||||||
_send_message(TCPMessages.send_chat_message(_lobby_id, _client_id, message))
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://p5gvnyhjqe6o
|
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
class_name ConnectionOverlay
|
||||||
|
extends Control
|
||||||
|
|
||||||
|
@export var status_label: Label
|
||||||
|
@export_range(1.0, 3.0, 0.1) var fade_out_duration: float = 2.0
|
||||||
|
|
||||||
|
var _period_count: int = 1
|
||||||
|
# Exclusive
|
||||||
|
var _period_max: int = 4
|
||||||
|
|
||||||
|
var _is_connected: bool = false
|
||||||
|
|
||||||
|
func _physics_process(delta: float) -> void:
|
||||||
|
if not _is_connected and Engine.get_physics_frames() % 42 == 0:
|
||||||
|
status_label.text = "Connecting to server" + ".".repeat(_period_count)
|
||||||
|
_period_count += 1
|
||||||
|
if _period_count == _period_max:
|
||||||
|
_period_count = 0
|
||||||
|
|
||||||
|
func _transition_hide() -> void:
|
||||||
|
_is_connected = true
|
||||||
|
status_label.text = "Connected!"
|
||||||
|
create_tween().set_trans(Tween.TRANS_QUAD).set_ease(Tween.EASE_IN).tween_property(self, "modulate:a", 0.0, fade_out_duration)
|
||||||
|
await get_tree().create_timer(fade_out_duration).timeout
|
||||||
|
hide()
|
||||||
|
|
||||||
|
func _on_web_client_connection_status_changed(new_status: WebClient.ConnectionStatus) -> void:
|
||||||
|
# Hides screen once connected. This does not take disconnects into consideration!
|
||||||
|
if new_status == WebClient.ConnectionStatus.LOBBYLESS:
|
||||||
|
_transition_hide()
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
uid://b6m5e50j1syr7
|
||||||
@@ -3,7 +3,7 @@ extends Node3D
|
|||||||
|
|
||||||
var hand_associations: Dictionary[String, PlayerHand]
|
var hand_associations: Dictionary[String, PlayerHand]
|
||||||
|
|
||||||
@export var web_client: WebClientTCP
|
@export var web_client: WebClient
|
||||||
|
|
||||||
@export var card_stack: CardStack
|
@export var card_stack: CardStack
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[gd_scene load_steps=13 format=3 uid="uid://gqrdpjslr4np"]
|
[gd_scene load_steps=14 format=3 uid="uid://gqrdpjslr4np"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://p5gvnyhjqe6o" path="res://components/web_client_tcp.gd" id="1_feb5d"]
|
[ext_resource type="Script" uid="uid://p5gvnyhjqe6o" path="res://components/web_client.gd" id="1_feb5d"]
|
||||||
[ext_resource type="Script" uid="uid://c0cqkatyo4uj1" path="res://components/client_interface.gd" id="2_e2o6t"]
|
[ext_resource type="Script" uid="uid://c0cqkatyo4uj1" path="res://components/client_interface.gd" id="2_e2o6t"]
|
||||||
[ext_resource type="Theme" uid="uid://7bv5whocnq53" path="res://theme.tres" id="2_hve3p"]
|
[ext_resource type="Theme" uid="uid://7bv5whocnq53" path="res://theme.tres" id="2_hve3p"]
|
||||||
[ext_resource type="Script" uid="uid://utt8atbh7b2a" path="res://game_client.gd" id="3_feb5d"]
|
[ext_resource type="Script" uid="uid://utt8atbh7b2a" path="res://game_client.gd" id="3_feb5d"]
|
||||||
@@ -8,6 +8,7 @@
|
|||||||
[ext_resource type="PackedScene" uid="uid://jlovgr2iojrg" path="res://elements/player_hand.tscn" id="4_fc0e3"]
|
[ext_resource type="PackedScene" uid="uid://jlovgr2iojrg" path="res://elements/player_hand.tscn" id="4_fc0e3"]
|
||||||
[ext_resource type="Script" uid="uid://bfhknl0awlj22" path="res://chat_panel.gd" id="4_iotsf"]
|
[ext_resource type="Script" uid="uid://bfhknl0awlj22" path="res://chat_panel.gd" id="4_iotsf"]
|
||||||
[ext_resource type="Script" uid="uid://bokp83oigikj2" path="res://number_input.gd" id="4_vef74"]
|
[ext_resource type="Script" uid="uid://bokp83oigikj2" path="res://number_input.gd" id="4_vef74"]
|
||||||
|
[ext_resource type="Script" uid="uid://b6m5e50j1syr7" path="res://connection_overlay.gd" id="5_iotsf"]
|
||||||
[ext_resource type="PackedScene" uid="uid://b55xpcxk7g5ph" path="res://cards/playing_card.tscn" id="6_eow3j"]
|
[ext_resource type="PackedScene" uid="uid://b55xpcxk7g5ph" path="res://cards/playing_card.tscn" id="6_eow3j"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dj1wye7o27vil" path="res://assets/table.glb" id="7_eow3j"]
|
[ext_resource type="PackedScene" uid="uid://dj1wye7o27vil" path="res://assets/table.glb" id="7_eow3j"]
|
||||||
[ext_resource type="Script" uid="uid://c5bk4gjeyh7vy" path="res://card_stack.gd" id="8_j5wjh"]
|
[ext_resource type="Script" uid="uid://c5bk4gjeyh7vy" path="res://card_stack.gd" id="8_j5wjh"]
|
||||||
@@ -19,8 +20,9 @@ ambient_light_energy = 0.15
|
|||||||
|
|
||||||
[node name="Game" type="Node"]
|
[node name="Game" type="Node"]
|
||||||
|
|
||||||
[node name="WebClient" type="Node" parent="."]
|
[node name="WebClient" type="Node" parent="." node_paths=PackedStringArray("chat_panel")]
|
||||||
script = ExtResource("1_feb5d")
|
script = ExtResource("1_feb5d")
|
||||||
|
chat_panel = NodePath("../Interface/ChatPanel")
|
||||||
|
|
||||||
[node name="Interface" type="Control" parent="."]
|
[node name="Interface" type="Control" parent="."]
|
||||||
layout_mode = 3
|
layout_mode = 3
|
||||||
@@ -32,7 +34,7 @@ grow_vertical = 2
|
|||||||
theme = ExtResource("2_hve3p")
|
theme = ExtResource("2_hve3p")
|
||||||
metadata/_edit_use_anchors_ = true
|
metadata/_edit_use_anchors_ = true
|
||||||
|
|
||||||
[node name="ClientInterface" type="ColorRect" parent="Interface" node_paths=PackedStringArray("client", "connect_button", "create_lobby_button", "join_lobby_button", "leave_lobby_button", "chat_message_input", "send_chat_message_button", "connected_players_label", "name_input", "lobby_code_input")]
|
[node name="ClientInterface" type="ColorRect" parent="Interface" node_paths=PackedStringArray("client", "create_lobby_button", "join_lobby_button", "leave_lobby_button", "connected_players_label", "name_input", "lobby_code_input")]
|
||||||
custom_minimum_size = Vector2(316, 0)
|
custom_minimum_size = Vector2(316, 0)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
offset_right = 316.0
|
offset_right = 316.0
|
||||||
@@ -40,12 +42,9 @@ offset_bottom = 429.0
|
|||||||
color = Color(0.26, 0.2236, 0.230273, 1)
|
color = Color(0.26, 0.2236, 0.230273, 1)
|
||||||
script = ExtResource("2_e2o6t")
|
script = ExtResource("2_e2o6t")
|
||||||
client = NodePath("../../WebClient")
|
client = NodePath("../../WebClient")
|
||||||
connect_button = NodePath("MarginContainer/VBoxContainer/ServerInputs/ConnectButton")
|
|
||||||
create_lobby_button = NodePath("MarginContainer/VBoxContainer/ServerInputs/CreateLobbyButton")
|
create_lobby_button = NodePath("MarginContainer/VBoxContainer/ServerInputs/CreateLobbyButton")
|
||||||
join_lobby_button = NodePath("MarginContainer/VBoxContainer/ServerInputs/JoinLobbyButton")
|
join_lobby_button = NodePath("MarginContainer/VBoxContainer/ServerInputs/JoinLobbyButton")
|
||||||
leave_lobby_button = NodePath("MarginContainer/VBoxContainer/ServerInputs/LeaveLobbyButton")
|
leave_lobby_button = NodePath("MarginContainer/VBoxContainer/ServerInputs/LeaveLobbyButton")
|
||||||
chat_message_input = NodePath("../ChatPanel/InputContainer/MessageInput")
|
|
||||||
send_chat_message_button = NodePath("../ChatPanel/InputContainer/SendMessageButton")
|
|
||||||
connected_players_label = NodePath("MarginContainer/VBoxContainer/ConnectedPlayersLabel")
|
connected_players_label = NodePath("MarginContainer/VBoxContainer/ConnectedPlayersLabel")
|
||||||
name_input = NodePath("MarginContainer/VBoxContainer/ServerInputs/NameInput")
|
name_input = NodePath("MarginContainer/VBoxContainer/ServerInputs/NameInput")
|
||||||
lobby_code_input = NodePath("MarginContainer/VBoxContainer/ServerInputs/LobbyCodeInput")
|
lobby_code_input = NodePath("MarginContainer/VBoxContainer/ServerInputs/LobbyCodeInput")
|
||||||
@@ -69,15 +68,6 @@ layout_mode = 2
|
|||||||
custom_minimum_size = Vector2(300, 0)
|
custom_minimum_size = Vector2(300, 0)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
|
||||||
[node name="URLInput" type="LineEdit" parent="Interface/ClientInterface/MarginContainer/VBoxContainer/ServerInputs"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "127.0.0.1:9974"
|
|
||||||
placeholder_text = "URL"
|
|
||||||
|
|
||||||
[node name="ConnectButton" type="Button" parent="Interface/ClientInterface/MarginContainer/VBoxContainer/ServerInputs"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "Connect to Server"
|
|
||||||
|
|
||||||
[node name="NameInput" type="LineEdit" parent="Interface/ClientInterface/MarginContainer/VBoxContainer/ServerInputs"]
|
[node name="NameInput" type="LineEdit" parent="Interface/ClientInterface/MarginContainer/VBoxContainer/ServerInputs"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
placeholder_text = "Your Name"
|
placeholder_text = "Your Name"
|
||||||
@@ -112,6 +102,8 @@ anchors_preset = -1
|
|||||||
anchor_top = 0.478704
|
anchor_top = 0.478704
|
||||||
anchor_right = 0.234375
|
anchor_right = 0.234375
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
|
offset_right = -130.0
|
||||||
|
offset_bottom = 0.000244141
|
||||||
grow_vertical = 0
|
grow_vertical = 0
|
||||||
script = ExtResource("4_iotsf")
|
script = ExtResource("4_iotsf")
|
||||||
auto_scroll_duration = 0.4
|
auto_scroll_duration = 0.4
|
||||||
@@ -130,136 +122,9 @@ vertical_scroll_mode = 4
|
|||||||
[node name="MessageContainer" type="VBoxContainer" parent="Interface/ChatPanel/ScrollContainer"]
|
[node name="MessageContainer" type="VBoxContainer" parent="Interface/ChatPanel/ScrollContainer"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
|
size_flags_vertical = 3
|
||||||
alignment = 2
|
alignment = 2
|
||||||
|
|
||||||
[node name="Label" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label2" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label3" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label4" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label5" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label6" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label7" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label8" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label9" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label10" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label11" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label12" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label13" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label14" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label15" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label16" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label17" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label18" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label19" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label20" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label21" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label22" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label23" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label24" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label25" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label26" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label27" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label28" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label29" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label30" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label31" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="Label32" type="Label" parent="Interface/ChatPanel/ScrollContainer/MessageContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "asdf"
|
|
||||||
|
|
||||||
[node name="InputContainer" type="HBoxContainer" parent="Interface/ChatPanel"]
|
[node name="InputContainer" type="HBoxContainer" parent="Interface/ChatPanel"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
|
||||||
@@ -272,6 +137,43 @@ placeholder_text = "Type chat message here"
|
|||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
text = "Send"
|
text = "Send"
|
||||||
|
|
||||||
|
[node name="LobbyPanel" type="Control" parent="Interface"]
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 0
|
||||||
|
offset_right = 40.0
|
||||||
|
offset_bottom = 40.0
|
||||||
|
|
||||||
|
[node name="ConnectionOverlay" type="Control" parent="Interface" node_paths=PackedStringArray("status_label")]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
script = ExtResource("5_iotsf")
|
||||||
|
status_label = NodePath("StatusLabel")
|
||||||
|
|
||||||
|
[node name="ColorRect" type="ColorRect" parent="Interface/ConnectionOverlay"]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
color = Color(0.47451, 0.180392, 0.603922, 1)
|
||||||
|
|
||||||
|
[node name="StatusLabel" type="Label" parent="Interface/ConnectionOverlay"]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
theme_override_font_sizes/font_size = 28
|
||||||
|
text = "Connecting to server"
|
||||||
|
horizontal_alignment = 1
|
||||||
|
vertical_alignment = 1
|
||||||
|
|
||||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||||
anchors_preset = 15
|
anchors_preset = 15
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
@@ -476,6 +378,8 @@ playing_card_scene = ExtResource("6_eow3j")
|
|||||||
[connection signal="connected_to_server" from="WebClient" to="Interface/ClientInterface" method="_on_web_client_tcp_connected_to_server"]
|
[connection signal="connected_to_server" from="WebClient" to="Interface/ClientInterface" method="_on_web_client_tcp_connected_to_server"]
|
||||||
[connection signal="connection_error_occurred" from="WebClient" to="Interface/ClientInterface" method="_on_web_client_tcp_connection_error_occurred"]
|
[connection signal="connection_error_occurred" from="WebClient" to="Interface/ClientInterface" method="_on_web_client_tcp_connection_error_occurred"]
|
||||||
[connection signal="connection_status_changed" from="WebClient" to="Interface/ClientInterface" method="_on_web_client_tcp_connection_status_changed"]
|
[connection signal="connection_status_changed" from="WebClient" to="Interface/ClientInterface" method="_on_web_client_tcp_connection_status_changed"]
|
||||||
|
[connection signal="connection_status_changed" from="WebClient" to="Interface/ChatPanel" method="_on_web_client_connection_status_changed"]
|
||||||
|
[connection signal="connection_status_changed" from="WebClient" to="Interface/ConnectionOverlay" method="_on_web_client_connection_status_changed"]
|
||||||
[connection signal="disconnected_from_lobby" from="WebClient" to="Interface/ClientInterface" method="_on_web_client_tcp_disconnected_from_lobby"]
|
[connection signal="disconnected_from_lobby" from="WebClient" to="Interface/ClientInterface" method="_on_web_client_tcp_disconnected_from_lobby"]
|
||||||
[connection signal="disconnected_from_server" from="WebClient" to="Interface/ClientInterface" method="_on_web_client_tcp_disconnected_from_server"]
|
[connection signal="disconnected_from_server" from="WebClient" to="Interface/ClientInterface" method="_on_web_client_tcp_disconnected_from_server"]
|
||||||
[connection signal="new_round_started" from="WebClient" to="EnvironmentManager" method="_on_web_client_tcp_new_round_started"]
|
[connection signal="new_round_started" from="WebClient" to="EnvironmentManager" method="_on_web_client_tcp_new_round_started"]
|
||||||
@@ -497,8 +401,6 @@ playing_card_scene = ExtResource("6_eow3j")
|
|||||||
[connection signal="reset_first_card" from="WebClient" to="EnvironmentManager/PlayerHand0" method="_on_web_client_tcp_reset_first_card"]
|
[connection signal="reset_first_card" from="WebClient" to="EnvironmentManager/PlayerHand0" method="_on_web_client_tcp_reset_first_card"]
|
||||||
[connection signal="trump_received" from="WebClient" to="EnvironmentManager" method="_on_web_client_tcp_trump_received"]
|
[connection signal="trump_received" from="WebClient" to="EnvironmentManager" method="_on_web_client_tcp_trump_received"]
|
||||||
[connection signal="trump_received" from="WebClient" to="EnvironmentManager/PlayerHand0" method="_on_web_client_tcp_trump_received"]
|
[connection signal="trump_received" from="WebClient" to="EnvironmentManager/PlayerHand0" method="_on_web_client_tcp_trump_received"]
|
||||||
[connection signal="user_message_received" from="WebClient" to="Interface/ChatPanel" method="_on_web_client_user_message_received"]
|
|
||||||
[connection signal="pressed" from="Interface/ClientInterface/MarginContainer/VBoxContainer/ServerInputs/ConnectButton" to="Interface/ClientInterface" method="_on_connect_button_pressed"]
|
|
||||||
[connection signal="pressed" from="Interface/ClientInterface/MarginContainer/VBoxContainer/ServerInputs/CreateLobbyButton" to="Interface/ClientInterface" method="_on_create_lobby_button_pressed"]
|
[connection signal="pressed" from="Interface/ClientInterface/MarginContainer/VBoxContainer/ServerInputs/CreateLobbyButton" to="Interface/ClientInterface" method="_on_create_lobby_button_pressed"]
|
||||||
[connection signal="pressed" from="Interface/ClientInterface/MarginContainer/VBoxContainer/ServerInputs/CreateLobbyButton" to="HBoxContainer/GameUI" method="_on_create_lobby_button_pressed"]
|
[connection signal="pressed" from="Interface/ClientInterface/MarginContainer/VBoxContainer/ServerInputs/CreateLobbyButton" to="HBoxContainer/GameUI" method="_on_create_lobby_button_pressed"]
|
||||||
[connection signal="pressed" from="Interface/ClientInterface/MarginContainer/VBoxContainer/ServerInputs/JoinLobbyButton" to="Interface/ClientInterface" method="_on_join_lobby_button_pressed"]
|
[connection signal="pressed" from="Interface/ClientInterface/MarginContainer/VBoxContainer/ServerInputs/JoinLobbyButton" to="Interface/ClientInterface" method="_on_join_lobby_button_pressed"]
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
class_name GameClient
|
class_name GameClient
|
||||||
extends Node
|
extends Node
|
||||||
|
|
||||||
@export var web_client: WebClientTCP
|
@export var web_client: WebClient
|
||||||
@export var start_game_button: Button
|
@export var start_game_button: Button
|
||||||
@export var play_card_button: Button
|
@export var play_card_button: Button
|
||||||
@export var bet_container: Control
|
@export var bet_container: Control
|
||||||
|
|||||||
Reference in New Issue
Block a user