server: added SSL context for running on remote server

This commit is contained in:
2025-07-06 19:49:08 +02:00
parent 958be7e1ce
commit 05e5acd503
6 changed files with 318 additions and 88 deletions
+64 -36
View File
@@ -13,15 +13,19 @@ font_weight = 500
[node name="WebClientTCP" type="Node" parent="."]
script = ExtResource("1_feb5d")
[node name="ClientInterface" type="ColorRect" parent="." node_paths=PackedStringArray("client", "game_client", "connect_button", "create_lobby_button", "join_lobby_button", "leave_lobby_button", "chat_message_input", "send_chat_message_button", "name_input", "lobby_code_input", "output")]
anchors_preset = 9
[node name="HBoxContainer" type="HBoxContainer" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_right = 362.0
grow_horizontal = 2
grow_vertical = 2
[node name="ClientInterface" type="ColorRect" parent="HBoxContainer" node_paths=PackedStringArray("client", "connect_button", "create_lobby_button", "join_lobby_button", "leave_lobby_button", "chat_message_input", "send_chat_message_button", "name_input", "lobby_code_input", "output")]
custom_minimum_size = Vector2(316, 0)
layout_mode = 2
color = Color(0.26, 0.2236, 0.230273, 1)
script = ExtResource("2_e2o6t")
client = NodePath("../WebClientTCP")
game_client = NodePath("../GameClient")
client = NodePath("../../WebClientTCP")
connect_button = NodePath("MarginContainer/VBoxContainer/VBoxContainer/ConnectButton")
create_lobby_button = NodePath("MarginContainer/VBoxContainer/VBoxContainer/CreateLobbyButton")
join_lobby_button = NodePath("MarginContainer/VBoxContainer/VBoxContainer/JoinLobbyButton")
@@ -32,7 +36,7 @@ name_input = NodePath("MarginContainer/VBoxContainer/VBoxContainer/NameInput")
lobby_code_input = NodePath("MarginContainer/VBoxContainer/VBoxContainer/LobbyCodeInput")
output = NodePath("MarginContainer/VBoxContainer/ScrollContainer/Output")
[node name="MarginContainer" type="MarginContainer" parent="ClientInterface"]
[node name="MarginContainer" type="MarginContainer" parent="HBoxContainer/ClientInterface"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
@@ -44,10 +48,10 @@ theme_override_constants/margin_top = 8
theme_override_constants/margin_right = 8
theme_override_constants/margin_bottom = 8
[node name="VBoxContainer" type="VBoxContainer" parent="ClientInterface/MarginContainer"]
[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer/ClientInterface/MarginContainer"]
layout_mode = 2
[node name="Label" type="RichTextLabel" parent="ClientInterface/MarginContainer/VBoxContainer"]
[node name="Label" type="RichTextLabel" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/italics_font_size = 24
theme_override_font_sizes/normal_font_size = 24
@@ -55,46 +59,50 @@ bbcode_enabled = true
text = "[i]Magician Online![/i]"
fit_content = true
[node name="VBoxContainer" type="VBoxContainer" parent="ClientInterface/MarginContainer/VBoxContainer"]
[node name="URLInput" type="LineEdit" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer"]
layout_mode = 2
placeholder_text = "URL"
[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer"]
custom_minimum_size = Vector2(300, 0)
layout_mode = 2
[node name="ConnectButton" type="Button" parent="ClientInterface/MarginContainer/VBoxContainer/VBoxContainer"]
[node name="ConnectButton" type="Button" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/VBoxContainer"]
layout_mode = 2
text = "Connect to Server"
[node name="NameInput" type="LineEdit" parent="ClientInterface/MarginContainer/VBoxContainer/VBoxContainer"]
[node name="NameInput" type="LineEdit" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/VBoxContainer"]
layout_mode = 2
placeholder_text = "Your Name"
editable = false
[node name="CreateLobbyButton" type="Button" parent="ClientInterface/MarginContainer/VBoxContainer/VBoxContainer"]
[node name="CreateLobbyButton" type="Button" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/VBoxContainer"]
layout_mode = 2
disabled = true
text = "Create Lobby"
[node name="LobbyCodeInput" type="LineEdit" parent="ClientInterface/MarginContainer/VBoxContainer/VBoxContainer"]
[node name="LobbyCodeInput" type="LineEdit" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/VBoxContainer"]
layout_mode = 2
placeholder_text = "Lobby Code"
editable = false
[node name="JoinLobbyButton" type="Button" parent="ClientInterface/MarginContainer/VBoxContainer/VBoxContainer"]
[node name="JoinLobbyButton" type="Button" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/VBoxContainer"]
layout_mode = 2
disabled = true
text = "Join Lobby"
[node name="LeaveLobbyButton" type="Button" parent="ClientInterface/MarginContainer/VBoxContainer/VBoxContainer"]
[node name="LeaveLobbyButton" type="Button" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/VBoxContainer"]
layout_mode = 2
disabled = true
text = "Disconnect"
[node name="ScrollContainer" type="ScrollContainer" parent="ClientInterface/MarginContainer/VBoxContainer"]
[node name="ScrollContainer" type="ScrollContainer" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
horizontal_scroll_mode = 0
vertical_scroll_mode = 4
[node name="Output" type="Label" parent="ClientInterface/MarginContainer/VBoxContainer/ScrollContainer"]
[node name="Output" type="Label" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/ScrollContainer"]
custom_minimum_size = Vector2(64, 1)
layout_mode = 2
size_flags_horizontal = 3
@@ -103,32 +111,52 @@ theme_override_fonts/font = SubResource("SystemFont_80nbo")
autowrap_mode = 2
metadata/_edit_lock_ = true
[node name="ChatContainer" type="HBoxContainer" parent="ClientInterface/MarginContainer/VBoxContainer"]
[node name="ChatContainer" type="HBoxContainer" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer"]
layout_mode = 2
[node name="MessageInput" type="LineEdit" parent="ClientInterface/MarginContainer/VBoxContainer/ChatContainer"]
[node name="MessageInput" type="LineEdit" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/ChatContainer"]
layout_mode = 2
size_flags_horizontal = 3
[node name="SendMessageButton" type="Button" parent="ClientInterface/MarginContainer/VBoxContainer/ChatContainer"]
[node name="SendMessageButton" type="Button" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/ChatContainer"]
layout_mode = 2
text = "Send"
[node name="GameClient" type="Node" parent="." node_paths=PackedStringArray("web_client")]
[node name="GameUI" type="Control" parent="HBoxContainer" node_paths=PackedStringArray("web_client")]
layout_mode = 2
size_flags_horizontal = 3
script = ExtResource("3_feb5d")
web_client = NodePath("../WebClientTCP")
web_client = NodePath("../../WebClientTCP")
[connection signal="client_joined_lobby" from="WebClientTCP" to="ClientInterface" method="_on_web_client_tcp_client_joined_lobby"]
[connection signal="client_left_lobby" from="WebClientTCP" to="ClientInterface" method="_on_web_client_tcp_client_left_lobby"]
[connection signal="connected_to_lobby" from="WebClientTCP" to="ClientInterface" method="_on_web_client_tcp_connected_to_lobby"]
[connection signal="connected_to_server" from="WebClientTCP" to="ClientInterface" method="_on_web_client_tcp_connected_to_server"]
[connection signal="connection_error_occurred" from="WebClientTCP" to="ClientInterface" method="_on_web_client_tcp_connection_error_occurred"]
[connection signal="connection_status_changed" from="WebClientTCP" to="ClientInterface" method="_on_web_client_tcp_connection_status_changed"]
[connection signal="disconnected_from_lobby" from="WebClientTCP" to="ClientInterface" method="_on_web_client_tcp_disconnected_from_lobby"]
[connection signal="disconnected_from_server" from="WebClientTCP" to="ClientInterface" method="_on_web_client_tcp_disconnected_from_server"]
[connection signal="received_chat_message" from="WebClientTCP" to="ClientInterface" method="_on_web_client_tcp_received_chat_message"]
[connection signal="pressed" from="ClientInterface/MarginContainer/VBoxContainer/VBoxContainer/ConnectButton" to="ClientInterface" method="_on_connect_button_pressed"]
[connection signal="pressed" from="ClientInterface/MarginContainer/VBoxContainer/VBoxContainer/CreateLobbyButton" to="ClientInterface" method="_on_create_lobby_button_pressed"]
[connection signal="pressed" from="ClientInterface/MarginContainer/VBoxContainer/VBoxContainer/JoinLobbyButton" to="ClientInterface" method="_on_join_lobby_button_pressed"]
[connection signal="pressed" from="ClientInterface/MarginContainer/VBoxContainer/VBoxContainer/LeaveLobbyButton" to="ClientInterface" method="_on_disconnect_lobby_button_pressed"]
[connection signal="pressed" from="ClientInterface/MarginContainer/VBoxContainer/ChatContainer/SendMessageButton" to="ClientInterface" method="_on_send_message_button_pressed"]
[node name="StartGameButton" type="Button" parent="HBoxContainer/GameUI"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -50.0
offset_top = -15.5
offset_right = 50.0
offset_bottom = 15.5
grow_horizontal = 2
grow_vertical = 2
text = "Start Game!"
[connection signal="client_joined_lobby" from="WebClientTCP" to="HBoxContainer/ClientInterface" method="_on_web_client_tcp_client_joined_lobby"]
[connection signal="client_left_lobby" from="WebClientTCP" to="HBoxContainer/ClientInterface" method="_on_web_client_tcp_client_left_lobby"]
[connection signal="connected_to_lobby" from="WebClientTCP" to="HBoxContainer/ClientInterface" method="_on_web_client_tcp_connected_to_lobby"]
[connection signal="connected_to_server" from="WebClientTCP" to="HBoxContainer/ClientInterface" method="_on_web_client_tcp_connected_to_server"]
[connection signal="connection_error_occurred" from="WebClientTCP" to="HBoxContainer/ClientInterface" method="_on_web_client_tcp_connection_error_occurred"]
[connection signal="connection_status_changed" from="WebClientTCP" to="HBoxContainer/ClientInterface" method="_on_web_client_tcp_connection_status_changed"]
[connection signal="disconnected_from_lobby" from="WebClientTCP" to="HBoxContainer/ClientInterface" method="_on_web_client_tcp_disconnected_from_lobby"]
[connection signal="disconnected_from_server" from="WebClientTCP" to="HBoxContainer/ClientInterface" method="_on_web_client_tcp_disconnected_from_server"]
[connection signal="received_chat_message" from="WebClientTCP" to="HBoxContainer/ClientInterface" method="_on_web_client_tcp_received_chat_message"]
[connection signal="pressed" from="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/VBoxContainer/ConnectButton" to="HBoxContainer/ClientInterface" method="_on_connect_button_pressed"]
[connection signal="pressed" from="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/VBoxContainer/CreateLobbyButton" to="HBoxContainer/ClientInterface" method="_on_create_lobby_button_pressed"]
[connection signal="pressed" from="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/VBoxContainer/CreateLobbyButton" to="HBoxContainer/GameUI" method="_on_create_lobby_button_pressed"]
[connection signal="pressed" from="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/VBoxContainer/JoinLobbyButton" to="HBoxContainer/ClientInterface" method="_on_join_lobby_button_pressed"]
[connection signal="pressed" from="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/VBoxContainer/JoinLobbyButton" to="HBoxContainer/GameUI" method="_on_join_lobby_button_pressed"]
[connection signal="pressed" from="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/VBoxContainer/LeaveLobbyButton" to="HBoxContainer/ClientInterface" method="_on_disconnect_lobby_button_pressed"]
[connection signal="pressed" from="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/ChatContainer/SendMessageButton" to="HBoxContainer/ClientInterface" method="_on_send_message_button_pressed"]
[connection signal="pressed" from="HBoxContainer/GameUI/StartGameButton" to="HBoxContainer/GameUI" method="_on_start_game_button_pressed"]