Class: account_manager
GameSpy account operations used by multiplayer menus.
Source
C++ class account_manager
Custom Constructor
account_manager
Remarks
Main-menu GameSpy account service. Requests are asynchronous, but validation errors may call the callback immediately before any network work starts.
Methods
create_profile()
create_profile(
acc: string,
nick: string,
mail: string,
password: string,
cb: account_profiles_cb): void;Create a GameSpy profile.
Parameters
| Parameter | Type | Description |
|---|---|---|
acc | string | Account name. |
nick | string | Public nickname. |
mail | string | Account email. |
password | string | Account password. |
cb | account_profiles_cb | Completion callback. |
Returns
void
Remarks
Validates nickname, unique nick, email, and password before sending the request. On validation failure the callback receives a translated status key and no profile is created.
delete_profile()
delete_profile(operation: account_operation_cb): void;Delete the currently logged-in profile.
Parameters
| Parameter | Type | Description |
|---|---|---|
operation | account_operation_cb | Completion callback. |
Returns
void
Remarks
Requires an online current profile. Without one, the callback reports a not-logged-in status.
get_account_profiles()
get_account_profiles(
email: string,
password: string,
cb: account_profiles_cb): void;Fetch profiles registered for an account.
Parameters
| Parameter | Type | Description |
|---|---|---|
email | string | Account email. |
password | string | Account password. |
cb | account_profiles_cb | Completion callback. |
Returns
void
Remarks
Clears previous profile-search results before starting the request. Use account_manager.get_found_profiles after the completion callback.
get_found_profiles()
get_found_profiles(): LuaIterable<string>;Get profiles found by the last email search.
Returns
LuaIterable<string>
Profiles found by the last email search.
Remarks
Result list is replaced by each account-profile fetch.
get_suggested_unicks()
get_suggested_unicks(): LuaIterable<string>;Get unique nick suggestions from the last request.
Returns
LuaIterable<string>
Unique nick suggestions from the last request.
Remarks
Result list is replaced by each suggestion request.
get_verify_error_descr()
get_verify_error_descr(): string;Returns
string
Description of the last validation failure.
is_email_searching_active()
is_email_searching_active(): boolean;Returns
boolean
Whether email search is active.
is_get_account_profiles_active()
is_get_account_profiles_active(): boolean;Returns
boolean
Whether profile fetching is active.
search_for_email()
search_for_email(email: string, cb: found_email_cb): void;Search for an account email.
Parameters
| Parameter | Type | Description |
|---|---|---|
email | string | Email to search. |
cb | found_email_cb | Completion callback. |
Returns
void
Remarks
Empty emails are rejected immediately through the callback.
stop_fetching_account_profiles()
stop_fetching_account_profiles(): void;Stop the active profile fetch request.
Returns
void
Remarks
Safe to call when no fetch is active.
stop_searching_email()
stop_searching_email(): void;Stop the active email search request.
Returns
void
Remarks
Safe to call when no search is active.
stop_suggest_unique_nicks()
stop_suggest_unique_nicks(): void;Stop the active nick suggestion request.
Returns
void
Remarks
Safe to call when no suggestion request is active.
suggest_unique_nicks()
suggest_unique_nicks(nick: string, b: suggest_nicks_cb): void;Request unique nick suggestions.
Parameters
| Parameter | Type | Description |
|---|---|---|
nick | string | Desired nick. |
b | suggest_nicks_cb | Completion callback. |
Returns
void
Remarks
Starts an asynchronous request and replaces the previous suggestion list when it completes.
verify_email()
verify_email(email: string): boolean;Validate email syntax.
Parameters
| Parameter | Type | Description |
|---|---|---|
email | string | Email to validate. |
Returns
boolean
Whether the email is accepted.
verify_password()
verify_password(password: string): boolean;Validate password syntax.
Parameters
| Parameter | Type | Description |
|---|---|---|
password | string | Password to validate. |
Returns
boolean
Whether the password is accepted.
verify_unique_nick()
verify_unique_nick(nick: string): boolean;Validate unique nick syntax.
Parameters
| Parameter | Type | Description |
|---|---|---|
nick | string | Nick to validate. |
Returns
boolean
Whether the nick is accepted.