-
Notifications
You must be signed in to change notification settings - Fork 1
User
This is a module for handling the user account.
This module offers a collection of functions designed to address specific tasks and provide utilities for various purposes. Explore the available functions to make the most of the functionalities provided by this module.
- GOG_User_DeleteUserData
- GOG_User_GetAccessToken
- GOG_User_GetGalaxyID
- GOG_User_GetRefreshToken
- GOG_User_GetSessionID
- GOG_User_GetUserData
- GOG_User_GetUserDataByIndex
- GOG_User_GetUserDataCount
- GOG_User_IsLoggedOn
- GOG_User_IsUserDataAvailable
- GOG_User_ReportInvalidAccessToken
- GOG_User_RequestUserData
- GOG_User_SetUserData
- GOG_User_SignedIn
- GOG_User_SignInAnonymous
- GOG_User_SignInAnonymousTelemetry
- GOG_User_SignInCredentials
- GOG_User_SignInGalaxy
- GOG_User_SignInLauncher
- GOG_User_SignInServerKey
- GOG_User_SignInToken
- GOG_User_SignOut
This module offers a collection of structs, which serve as custom data models for organizing and structuring data. Explore the provided structs to better understand the relationships between data elements and simplify your data manipulation tasks.
This function clears a property of user data storage. This is an asynchronous function that will trigger a Social Async Event when the task is finished.
Warning
REQUIREMENT Retrieve the user data first by calling GOG_User_RequestUserData.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
GOG_User_DeleteUserData(key)
Argument | Type | Description |
---|---|---|
key | String | The name of the property of the user data storage. |
Returns:
N/A
Triggers:
Key | Type | Description |
---|---|---|
type | String | "GOG_User_DeleteUserData" |
error | String | The error message; only if request failed ✴️ OPTIONAL |
Example:
GOG_User_DeleteUserData("weapon");
The code sample above starts a task for deleting user data, which results can be caught inside a Social Async Event.
if (async_load[? "type"] == "GOG_User_DeleteUserData")
{
if (ds_map_exists(async_load, "error"))
{
show_debug_message(async_load[?"error"]);
exit;
}
show_debug_message("DeleteUserData SUCCESS");
}
This code sample provides an example of handling the returned callback data.
This function returns the access token for current session.
Syntax:
GOG_User_GetAccessToken()
Returns:
Example:
var _accessToken = GOG_User_GetAccessToken();
The code above provides a simple usage example.
This function returns the ID of the user, provided that the user is signed in.
Syntax:
GOG_User_GetGalaxyID()
Returns:
Example:
var _myUsedID = GOG_User_GetGalaxyID();
The code above provides a simple usage example.
This function returns the ID of current session.
Syntax:
GOG_User_GetSessionID()
Returns:
Example:
var _sessionID = GOG_User_GetSessionID();
The code above provides a simple usage example.
This function returns the refresh token for the current version.
Syntax:
GOG_User_GetRefreshToken()
Returns:
Example:
var _refreshToken = GOG_User_GetRefreshToken();
The code above provides a simple usage example.
This function returns an entry from the data storage of current user.
Warning
REQUIREMENT Retrieve the user data first by calling GOG_User_RequestUserData.
Syntax:
GOG_User_GetUserData(key, userID=undefined)
Argument | Type | Description |
---|---|---|
key | String | The name of the property of the user data storage. |
userID | GalaxyID | The ID of the user. It can be omitted when reading own data. |
Returns:
Example:
var _data = GOG_User_GetUserData("data", GOG_User_GetGalaxyID());
The code above provides a simple usage example.
This function returns a property from the user data storage by index.
Warning
REQUIREMENT Retrieve the user data first by calling GOG_User_RequestUserData.
Syntax:
GOG_User_GetUserDataByIndex(index, userID=undefined)
Argument | Type | Description |
---|---|---|
index | Real | Index as an integer in the range of [0, number of entries]. |
userID | GalaxyID | The ID of the user. It can be omitted when reading own data. |
Returns:
Example:
for(var a = 0 ; a < GOG_User_GetUserDataCount(GOG_User_GetGalaxyID()) ; a ++ )
draw_text(100, 220 + a*30, GOG_User_GetUserDataByIndex(a, GOG_User_GetGalaxyID()));
The code above provides a simple usage example.
This function returns the number of entries in the user data storage.
Warning
REQUIREMENT Retrieve the user data first by calling GOG_User_RequestUserData.
Syntax:
GOG_User_GetUserDataCount(userID=undefined)
Argument | Type | Description |
---|---|---|
userID | GalaxyID | The ID of the user. It can be omitted when reading own data. |
Returns:
Example:
for(var a = 0 ; a < GOG_User_GetUserDataCount(GOG_User_GetGalaxyID()) ; a ++ )
draw_text(100, 220 + a*30, GOG_User_GetUserDataByIndex(a, GOG_User_GetGalaxyID()));
The code above provides a simple usage example.
This function checks if the user is logged on to Galaxy backend services.
Syntax:
GOG_User_IsLoggedOn()
Returns:
Example:
if(GOG_User_IsLoggedOn())
{
//User is logged, do something...
}
The code above provides a simple usage example.
This function checks if user data exists.
Warning
REQUIREMENT Retrieve the user data first by calling GOG_User_RequestUserData.
Syntax:
GOG_User_IsUserDataAvailable(userID=undefined)
Argument | Type | Description |
---|---|---|
userID | GalaxyID | The ID of the user. It can be omitted when reading own data. |
Returns:
Example:
if(GOG_User_IsUserDataAvailable())
{
//User data is available, do something
}
The code above provides a simple usage example.
This function reports the current access token as no longer working.
Syntax:
GOG_User_ReportInvalidAccessToken(accessToken, info)
Argument | Type | Description |
---|---|---|
accessToken | String | The invalid access token. |
info | String | Additional information. |
Returns:
N/A
Example:
GOG_User_ReportInvalidAccessToken(accessToken, "A hacker wanna be...");
The code above provides a simple usage example.
This function retrieves/refreshes user data storage. This is an asynchronous function that will trigger a Social Async Event when the task is finished.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
GOG_User_RequestUserData(userID=undefined)
Argument | Type | Description |
---|---|---|
userID | GalaxyID | The ID of the user. It can be omitted when reading own data. |
Returns:
N/A
Triggers:
Key | Type | Description |
---|---|---|
type | String | "GOG_User_RequestUserData" |
error | String | The error message; only if request failed ✴️ OPTIONAL |
Example:
GOG_User_RequestUserData("BestScoresLeaderboard");
The code sample above starts a task for requesting user data, which results can be caught inside a Social Async Event.
if (async_load[? "type"] == "GOG_User_RequestUserData")
{
show_debug_message("RequestUserData SUCCESS");
}
This code sample provides an example of handling the returned callback data.
This function creates or updates an entry in the user data storage.
Warning
REQUIREMENT Retrieve the user data first by calling GOG_User_RequestUserData.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
GOG_User_SetUserData(key, value)
Argument | Type | Description |
---|---|---|
key | String | The name of the property of the user data storage with the limit of 1023 bytes. |
value | String | The value of the property to set with the limit of 4095 bytes. |
Returns:
N/A
Triggers:
Key | Type | Description |
---|---|---|
type | String | "GOG_User_SetUserData" |
userID | GalaxyID | The ID of the user. |
Example:
GOG_User_SetUserData("weapon", "sword");
The code sample above starts a task for setting user data, which results can be caught inside a Social Async Event.
if (async_load[? "type"] == "GOG_User_SetUserData")
{
show_debug_message("User data was set for user {0}", async_load[? "userID"]);
}
This code sample provides an example of handling the returned callback data.
This function checks if the user is signed in to Galaxy. The user should be reported as signed in as soon as the authentication process is finished. If the user is not able to sign in or gets signed out, there might be either a networking issue or a limited availability of Galaxy backend services. After loosing authentication the user needs to sign in again in order for the Galaxy Peer to operate.
Syntax:
GOG_User_SignedIn()
Returns:
Example:
if(GOG_User_SignedIn())
{
//user signed in, do something
}
The code above provides a simple usage example.
This function authenticates the Galaxy Game Server anonymously. This is an asynchronous function that will trigger a Social Async Event when the task is finished.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
GOG_User_SignInAnonymous()
Returns:
N/A
Triggers:
Key | Type | Description |
---|---|---|
type | String | "GOG_User_SignInAnonymous" |
error | String | The error message; only if request failed ✴️ OPTIONAL |
Example:
GOG_User_SignInAnonymous();
The code sample above starts a task for signing in anonymously, which results can be caught inside a Social Async Event.
if (async_load[? "type"] == "GOG_User_SignInAnonymous")
{
if (ds_map_exists(async_load, "error"))
{
show_debug_message(async_load[?"error"]);
exit;
}
show_debug_message("SignInAnonymous SUCCESS");
}
This code sample provides an example of handling the returned callback data.
This function authenticates the Galaxy Peer anonymously. This authentication method enables the peer to send anonymous telemetry events. This is an asynchronous function that will trigger a Social Async Event when the task is finished.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
GOG_User_SignInAnonymousTelemetry()
Returns:
N/A
Triggers:
Key | Type | Description |
---|---|---|
type | String | "GOG_User_SignInAnonymousTelemetry" |
error | String | The error message; only if the request failed ✴️ OPTIONAL |
Example:
GOG_User_SignInAnonymousTelemetry();
The code sample above starts a task for signing in anonymously (with anonymous telemetry), which results can be caught inside a Social Async Event.
if (async_load[? "type"] == "GOG_User_SignInAnonymousTelemetry")
{
if (ds_map_exists(async_load, "error"))
{
show_debug_message(async_load[?"error"]);
exit;
}
show_debug_message("SignInAnonymousTelemetry SUCCESS");
}
This code sample provides an example of handling the returned callback data.
This function authenticates the Galaxy Peer with specified user credentials. This is an asynchronous function that will trigger a Social Async Event when the task is finished.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
GOG_User_SignInCredentials(login, password)
Argument | Type | Description |
---|---|---|
login | String | The user's login. |
password | String | The user's password. |
Returns:
N/A
Triggers:
Key | Type | Description |
---|---|---|
type | String | "GOG_User_SignInCredentials" |
error | String | The error message; only if request failed ✴️ OPTIONAL |
Example:
GOG_User_SignInServerKey(refreshToken);
The code sample above starts a task for signing in with credentials, which results can be caught inside a Social Async Event.
if (async_load[? "type"] == "GOG_User_SignInCredentials")
{
if (ds_map_exists(async_load, "error"))
{
show_debug_message(async_load[?"error"]);
exit;
}
show_debug_message("SignInToken SUCCESS");
}
This code sample provides an example of handling the returned callback data.
This function authenticates the Galaxy Peer based on Galaxy Client authentication. This is an asynchronous function that will trigger a Social Async Event when the task is finished.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
GOG_User_SignInGalaxy(requireOnline=undefined, timeout=undefined)
Argument | Type | Description |
---|---|---|
requireOnline | Boolean | OPTIONAL: Indicates if sing in with Galaxy backend is required. |
timeout | Real | OPTIONAL: How much time to wait until giving up the login process |
Returns:
N/A
Triggers:
Key | Type | Description |
---|---|---|
type | String | "GOG_User_SignInGalaxy" |
error | String | The error message; only if request failed ✴️ OPTIONAL |
Example:
GOG_User_SignInGalaxy(false, 4); // don't require online, wait at least 4 seconds before giving up
The code sample above starts a task for signing in with galaxy client authentication, which results can be caught inside a Social Async Event.
if (async_load[? "type"] == "GOG_User_SignInGalaxy")
{
if (ds_map_exists(async_load, "error"))
{
show_debug_message(async_load[?"error"]);
exit;
}
show_debug_message("SignInGalaxy SUCCESS");
}
This code sample provides an example of handling the returned callback data.
This function authenticates the Galaxy Peer based on launcher authentication. This is an asynchronous function that will trigger a Social Async Event when the task is finished.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
GOG_User_SignInLauncher()
Returns:
N/A
Triggers:
Key | Type | Description |
---|---|---|
type | String | "GOG_User_SignInLauncher" |
error | String | The error message; only if request failed ✴️ OPTIONAL |
Example:
GOG_User_SignInLauncher();
The code sample above starts a task for signing in with launcher authentication, which results can be caught inside a Social Async Event.
if (async_load[? "type"] == "GOG_User_SignInLauncher")
{
if (ds_map_exists(async_load, "error"))
{
show_debug_message(async_load[?"error"]);
exit;
}
show_debug_message("SignInLauncher SUCCESS");
}
This code sample provides an example of handling the returned callback data.
This function authenticates the Galaxy Peer with a specified server key. This is an asynchronous function that will trigger a Social Async Event when the task is finished.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
GOG_User_SignInServerKey(key)
Argument | Type | Description |
---|---|---|
key | String | The server key. |
Returns:
N/A
Triggers:
Key | Type | Description |
---|---|---|
type | String | "GOG_User_SignInServerKey" |
error | String | The error message; only if request failed ✴️ OPTIONAL |
Example:
GOG_User_SignInServerKey(key);
The code sample above starts a task for signing in using a server key, which results can be caught inside a Social Async Event.
if (async_load[? "type"] == "GOG_User_SignInServerKey")
{
if (ds_map_exists(async_load, "error"))
{
show_debug_message(async_load[?"error"]);
exit;
}
show_debug_message("SignInServerKey SUCCESS");
}
This code sample provides an example of handling the returned callback data.
This function authenticates the Galaxy Peer with refresh token. This is an asynchronous function that will trigger a Social Async Event when the task is finished.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
GOG_User_SignInToken(refreshToken)
Argument | Type | Description |
---|---|---|
refreshToken | String | The refresh token obtained from Galaxy login page. |
Returns:
N/A
Triggers:
Key | Type | Description |
---|---|---|
type | String | "GOG_User_SignInToken" |
error | String | The error message; only if request failed ✴️ OPTIONAL |
Example:
GOG_User_SignInToken(refreshToken);
The code sample above starts a task for signing in using a refresh token, which results can be caught inside a Social Async Event.
if (async_load[? "type"] == "GOG_User_SignInToken")
{
if (ds_map_exists(async_load, "error"))
{
show_debug_message(async_load[?"error"]);
exit;
}
show_debug_message("SignInToken SUCCESS");
}
This code sample provides an example of handling the returned callback data.
This function signs the Galaxy Peer out.
Syntax:
GOG_User_SignOut()
Returns:
N/A
Example:
GOG_User_SignOut();
The code above provides a simple usage example.
This structure represents a GOG ID (User or Lobby) and is used all across the GOG API as either a return value or function argument.
Warning
These values shouldn't be used or changed and are to be passed back into the extension to perform the desired actions.
This struct is referenced by the following functions:
- GOG_Friends_DeleteFriend
- GOG_Friends_FindUser
- GOG_Friends_GetFriendAvatarImageID
- GOG_Friends_GetFriendAvatarImageRGBA
- GOG_Friends_GetFriendAvatarUrl
- GOG_Friends_GetFriendByIndex
- GOG_Friends_GetFriendPersonaName
- GOG_Friends_GetFriendPersonaState
- GOG_Friends_GetRichPresence
- GOG_Friends_GetRichPresenceByIndex
- GOG_Friends_GetRichPresenceCount
- GOG_Friends_GetRichPresenceKeyByIndex
- GOG_Friends_IsFriend
- GOG_Friends_IsFriendAvatarImageRGBAAvailable
- GOG_Friends_IsUserInformationAvailable
- GOG_Friends_IsUserInTheSameGame
- GOG_Friends_RequestRichPresence
- GOG_Friends_RequestUserInformation
- GOG_Friends_RespondToFriendInvitation
- GOG_Friends_SendFriendInvitation
- GOG_Friends_SendInvitation
- GOG_Stats_GetStatFloat
- GOG_Stats_GetStatInt
- GOG_Stats_GetUserTimePlayed
- GOG_Stats_RequestUserStatsAndAchievements
- GOG_Stats_RequestUserTimePlayed
- GOG_Storage_GetSharedFileOwner
- GOG_User_GetGalaxyID
- GOG_User_GetUserData
- GOG_User_GetUserDataByIndex
- GOG_User_GetUserDataCount
- GOG_User_IsUserDataAvailable
- GOG_User_RequestUserData
- GOG_User_SetUserData
This struct is referenced by the following structs:
Member | Type | Description |
---|---|---|
ID | Real | The real ID value. |
IDType | Real | The type of the ID. |
A struct containing a key-value pair.
This struct is referenced by the following functions:
Member | Type | Description |
---|---|---|
key | String | The name of the property of the user data storage. |
value | String | The value of the property of the user data storage. |
GameMaker 2024