feat(accounts)!: require explicit local account registration

Open the local signup page in the game's embedded browser before sign-in. Return the existing login error for unknown accounts or invalid passwords.

BREAKING CHANGE: First-time players must register in the game's signup window or create a save in the launcher before signing in. Existing accounts can sign in with their saved credentials.
This commit is contained in:
N0VAN0M4LY committed 2026-11-29 18:00:21 +08:00
1 parent d20b7f4249
commit d043a8f0f8
23 files changed
+134 -32

No files matched your search

@@ -18,19 +18,22 @@ export interface NetworkRedirectReport {
readonly addresses: readonly AddressChange[];
}
export function redirectNetworkConfig(root: BlkBlock, endpoint: LocalEndpoint): NetworkRedirectReport {
export function redirectNetworkConfig(root: BlkBlock, endpoint: LocalEndpoint, localRegistration: boolean): NetworkRedirectReport {
const addresses = redirectAddresses(root, endpoint);
const environments = root.blocks.filter((block) => findParam(block, 'charServer'));
for (const environment of environments) configureEnvironment(environment, endpoint);
for (const environment of environments) configureEnvironment(environment, endpoint, localRegistration);
return { environments: environments.map((block) => block.name), addresses };
}
function configureEnvironment(environment: BlkBlock, endpoint: LocalEndpoint): void {
function configureEnvironment(environment: BlkBlock, endpoint: LocalEndpoint, localRegistration: boolean): void {
setParam(environment, 'enableSslCertCheck', { type: 'bool', value: false });
// The local store page. The stock value carries URL tags; here only
// auto_local, so scripts/onlineShop/url.nut adds ?skin_lang=<game language> and opens it in
// the built-in browser. No auto_login: that goes through Gaijin's login.gaijin.net.
setParam(environment, 'webstoreURL', { type: 'string', value: `auto_local http://${endpoint.host}:${endpoint.port}/store` });
if (localRegistration) {
setParam(environment, 'signUpURL', { type: 'string', value: `auto_local http://${endpoint.host}:${endpoint.port}/register` });
}
const login = ensureBlock(environment, 'yuplay');
for (const [key, value] of loginOverrides(endpoint)) setParam(login, key, { type: 'string', value });
}