Godot client networking + auth + login/main screens; fix admin hamburger
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>
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
|
||||
@* Mobile topbar: hamburger + brand. Hidden on desktop via CSS. *@
|
||||
<div class="sor-admin-topbar">
|
||||
<button class="btn btn-link text-white p-0 me-3"
|
||||
<button class="sor-admin-hamburger"
|
||||
@onclick="ToggleDrawer"
|
||||
aria-label="Toggle navigation">
|
||||
<i class="bi bi-list fs-3"></i>
|
||||
|
||||
@@ -75,16 +75,21 @@ html, body {
|
||||
/* ── Mobile overrides (< lg = 992px) ────────────────────────────────────────── */
|
||||
|
||||
@media (max-width: 991.98px) {
|
||||
/* Topbar strip: hamburger + brand */
|
||||
/* Topbar strip: hamburger + brand.
|
||||
position:sticky keeps it visible when content scrolls;
|
||||
z-index:1050 puts it above the sidebar (1045) and backdrop (1040)
|
||||
so the hamburger is always tappable. */
|
||||
.sor-admin-topbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 56px;
|
||||
padding: 0 1rem;
|
||||
background: var(--bs-dark, #212529);
|
||||
color: white;
|
||||
background: #212529; /* hard-coded: stays dark in both BS themes */
|
||||
color: #fff;
|
||||
flex-shrink: 0;
|
||||
z-index: 1000;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1050;
|
||||
}
|
||||
|
||||
/* Sidebar becomes a fixed overlay drawer, slides in from the left */
|
||||
@@ -117,6 +122,28 @@ html, body {
|
||||
}
|
||||
}
|
||||
|
||||
/* ── Hamburger button ───────────────────────────────────────────────────────── */
|
||||
/* Bypasses Bootstrap btn/btn-link color overrides entirely — always white,
|
||||
regardless of the active BS theme (light or dark). */
|
||||
|
||||
.sor-admin-hamburger {
|
||||
background: none;
|
||||
border: none;
|
||||
color: #fff;
|
||||
padding: 0.375rem 0.5rem;
|
||||
margin-right: 0.5rem;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
|
||||
.sor-admin-hamburger:hover,
|
||||
.sor-admin-hamburger:focus {
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/* ── Monospace JSON editor ──────────────────────────────────────────────────── */
|
||||
|
||||
.font-monospace {
|
||||
|
||||
Reference in New Issue
Block a user