Class: login_manager
Multiplayer login and saved credential operations.
Source
C++ class login_manager
Custom Constructor
login_manager
Remarks
Main-menu login service with one current profile. Log out before starting another online login.
Methods
forgot_password()
forgot_password(url: string): void;Open the password recovery URL through the engine.
Parameters
| Parameter | Type | Description |
|---|---|---|
url | string | Recovery page URL. |
Returns
void
get_current_profile()
get_current_profile(): Nullable<profile>;Get the current logged-in profile.
Returns
Nullable<profile>
Current logged-in profile, or null when offline.
Remarks
Offline login also creates a profile object, but it is not an online GameSpy session.
get_email_from_registry()
get_email_from_registry(): string;Returns
string
Saved email from registry.
get_nick_from_registry()
get_nick_from_registry(): string;Returns
string
Saved nick from registry.
get_password_from_registry()
get_password_from_registry(): string;Returns
string
Saved password from registry.
get_remember_me_from_registry()
get_remember_me_from_registry(): boolean;Returns
boolean
Saved remember-me flag.
login()
login(
mail: string,
profile: string,
password: string,
cb: login_operation_cb): void;Log in to a GameSpy account.
Parameters
| Parameter | Type | Description |
|---|---|---|
mail | string | Account email. |
profile | string | Profile nick. |
password | string | Account password. |
cb | login_operation_cb | Completion callback. |
Returns
void
Remarks
Starts an asynchronous login. If another profile is already active, native code reports that logout is needed first.
login_offline()
login_offline(nick: string, cb: login_operation_cb): void;Create an offline login profile.
Parameters
| Parameter | Type | Description |
|---|---|---|
nick | string | Offline nick. |
cb | login_operation_cb | Completion callback. |
Returns
void
Remarks
Rejects empty or whitespace-only nicknames. Does not contact GameSpy.
logout()
logout(): void;Log out and clear current profile state.
Returns
void
Remarks
Online profiles disconnect from GameSpy. Any account-manager requests tied to the session may need to be restarted afterward.
save_email_to_registry()
save_email_to_registry(email: string): void;Save account email to registry.
Parameters
| Parameter | Type |
|---|---|
email | string |
Returns
void
save_nick_to_registry()
save_nick_to_registry(nick: string): void;Save nick to registry.
Parameters
| Parameter | Type |
|---|---|
nick | string |
Returns
void
save_password_to_registry()
save_password_to_registry(password: string): void;Save password to registry.
Parameters
| Parameter | Type |
|---|---|
password | string |
Returns
void
save_remember_me_to_registry()
save_remember_me_to_registry(remember_me: boolean): void;Save remember-me flag to registry.
Parameters
| Parameter | Type |
|---|---|
remember_me | boolean |
Returns
void
set_unique_nick()
set_unique_nick(nick: string, cb: login_operation_cb): void;Change the unique nick for the current profile.
Parameters
| Parameter | Type | Description |
|---|---|---|
nick | string | New unique nick. |
cb | login_operation_cb | Completion callback. |
Returns
void
Remarks
Requires a current profile and a non-empty unique nick. Offline profiles update locally; online profiles send a GameSpy request.
stop_login()
stop_login(): void;Stop the active login request.
Returns
void
Remarks
Safe to call when no login is active.
stop_setting_unique_nick()
stop_setting_unique_nick(): void;Stop the active unique-nick change request.
Returns
void
Remarks
Safe to call when no unique-nick request is active.