refactor: simplify lobby server architecture and update app metadata
* remove legacy data bridge, RPC, and server bootstrap files * simplify lobby scene and node hierarchy * rename lobby UI scene path and update signal handlers * replace the application icon and configure the boot splash * add project description and version metadata
This commit is contained in:
6
icon.svg
6
icon.svg
@@ -1 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="124" height="124" x="2" y="2" fill="#363d52" stroke="#212532" stroke-width="4" rx="14"/><g fill="#fff" transform="translate(12.322 12.322)scale(.101)"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 814 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H446l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c0 34 58 34 58 0v-86c0-34-58-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042" transform="translate(12.322 12.322)scale(.101)"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></svg>
|
||||
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.3019 13.7368H12.6973H18.5112C20.0525 13.7368 21.3019 12.5351 21.3019 11.0526C21.3019 9.57018 20.0525 8.36842 18.5112 8.36842C20.0525 8.36842 21.3019 7.16666 21.3019 5.68421C21.3019 4.20176 20.0525 3 18.5112 3H5.48796C3.9467 3 2.69727 4.20176 2.69727 5.68421C2.69727 7.16666 3.9467 8.36842 5.48796 8.36842C3.9467 8.36842 2.69727 9.57018 2.69727 11.0526C2.69727 12.5351 3.9467 13.7368 5.48796 13.7368H11.3019ZM12.9298 5.01316C12.5445 5.01316 12.2321 5.3136 12.2321 5.68421C12.2321 6.05482 12.5445 6.35526 12.9298 6.35526H18.5112C18.8965 6.35526 19.2089 6.05482 19.2089 5.68421C19.2089 5.3136 18.8965 5.01316 18.5112 5.01316H12.9298ZM12.9298 10.3816C12.5445 10.3816 12.2321 10.682 12.2321 11.0526C12.2321 11.4232 12.5445 11.7237 12.9298 11.7237H18.5112C18.8965 11.7237 19.2089 11.4232 19.2089 11.0526C19.2089 10.682 18.8965 10.3816 18.5112 10.3816H12.9298ZM7.34843 5.68421C7.34843 6.17836 6.93195 6.57895 6.4182 6.57895C5.90444 6.57895 5.48796 6.17836 5.48796 5.68421C5.48796 5.19006 5.90444 4.78947 6.4182 4.78947C6.93195 4.78947 7.34843 5.19006 7.34843 5.68421ZM7.34843 11.0526C7.34843 11.5468 6.93195 11.9474 6.4182 11.9474C5.90444 11.9474 5.48796 11.5468 5.48796 11.0526C5.48796 10.5585 5.90444 10.1579 6.4182 10.1579C6.93195 10.1579 7.34843 10.5585 7.34843 11.0526Z" fill="#1C274C"/>
|
||||
<path opacity="0.6" d="M22 18.211C22 17.8404 21.6876 17.5399 21.3023 17.5399H13.7252C13.5364 17.0914 13.164 16.7332 12.6977 16.5516V13.7373H11.3023V16.5516C10.836 16.7332 10.4636 17.0914 10.2748 17.5399H2.69767C2.31236 17.5399 2 17.8404 2 18.211C2 18.5816 2.31236 18.882 2.69767 18.882H10.2748C10.5508 19.5378 11.2192 20.0005 12 20.0005C12.7808 20.0005 13.4492 19.5378 13.7252 18.882H21.3023C21.6876 18.882 22 18.5816 22 18.211Z" fill="#1C274C"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 995 B After Width: | Height: | Size: 2.0 KiB |
@@ -1,12 +1,12 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://b0cqo3qo62y6n"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://chu1htrspx5su" path="res://server.gd" id="1_ob30c"]
|
||||
[ext_resource type="PackedScene" uid="uid://dy51wny4x53f4" path="res://scenes/data_bridge/bridge.tscn" id="2_h8t3n"]
|
||||
[ext_resource type="Script" uid="uid://chu1htrspx5su" path="res://lobby.gd" id="1_ob30c"]
|
||||
[ext_resource type="PackedScene" uid="uid://dy51wny4x53f4" path="res://scenes/data/data_bridge.tscn" id="2_h8t3n"]
|
||||
|
||||
[node name="server" type="Node"]
|
||||
[node name="lobby" type="Node"]
|
||||
editor_description = "Note: The root node needs to match game's client root node in order for proper sync talk."
|
||||
script = ExtResource("1_ob30c")
|
||||
|
||||
[node name="bridge" parent="." instance=ExtResource("2_h8t3n")]
|
||||
[node name="data_bridge" parent="." instance=ExtResource("2_h8t3n")]
|
||||
|
||||
[node name="scene" type="Node" parent="."]
|
||||
@@ -11,9 +11,14 @@ config_version=5
|
||||
[application]
|
||||
|
||||
config/name="Lobby Server"
|
||||
config/description="A lobby server to handle starting up a game with given game arguments."
|
||||
config/version="0.1.0"
|
||||
run/main_scene="uid://b0cqo3qo62y6n"
|
||||
config/features=PackedStringArray("4.5", "GL Compatibility")
|
||||
boot_splash/bg_color=Color(0, 0, 0, 1)
|
||||
boot_splash/image="uid://3buyfmedy0qs"
|
||||
config/icon="res://icon.svg"
|
||||
boot_splash/minimum_display_time=2500
|
||||
|
||||
[autoload]
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://dy51wny4x53f4"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dbnl4tjahkoun" path="res://scenes/data_bridge/game_data.gd" id="1_l6w8l"]
|
||||
[ext_resource type="Script" uid="uid://65x4bq2wsh8k" path="res://scenes/data_bridge/game_state.gd" id="2_6ash1"]
|
||||
[ext_resource type="Script" uid="uid://dyq4p5e06ib14" path="res://scenes/data_bridge/lobby_data.gd" id="3_l6w8l"]
|
||||
[ext_resource type="Script" uid="uid://uyimqfjmuc34" path="res://scenes/data_bridge/multiplayer_data.gd" id="4_gcm58"]
|
||||
[ext_resource type="Script" uid="uid://dbnl4tjahkoun" path="res://scenes/data/game_data.gd" id="1_l6w8l"]
|
||||
[ext_resource type="Script" uid="uid://65x4bq2wsh8k" path="res://scenes/data/game_state.gd" id="2_6ash1"]
|
||||
[ext_resource type="Script" uid="uid://dyq4p5e06ib14" path="res://scenes/data/lobby_data.gd" id="3_l6w8l"]
|
||||
[ext_resource type="Script" uid="uid://uyimqfjmuc34" path="res://scenes/data/multiplayer_data.gd" id="4_gcm58"]
|
||||
|
||||
[node name="bridge" type="Node"]
|
||||
[node name="data_bridge" type="Node"]
|
||||
|
||||
[node name="game_data" type="Node" parent="."]
|
||||
script = ExtResource("1_l6w8l")
|
||||
@@ -16,5 +16,5 @@ script = ExtResource("2_6ash1")
|
||||
[node name="lobby_data" type="Node" parent="."]
|
||||
script = ExtResource("3_l6w8l")
|
||||
|
||||
[node name="multiplayer" type="Node" parent="."]
|
||||
[node name="multiplayer_data" type="Node" parent="."]
|
||||
script = ExtResource("4_gcm58")
|
||||
@@ -1,15 +1,16 @@
|
||||
class_name GameState extends Node
|
||||
|
||||
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
Globals.game_state = self
|
||||
|
||||
|
||||
func set_game_scene(scene_str: String) -> void:
|
||||
# NOTE: 'node_pth_str' needs to match game node structure else server sync throws errors.
|
||||
var node_pth_str = "billiards/scene"
|
||||
var scene = load(scene_str).instantiate()
|
||||
var target = get_tree().root.get_node(node_pth_str)
|
||||
var target = get_tree().root.find_child("scene", true, false)
|
||||
|
||||
scene.name = "lobby_screen"
|
||||
|
||||
clear_game_scene(target)
|
||||
@@ -2,9 +2,8 @@ class_name LobbyData extends Node
|
||||
|
||||
|
||||
var uuid = null
|
||||
var lobby_ui: Node = null
|
||||
|
||||
var IS_VALID_CHARS_REGEX: RegEx = RegEx.create_from_string("^[a-zA-Z0-9]+$")
|
||||
|
||||
const MATCH_TYPES: Array = ["8ball", "9ball", "snooker", "freeball"]
|
||||
const CLIENT_DICT: Dictionary = {
|
||||
"id": "",
|
||||
@@ -1,11 +1,8 @@
|
||||
class_name Lobby extends LobbyBase
|
||||
|
||||
|
||||
@onready var rpc_signals: Node = $rpc_signals
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
Globals.lobby_data.lobby_ui = self
|
||||
setup_signals()
|
||||
|
||||
func _exit_tree() -> void:
|
||||
|
||||
@@ -1,34 +1,23 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://dkes5cdu45q6e"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://dkes5cdu45q6e"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dk7afnf7ol7dy" path="res://scenes/screens/lobby_screen/lobby.gd" id="1_hhiik"]
|
||||
[ext_resource type="PackedScene" uid="uid://rb6av5eg4u0" path="res://scenes/ui_controls/lobby_screen/lobby_ui.tscn" id="2_lqt48"]
|
||||
[ext_resource type="Script" uid="uid://6sfwe1hwgf0g" path="res://scenes/screens/lobby_screen/lobby_rpc.gd" id="3_rurl6"]
|
||||
[ext_resource type="PackedScene" uid="uid://rb6av5eg4u0" path="res://scenes/ui_controls/lobby/ui.tscn" id="2_lqt48"]
|
||||
[ext_resource type="Script" uid="uid://crbm3v4td6du6" path="res://scenes/screens/lobby_screen/lobby_server.gd" id="4_glu7g"]
|
||||
|
||||
[node name="lobby_screen" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
[node name="lobby" type="Node"]
|
||||
script = ExtResource("1_hhiik")
|
||||
|
||||
[node name="ui" parent="." instance=ExtResource("2_lqt48")]
|
||||
layout_mode = 1
|
||||
theme_override_constants/margin_left = 10
|
||||
theme_override_constants/margin_top = 10
|
||||
theme_override_constants/margin_right = 10
|
||||
theme_override_constants/margin_bottom = 10
|
||||
|
||||
[node name="rpc_signals" type="Node" parent="."]
|
||||
script = ExtResource("3_rurl6")
|
||||
|
||||
[node name="server" type="Node" parent="."]
|
||||
script = ExtResource("4_glu7g")
|
||||
|
||||
[connection signal="pressed" from="ui/body/left_body/server_host_hbox/host_start_bttn" to="." method="_on_host_start_bttn_pressed"]
|
||||
[connection signal="pressed" from="ui/body/left_body/server_host_hbox/host_stop_bttn" to="." method="_on_host_stop_bttn_pressed"]
|
||||
[connection signal="button_up" from="ui/body/left_body/search_vbox/search_hbox/match_search_bttn" to="." method="_on_match_search_bttn_button_up"]
|
||||
[connection signal="pressed" from="ui/body/left_body/search_vbox/search_hbox/match_search_bttn" to="." method="_on_match_search_bttn_pressed"]
|
||||
|
||||
[editable path="ui"]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class_name LobbyBase extends Control
|
||||
class_name LobbyBase extends Node
|
||||
|
||||
|
||||
const MATCH_ENTRY = preload("res://scenes/screens/lobby_screen/match_entry.tscn")
|
||||
@@ -15,12 +15,6 @@ const MATCH_ENTRY = preload("res://scenes/screens/lobby_
|
||||
@onready var server: Node = $server
|
||||
|
||||
|
||||
|
||||
func _on_home_bttn_pressed() -> void:
|
||||
Globals.game_state.set_game_scene(
|
||||
"res://scenes/screens/start_screen/start.tscn"
|
||||
)
|
||||
|
||||
func _on_host_start_bttn_pressed() -> void:
|
||||
server.start_server(host_address_input.text, int(host_port_range.value))
|
||||
|
||||
@@ -32,8 +26,5 @@ func _on_host_stop_bttn_pressed() -> void:
|
||||
host_start_bttn.visible = true
|
||||
host_stop_bttn.visible = false
|
||||
|
||||
func _on_search_bttn_pressed() -> void:
|
||||
pass
|
||||
|
||||
func _on_match_search_bttn_button_up() -> void:
|
||||
func _on_match_search_bttn_pressed() -> void:
|
||||
pass
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
extends Node
|
||||
@@ -1 +0,0 @@
|
||||
uid://6sfwe1hwgf0g
|
||||
BIN
splash.png
Normal file
BIN
splash.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 MiB |
40
splash.png.import
Normal file
40
splash.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://3buyfmedy0qs"
|
||||
path="res://.godot/imported/splash.png-929ed8a00b89ba36c51789452f874c77.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://splash.png"
|
||||
dest_files=["res://.godot/imported/splash.png-929ed8a00b89ba36c51789452f874c77.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
Reference in New Issue
Block a user