Server: - ConnectionLoop: accept auth.login and auth.register as valid first messages (not just auth.hello); all ack payloads now include sessionToken for client persistence - IGatewayAuthValidator: add LoginAsync and RegisterAsync - GatewayAuthValidator: implement both via auth gRPC; fetch displayName from ValidateAsync after login/register succeeds - Admin hamburger: custom .sor-admin-hamburger CSS (hardcoded white, no Bootstrap btn-link theme fighting); topbar z-index 1050 with position:sticky Client (Godot 4.5, GDScript): - autoloads/Network.gd: WebSocketPeer state machine (CONNECTING / CONNECTED / RECONNECTING), exponential backoff (1→30s), app-level keepalive ping every 30s of idle, 30s ping timeout → reconnect, request/reply correlation by sequence number, debug_log_packets export flag for full packet dumps - autoloads/Auth.gd: drives auth.hello / auth.login / auth.register as first WS message; persists sessionToken + userId + displayName to user://auth.cfg; auto-resumes saved session on reconnect; auth_success / auth_failed signals - scenes/login/LoginScreen.tscn + login_screen.gd: Login + Register tabs, touch-friendly inputs (44px height), status label, Enter key submits, handles reconnect/resume states - scenes/main/MainScreen.tscn + main_screen.gd: top bar with live connection dot, welcome label, placeholder nav buttons, sign-out, redirects to login on session expiry - project.godot: Network and Auth autoloads registered; LoginScreen as main scene Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
138 lines
4.2 KiB
Plaintext
138 lines
4.2 KiB
Plaintext
[gd_scene load_steps=2 format=3]
|
|
|
|
[ext_resource type="Script" path="res://scenes/main/main_screen.gd" id="1_main"]
|
|
|
|
[node name="MainScreen" type="Control"]
|
|
layout_mode = 3
|
|
anchors_preset = 15
|
|
anchor_right = 1.0
|
|
anchor_bottom = 1.0
|
|
grow_horizontal = 2
|
|
grow_vertical = 2
|
|
script = ExtResource("1_main")
|
|
|
|
[node name="Background" type="ColorRect" parent="."]
|
|
layout_mode = 1
|
|
anchors_preset = 15
|
|
anchor_right = 1.0
|
|
anchor_bottom = 1.0
|
|
grow_horizontal = 2
|
|
grow_vertical = 2
|
|
color = Color(0.094, 0.094, 0.137, 1.0)
|
|
|
|
[node name="Layout" type="VBoxContainer" parent="."]
|
|
layout_mode = 1
|
|
anchors_preset = 15
|
|
anchor_right = 1.0
|
|
anchor_bottom = 1.0
|
|
grow_horizontal = 2
|
|
grow_vertical = 2
|
|
theme_override_constants/separation = 0
|
|
|
|
[node name="TopBar" type="HBoxContainer" parent="Layout"]
|
|
layout_mode = 2
|
|
custom_minimum_size = Vector2(0, 56)
|
|
theme_override_constants/separation = 12
|
|
|
|
[node name="TopBarMargin" type="MarginContainer" parent="Layout/TopBar"]
|
|
layout_mode = 2
|
|
size_flags_horizontal = 3
|
|
theme_override_constants/margin_left = 16
|
|
theme_override_constants/margin_right = 16
|
|
|
|
[node name="TopBarInner" type="HBoxContainer" parent="Layout/TopBar/TopBarMargin"]
|
|
layout_mode = 2
|
|
size_flags_horizontal = 3
|
|
theme_override_constants/separation = 0
|
|
|
|
[node name="BrandLabel" type="Label" parent="Layout/TopBar/TopBarMargin/TopBarInner"]
|
|
layout_mode = 2
|
|
text = "ORIGIN"
|
|
theme_override_font_sizes/font_size = 18
|
|
size_flags_vertical = 4
|
|
|
|
[node name="TopSpacer" type="Control" parent="Layout/TopBar/TopBarMargin/TopBarInner"]
|
|
layout_mode = 2
|
|
size_flags_horizontal = 3
|
|
|
|
[node name="StatusLabel" type="Label" parent="Layout/TopBar/TopBarMargin/TopBarInner"]
|
|
unique_name_in_owner = true
|
|
layout_mode = 2
|
|
text = "● Online"
|
|
modulate = Color(0.3, 0.9, 0.4, 1.0)
|
|
size_flags_vertical = 4
|
|
theme_override_font_sizes/font_size = 13
|
|
|
|
[node name="Separator" type="HSeparator" parent="Layout"]
|
|
layout_mode = 2
|
|
|
|
[node name="Scroll" type="ScrollContainer" parent="Layout"]
|
|
layout_mode = 2
|
|
size_flags_vertical = 3
|
|
|
|
[node name="Content" type="VBoxContainer" parent="Layout/Scroll"]
|
|
layout_mode = 2
|
|
size_flags_horizontal = 3
|
|
theme_override_constants/separation = 16
|
|
|
|
[node name="ContentMargin" type="MarginContainer" parent="Layout/Scroll/Content"]
|
|
layout_mode = 2
|
|
theme_override_constants/margin_left = 20
|
|
theme_override_constants/margin_top = 20
|
|
theme_override_constants/margin_right = 20
|
|
theme_override_constants/margin_bottom = 20
|
|
|
|
[node name="ContentInner" type="VBoxContainer" parent="Layout/Scroll/Content/ContentMargin"]
|
|
layout_mode = 2
|
|
theme_override_constants/separation = 20
|
|
|
|
[node name="WelcomeLabel" type="Label" parent="Layout/Scroll/Content/ContentMargin/ContentInner"]
|
|
unique_name_in_owner = true
|
|
layout_mode = 2
|
|
text = "Welcome!"
|
|
theme_override_font_sizes/font_size = 24
|
|
|
|
[node name="NavSection" type="Label" parent="Layout/Scroll/Content/ContentMargin/ContentInner"]
|
|
layout_mode = 2
|
|
text = "PLAY"
|
|
modulate = Color(0.6, 0.6, 0.65, 1.0)
|
|
theme_override_font_sizes/font_size = 11
|
|
|
|
[node name="NavButtons" type="VBoxContainer" parent="Layout/Scroll/Content/ContentMargin/ContentInner"]
|
|
layout_mode = 2
|
|
theme_override_constants/separation = 10
|
|
|
|
[node name="CollectionBtn" type="Button" parent="Layout/Scroll/Content/ContentMargin/ContentInner/NavButtons"]
|
|
layout_mode = 2
|
|
custom_minimum_size = Vector2(0, 52)
|
|
text = "My Collection"
|
|
theme_override_font_sizes/font_size = 15
|
|
|
|
[node name="BazaarBtn" type="Button" parent="Layout/Scroll/Content/ContentMargin/ContentInner/NavButtons"]
|
|
layout_mode = 2
|
|
custom_minimum_size = Vector2(0, 52)
|
|
text = "Bazaar"
|
|
theme_override_font_sizes/font_size = 15
|
|
|
|
[node name="MatchBtn" type="Button" parent="Layout/Scroll/Content/ContentMargin/ContentInner/NavButtons"]
|
|
layout_mode = 2
|
|
custom_minimum_size = Vector2(0, 52)
|
|
text = "Find Match"
|
|
theme_override_font_sizes/font_size = 15
|
|
|
|
[node name="BottomBar" type="HBoxContainer" parent="Layout"]
|
|
layout_mode = 2
|
|
custom_minimum_size = Vector2(0, 56)
|
|
|
|
[node name="BottomMargin" type="MarginContainer" parent="Layout/BottomBar"]
|
|
layout_mode = 2
|
|
size_flags_horizontal = 3
|
|
theme_override_constants/margin_left = 16
|
|
theme_override_constants/margin_right = 16
|
|
|
|
[node name="LogoutBtn" type="Button" parent="Layout/BottomBar/BottomMargin"]
|
|
unique_name_in_owner = true
|
|
layout_mode = 2
|
|
text = "Sign Out"
|
|
theme_override_font_sizes/font_size = 14
|