Client flow after auth is now:
LoginScreen → auth_success → InitScreen → MainScreen
autoloads/ContentCache.gd
- Cursor-based incremental sync via content.sync (PageSize=200)
- Merges definition DTOs in-memory (id → Dictionary)
- Persists to user://content/defs.json on sync completion
- Incremental on repeat launches: 0 round trips when nothing changed
- Signals: sync_progress(fetched_total), sync_complete(total), sync_failed(error)
scenes/init/InitScreen.tscn + init_screen.gd
- Step 1: version.check (clientVersion="0.1.0", platform="web")
UpdateRequired → show "please refresh" panel, block
UpdateAvailable → soft banner, continue
Ok → continue
DISCONNECTED → wait for Network.connected (one-shot), retry
other error → warn + proceed (don't block player on non-critical check)
- Step 2: ContentCache.start_sync()
Shows running card count while pages arrive
On sync_complete: transition to MainScreen
On sync_failed: show error + Retry button
scenes/login/login_screen.gd
- _go_to_main() now routes to InitScreen instead of MainScreen directly
project.godot
- ContentCache registered as autoload (loads before Auth)
- pointing/emulate_touch_from_mouse=true for desktop browser testing
Caching architecture decision (see plan):
- Layer 1 (definitions/text): always sync all eagerly — no privacy concern
- Layer 2 (2D art): lazy by definition ID, CDN fetch on demand
- Layer 3 (3D models/animations): set-bundle granularity + server-injected
noise during match pre-warm to prevent cache oracle attack
(Layer 2/3 implementation is future work)
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>
73 lines
1.8 KiB
Plaintext
73 lines
1.8 KiB
Plaintext
[gd_scene load_steps=2 format=3]
|
|
|
|
[ext_resource type="Script" path="res://scenes/init/init_screen.gd" id="1_init"]
|
|
|
|
[node name="InitScreen" 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_init")
|
|
|
|
[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="Center" type="CenterContainer" parent="."]
|
|
layout_mode = 1
|
|
anchors_preset = 15
|
|
anchor_right = 1.0
|
|
anchor_bottom = 1.0
|
|
grow_horizontal = 2
|
|
grow_vertical = 2
|
|
|
|
[node name="VBox" type="VBoxContainer" parent="Center"]
|
|
layout_mode = 2
|
|
custom_minimum_size = Vector2(340, 0)
|
|
theme_override_constants/separation = 20
|
|
|
|
[node name="Logo" type="Label" parent="Center/VBox"]
|
|
layout_mode = 2
|
|
text = "ORIGIN"
|
|
horizontal_alignment = 1
|
|
theme_override_font_sizes/font_size = 36
|
|
|
|
[node name="StatusLabel" type="Label" parent="Center/VBox"]
|
|
unique_name_in_owner = true
|
|
layout_mode = 2
|
|
text = "Starting…"
|
|
horizontal_alignment = 1
|
|
autowrap_mode = 3
|
|
modulate = Color(0.75, 0.75, 0.8, 1.0)
|
|
theme_override_font_sizes/font_size = 14
|
|
|
|
[node name="UpdatePanel" type="VBoxContainer" parent="Center/VBox"]
|
|
unique_name_in_owner = true
|
|
layout_mode = 2
|
|
theme_override_constants/separation = 12
|
|
visible = false
|
|
|
|
[node name="UpdateMsg" type="Label" parent="Center/VBox/UpdatePanel"]
|
|
unique_name_in_owner = true
|
|
layout_mode = 2
|
|
text = "A required update is available."
|
|
horizontal_alignment = 1
|
|
autowrap_mode = 3
|
|
modulate = Color(1.0, 0.75, 0.3, 1.0)
|
|
theme_override_font_sizes/font_size = 14
|
|
|
|
[node name="RetryBtn" type="Button" parent="Center/VBox"]
|
|
unique_name_in_owner = true
|
|
layout_mode = 2
|
|
custom_minimum_size = Vector2(0, 48)
|
|
text = "Retry"
|
|
visible = false
|
|
theme_override_font_sizes/font_size = 15
|