server: moved code generation from client to server to avoid code collision

This commit is contained in:
2025-07-04 10:57:24 +02:00
parent 68a152af42
commit f4a7fb722e
4 changed files with 79 additions and 65 deletions
+24 -31
View File
@@ -12,71 +12,64 @@ font_weight = 500
[node name="WebClientTCP" type="Node" parent="."]
script = ExtResource("1_feb5d")
[node name="ClientInterface" type="Control" parent="." node_paths=PackedStringArray("client", "connect_button", "create_lobby_button", "join_lobby_button", "leave_lobby_button", "name_input", "lobby_code_input", "output")]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
[node name="ClientInterface" type="ColorRect" parent="." node_paths=PackedStringArray("client", "connect_button", "create_lobby_button", "join_lobby_button", "leave_lobby_button", "name_input", "lobby_code_input", "output")]
anchors_preset = 9
anchor_bottom = 1.0
grow_horizontal = 2
offset_right = 362.0
grow_vertical = 2
color = Color(0.26, 0.2236, 0.230273, 1)
script = ExtResource("2_e2o6t")
client = NodePath("../WebClientTCP")
connect_button = NodePath("HBoxContainer/VBoxContainer/ConnectButton")
create_lobby_button = NodePath("HBoxContainer/VBoxContainer/CreateLobbyButton")
join_lobby_button = NodePath("HBoxContainer/VBoxContainer/JoinLobbyButton")
leave_lobby_button = NodePath("HBoxContainer/VBoxContainer/LeaveLobbyButton")
name_input = NodePath("HBoxContainer/VBoxContainer/NameInput")
lobby_code_input = NodePath("HBoxContainer/VBoxContainer/LobbyCodeInput")
output = NodePath("HBoxContainer/Output")
connect_button = NodePath("VBoxContainer/VBoxContainer/ConnectButton")
create_lobby_button = NodePath("VBoxContainer/VBoxContainer/CreateLobbyButton")
join_lobby_button = NodePath("VBoxContainer/VBoxContainer/JoinLobbyButton")
leave_lobby_button = NodePath("VBoxContainer/VBoxContainer/LeaveLobbyButton")
name_input = NodePath("VBoxContainer/VBoxContainer/NameInput")
lobby_code_input = NodePath("VBoxContainer/VBoxContainer/LobbyCodeInput")
output = NodePath("VBoxContainer/Output")
[node name="ColorRect" type="ColorRect" parent="ClientInterface"]
[node name="VBoxContainer" type="VBoxContainer" parent="ClientInterface"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0.34, 0.33116, 0.2992, 1)
[node name="HBoxContainer" type="HBoxContainer" parent="ClientInterface"]
layout_mode = 0
offset_right = 800.0
offset_bottom = 1080.0
[node name="VBoxContainer" type="VBoxContainer" parent="ClientInterface/HBoxContainer"]
[node name="VBoxContainer" type="VBoxContainer" parent="ClientInterface/VBoxContainer"]
custom_minimum_size = Vector2(300, 0)
layout_mode = 2
[node name="ConnectButton" type="Button" parent="ClientInterface/HBoxContainer/VBoxContainer"]
[node name="ConnectButton" type="Button" parent="ClientInterface/VBoxContainer/VBoxContainer"]
layout_mode = 2
text = "Connect to Server"
[node name="NameInput" type="LineEdit" parent="ClientInterface/HBoxContainer/VBoxContainer"]
[node name="NameInput" type="LineEdit" parent="ClientInterface/VBoxContainer/VBoxContainer"]
layout_mode = 2
placeholder_text = "Your Name"
editable = false
[node name="CreateLobbyButton" type="Button" parent="ClientInterface/HBoxContainer/VBoxContainer"]
[node name="CreateLobbyButton" type="Button" parent="ClientInterface/VBoxContainer/VBoxContainer"]
layout_mode = 2
disabled = true
text = "Create Lobby"
[node name="LobbyCodeInput" type="LineEdit" parent="ClientInterface/HBoxContainer/VBoxContainer"]
[node name="LobbyCodeInput" type="LineEdit" parent="ClientInterface/VBoxContainer/VBoxContainer"]
layout_mode = 2
placeholder_text = "Lobby Code"
editable = false
[node name="JoinLobbyButton" type="Button" parent="ClientInterface/HBoxContainer/VBoxContainer"]
[node name="JoinLobbyButton" type="Button" parent="ClientInterface/VBoxContainer/VBoxContainer"]
layout_mode = 2
disabled = true
text = "Join Lobby"
[node name="LeaveLobbyButton" type="Button" parent="ClientInterface/HBoxContainer/VBoxContainer"]
[node name="LeaveLobbyButton" type="Button" parent="ClientInterface/VBoxContainer/VBoxContainer"]
layout_mode = 2
disabled = true
text = "Disconnect"
[node name="Output" type="Label" parent="ClientInterface/HBoxContainer"]
[node name="Output" type="Label" parent="ClientInterface/VBoxContainer"]
custom_minimum_size = Vector2(64, 1)
layout_mode = 2
size_flags_horizontal = 3
@@ -91,7 +84,7 @@ autowrap_mode = 2
[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="pressed" from="ClientInterface/HBoxContainer/VBoxContainer/ConnectButton" to="ClientInterface" method="_on_connect_button_pressed"]
[connection signal="pressed" from="ClientInterface/HBoxContainer/VBoxContainer/CreateLobbyButton" to="ClientInterface" method="_on_create_lobby_button_pressed"]
[connection signal="pressed" from="ClientInterface/HBoxContainer/VBoxContainer/JoinLobbyButton" to="ClientInterface" method="_on_join_lobby_button_pressed"]
[connection signal="pressed" from="ClientInterface/HBoxContainer/VBoxContainer/LeaveLobbyButton" to="ClientInterface" method="_on_disconnect_lobby_button_pressed"]
[connection signal="pressed" from="ClientInterface/VBoxContainer/VBoxContainer/ConnectButton" to="ClientInterface" method="_on_connect_button_pressed"]
[connection signal="pressed" from="ClientInterface/VBoxContainer/VBoxContainer/CreateLobbyButton" to="ClientInterface" method="_on_create_lobby_button_pressed"]
[connection signal="pressed" from="ClientInterface/VBoxContainer/VBoxContainer/JoinLobbyButton" to="ClientInterface" method="_on_join_lobby_button_pressed"]
[connection signal="pressed" from="ClientInterface/VBoxContainer/VBoxContainer/LeaveLobbyButton" to="ClientInterface" method="_on_disconnect_lobby_button_pressed"]