Browser Options and player login
The browser Opt button is available on desktop and mobile. On desktop it sits six CSS pixels left of the native top toolbar, using the client's published hit rectangles rather than assuming a fixed toolbar width. It appears when the pointer is within 150 CSS pixels of its rectangle and remains visible while Options is open or the button has keyboard focus. Ctrl+Alt+M also opens Options. Closing the dialog returns focus to the canvas; Tab remains native targeting. Mobile retains its existing toolbar and touch controls. The dialog scrolls on small screens.
A visitor can keep its generated name or choose a new name and password in Options without creating a replacement character. The player ID, items, XP, skills, resources, location, team and native per-character preferences remain attached to that character. Options first offers Create character from scratch, Save this character, and Log in to an existing character. Save is hidden for characters with login credentials. Saved characters also have Change password, with a single New password field. Changing the password keeps the current browser credential and game connections and does not reload the page. Visitors cannot change passwords. Credentials appear only after choosing a flow; Back clears them. Creation opens the original in-game breed, appearance, profession and naming scenes, followed by faction selection in Arrival Hall. Native creation initially uses the browser cookie and collects confirmed name/password credentials at its naming step. Completing creation enables name/password login immediately. A successful login loads that character; a failed submission leaves the current player usable.
Account information loads once after browser launch and again when the native creator finishes. Opening Options uses those values without making a request or disabling Create and Log in. The account endpoint reads committed identity and password status directly from SQLite without acquiring the simulation mutex. Credential changes remain atomic, and revoked browser cookies cannot read the previous account's information.
tests/e2e/options.test.mjs holds the initial lookup pending while opening Options
and using Log in, then verifies that reopening makes no new request. A server
regression holds the simulation mutex while requesting authenticated account
information. Local measurements for this fix found 1.1-3.3 ms authenticated HTTP
responses with the native client running; the SQLite lookup on the live database
was below 0.02 ms. Earlier unauthenticated requests waited up to 5.6 seconds on
the simulation mutex before reaching any query. The separate long simulation
critical section was not reproduced after restarting for CPU/mutex profiling
and remains an open TODO.
Source and publication
Maintain the account UI in client/browser/index.html. The page target in
client/Makefile.wasm copies it to client/build/wasm/web/index.html, and
tools/client/publish_wasm.py substitutes the matching bundle's download sizes
before publishing it to server/assets/client/index.html. Page-only changes
reuse the existing compressed executable.
The November 5 reconciliation restores the served password-change flow and empty-password support to that source. Normal page generation and publication reproduce the existing served page byte-for-byte; only the build metadata's source identity changes in the published bundle. No server account behavior or executable bytes change.
All 13 source account checks, 74 control checks, the loading scenario and three
publisher tests pass. The new password-flow checks fail against the prior
source. TestBrowserPasswordOptions passes in 13.32 seconds against the
regenerated bundle: visitor eligibility, creation, Back, nonempty and empty
password changes, unchanged browser credential and uninterrupted game stream.
The success message was visually inspected. Logs are under
local/alpha-account-source/; native captures are under local/password-options/.
Options after resizing
The native client retains an older top-strip hit rectangle after resizing. Selecting the leftmost upper-right rectangle placed Opt 320 pixels left of the visible toolbar when enlarging from 1280 to 1600 pixels. Its 150-pixel hover reveal then missed the expected location. Below 384 pixels, the old right-half filter also skipped the complete toolbar and selected individual button bounds. The overlay now anchors to the strip ending at the current native screen edge, keeping its six-CSS-pixel gap and existing hover, focus and dialog visibility.
TestBrowserOptionsResize resizes a real client through 1280x900, 800x600,
640x480, 390x500, 320x480, 1600x900 and 1024x768. At every size it verifies
on-screen bounds and the gap, hovers beside the visible native toolbar, then
clicks Opt and closes Options. The fixed run passes in 11.66 seconds with no
browser errors; the narrow rendering was visually inspected. All 76 control
checks and 13 account checks pass, including the focused stale/narrow bounds
regressions that fail against the prior source. The regenerated page is
published with its matching build metadata. Logs and captures are under
local/options-resize/, with the native passing run in 20261105-193959/.
Account state and transactions
Private characters.password_salt and password_hash columns store a random
16-byte salt and 32-byte Argon2id result. They are excluded from the profile
editor, native packets and browser account responses. Hashing uses two passes,
19456 KiB and one lane, following the
OWASP Argon2id configuration.
The implementation is Go's golang.org/x/crypto/argon2. Its current release
requires Go 1.26, which is now the declared build/test minimum. Password hashing
runs outside the simulation/database locks; a separate mutex bounds its memory
use without serializing the simulation with expensive password work.
New visitors receive a pronounceable 6-8 letter name, such as Lupeza, Carozu
or Bleronim. The curated beginning/middle/ending lists contain 165, 75 and 300
syllables. Filtering recognizable profanity, slurs and reviewed awkward
combinations leaves 3,602,718 distinct names: 494,983 of length six,
1,882,830 of length seven and 1,224,905 of length eight. The capacity regression
counts every usable combination and verifies unique parts, prefix-free
beginnings and fixed-length middles, which make concatenation unambiguous.
The sample review and independent calculation are retained in
local/visitor-names/capacity.json and tmp_capacity.py.
Allocation checks the indexed database names without ASCII case distinctions and retries collisions without numeric suffixes. A unique index protects all player names, including unclaimed visitors; NPCs can still share names. The saved name survives reconnect/restart. Visitor/adopted status follows the stored password credential, not the name's spelling, so a visitor can adopt its generated name without losing its character or mistaking itself for a duplicate account.
New visitors receive the same profession/faction starter kit as character creation. The default Omni Soldier gets seven inventory entries, including 25 treatment-laboratory and 3 first-aid charges. Player creation, items, ownership and identity counters commit together. Name collision retries reuse the pending kit, and reconnects do not issue it again. Adoption keeps the kit.
Visitors display Visitor as a separate native title; generated names retain
their existing 6-8 letters and remain usable in chat and login. The title is
stored in characters.title beside name, exposed in the profile editor, and
cleared atomically on adoption. Titles accept up to 31 bytes without a NUL,
matching the native SetName decoder's limit; empty text clears the title.
No client executable or browser-page change is required.
Existing development databases must be recreated for the added title column.
The native SetNameIIR_t packet has key 0x734e5a7b, with a u32 field selector
4, zero byte, u32 text length and the ASCII title. The key follows
client/game/llr.dll/lifted-0014.c::sub_38023F20; serialization and execution are
client/game/kkr.dll/lifted-0038.c::sub_360812A0 and sub_360812F0.
The original setter sub_36070F40 stores title text separately from the name.
The decoder sub_36081140 rejects text lengths of 32 bytes or more.
DDR's TargetingModule_t::HandleNametags calls sub_2B0624E0, which reads
N3Msg_GetTitleName; the target HUD also reads it in sub_2B0654A0.
Character inspection carries the same text in its counted title string.
These are text fields, distinct from fixed earned PvP ranks and profession
title levels.
The visitor browser regression covers owner/observer delivery, inspection,
adoption with the original generated name, and cold restart. Native screenshots
show Visitor Gliribin above the actor and in the target HUD, then Gliribin
after adoption. Starter regressions cover exact contents, ownership, concurrent
launches, rollback, retry and restart; inventory/cursor/touch/private-storage
browser checks run with the complete visitor kit.
Focused account and creation checks pass with generated names, including cold
loading, keeping a generated name during adoption, 32 concurrent launches,
case-insensitive collisions and failed-save cleanup. The launch collision and
concurrency checks also pass under the race detector. An INSERT-boundary
collision regression verifies rollback and retry when a name becomes unavailable
after the initial lookup: player insertion ignores only an existing ID, allowing
the name uniqueness error to reach the retry loop. The shared team fixture now
uses distinct member names; its team, chat, buddy, inspection and affected armor
checks pass. The full server run recorded 2,115 passing roots, 79 failing roots
and 171 opt-in skips. The failures came from duplicate fixture names and one
random roaming destination inside its arrival radius. The team, copied nano
recipient and treatment-patient fixtures now have distinct names; the roaming
fixture guarantees a destination outside that radius. All 79 failing roots
pass in focused reruns after those corrections, alongside the new save-time
collision and production test-API exclusion checks. This is a full run followed
by targeted repairs, not a second complete run. Logs are under
local/visitor-names/, including full-summary.json, repaired.json,
recipient-fixed.log and patients-fixed.log.
User-chosen names follow the original creator: remove characters other than ASCII letters and digits, capitalize the first letter and lowercase the rest, then require 4-12 characters with four initial letters and optional trailing digits. Letters cannot follow digits. NUL-containing input is rejected, and names are unique without ASCII case distinctions. Original server profanity/reservation lists remain unknown. Login applies the same normalization. New passwords require at least five characters and are limited to 1024 bytes, without trimming, case folding or composition rules.
Claiming a name commits its name, salt, hash and replacement browser credential in one transaction. Login verifies the password and rotates both the chosen player's browser credential and the current player's abandoned credential in one transaction. It retains the abandoned character's game state, without leaving its old cookie authorized. Related changes commit before the response sets a cookie or reports success; ignored writes and failed COMMITs roll back. Ordinary character/profile/checkpoint saves leave password columns untouched.
Password changes authorize the current browser character, regardless of any submitted name, and recheck that ownership after hashing. They replace only the existing password salt and hash and enforce the same five-character minimum as creation and adoption.
Native creation builds a detached level-1 character, then atomically inserts the character, player row, starter item identities and locations, identity counters and abandoned browser credential. No shared character/item cache or counter changes before COMMIT. Every insert must affect one row; ignored inserts fail the transaction. The existing character and its password remain available for later login. Browser ownership transfers to the new character using the existing cookie, so reload recovers a committed creation even if its success response is lost. The previous character's authorization cannot replay creation after commit. Save an unsaved character before creating another if you want to return to it through name/password login. See creation choices and starting state for the historical evidence and remaining gameplay gaps.
The authenticated cookie is HttpOnly, SameSite=Lax and Secure over HTTPS, using the configured URL prefix. Account responses are not cached. Mutating account requests use Go's same-origin request protection. World/chat connections carry the credential snapshot from HTTP authentication through their native handshake; reliable-stream attachment rechecks it. Replaced sessions stop accepting game input, and both their world and chat streams close with the existing takeover notification. The dialog suppresses that old-session notification while its own account request completes, then reloads with the new cookie.
Native files remain in their existing per-character browser directories. Browser presentation choices such as pixel resolution and touch-control visibility remain device preferences. Browser login identifies one character; the original creator is connected without adding the original multi-character account system.
Verification
Focused HTTP/database and transport regressions cover claiming without losing items or progress, salted password verification, case-insensitive lookup, invalid and duplicate names, wrong passwords, concurrent claims, repeated claims, credential replacement, restart, profile/checkpoint saves, same-origin protection, mounted cookie paths, failed/ignored writes and failed COMMITs. A failed second credential update rolls back the first. Session regressions cover revocation before the reliable hello, after attachment and before native world/chat authentication.
The browser tests exercise visitor/named forms, exact credential submission, duplicate-submit prevention, failed login/network retry, takeover races and visible lookup failures. Control regressions cover desktop placement, the 150-pixel boundary, retained modal access and return to canvas focus, alongside the existing mobile/input cases.
Creation regressions cover all 255 heads and all 252 combinations of seven body templates, twelve professions and three sides. They check original appearance choices, initial stats, every issued item and ordinary inventory placement. Invalid/missing choices, duplicate names, missing/revoked cookies, concurrent/replayed creation, failed/ignored inserts, failed counter or old credential updates, and deferred COMMIT failure leave the current character and shared caches/counters unchanged. Failed transactions can retry. A named player's equipped item and credits survive creation, login and cold loading. The account/catalog response contains only name, visitor status and public head choices. The browser's eleven account tests cover separate flows, filtered heads, hidden credentials, Back, pending requests and field validation state. Both issued charged kits also pass repeated split, rejoin and cold-loading checks without losing quantities or reusing an item identity.
The original Clientr.exe!sub_28005684 CRT startup calls MSVCRT exit after
WinMain cleanup. The browser keeps that cleanup and the maintained
linux_imports.c:crt_exit adapter's termination callbacks, stdio flushing and
graphics shutdown. Its animation callback runs through Emscripten's
callUserCallback, which handles the normal pthread exit sentinel while
propagating real failures. The compiled browser-loop fixture calls exit(0)
after its shutdown assertions; it reproduces an uncaught unwind without the
wrapper and passes with zero browser errors with it. The Linux import fixture
also verifies callbacks, flushed bytes and the requested process exit status.
Two hardware Chromium clients on the GPU exercised visitor claims, wrong passwords, mixed-case login, remote session replacement and cold server recovery. Native memory snapshots confirmed distinct 100/200 XP totals and item instance IDs 1/2 after switching and restart. An Ignore list saved under character 2 remained separate from character 1, then restored through switching and restart; the native command correctly removed its existing entry. Movement worked after cold password recovery. The fixed full-client run recorded zero browser/worker errors.
Desktop checks at 1280x900 and 1024x768 verified the six-pixel toolbar gap,
the reveal boundary, keyboard Options access and return to canvas focus with
Tab targeting retained. A touch-enabled Chromium viewport at 390x844 with
device pixel ratio 2 exercised the visible mobile button, visitor form, failed
login without losing the visitor, and successful named login. The same flow
passed at 390x500 with the dialog scrolling to reach its inputs and buttons.
Captures, native snapshots, wire traffic and browser reports are retained under
local/browser-account-smoke/; automated logs and the isolated shutdown
reproduction are under local/browser-account-research/.