-
Notifications
You must be signed in to change notification settings - Fork 4
Metrics
Epic Online Services Interface: Metrics Interface
The Metrics Interface tracks your game's usage and populates the Game Analytics dashboard in the Developer Portal. This data includes active, online instances of the game's client and server, and past sessions played by local players.
These functions are provided for handling metrics:
These are the constants used by this API:
Epic Online Services Function: EOS_Metrics_BeginPlayerSession
This function logs the start of a new game session for a local player. The game client should call this function whenever it joins into a new multiplayer, peer-to-peer or single player game session. Each call to EpicGames_Metrics_BeginPlayerSession must be matched with a corresponding call to EpicGames_Metrics_EndPlayerSession.
Syntax:
EpicGames_Metrics_BeginPlayerSession(accountID, DisplayName, AccountIdType, ControllerType, ServerIp, GameSessionId)
Argument | Type | Description |
---|---|---|
accountID | String | An Epic Account ID. Set this field when AccountIdType is set to EpicGames_MAIT_Epic . |
DisplayName | String | The in-game display name for the user. |
AccountIdType | EpicGames_Metrics_Account_Id_Type | Account ID type that is set in the union. |
ControllerType | EpicGames_Metrics_Account_Id_Type | The user's game controller type. |
ServerIp | String | IP address of the game server hosting the game session. For a localhost session, set to undefined . If both IPv4 and IPv6 addresses are available, use the IPv6 address. |
GameSessionId | String | Optional, application-defined custom match session identifier. If the identifier is not used, set to undefined which will be shown in the Played Sessions listing at the user profile dashboard. |
Returns:
Example:
var _struct = EpicGames_Metrics_BeginPlayerSession(
AccountID,
"YYEpicGames",
EpicGames_MAIT_Epic,
EpicGames_UCT_MouseKeyboard,
"No Server",
"AnyRandomIDString");
if(struct.status != EpicGames_Success)
{
show_debug_message("EpicGames_Metrics_BeginPlayerSession Failed");
}
The above code shows an example of how the function should be used.
Epic Online Services Function: EOS_Metrics_EndPlayerSession
This function logs the end of a game session for a local player. Call once when the game client leaves the active game session. Each call to EpicGames_Metrics_BeginPlayerSession must be matched with a corresponding call to EpicGames_Metrics_EndPlayerSession.
Syntax:
EpicGames_Metrics_EndPlayerSession(accountID, AccountIdType)
Argument | Type | Description |
---|---|---|
accountID | String | Set this field when AccountIdType is set to EpicGames_MAIT_Epic
|
AccountIdType | EpicGames_Metrics_Account_Id_Type | The Account ID type that is set in the union |
Returns:
Example:
var _struct = EpicGames_Metrics_EndPlayerSession(AccountID, EpicGames_MAIT_Epic);
show_debug_message("EpicGames_Metrics_EndPlayerSession: " + string(_struct.status_message));
The above code shows an example of how the function should be used.
Epic Online Services Enum: EOS_EMetricsAccountIdType
These constants are used to describe the AccountId type.
These constants are referenced by the following functions:
Member | Description |
---|---|
EpicGames_MAIT_Epic |
An Epic Account ID |
EpicGames_MAIT_External |
An external service Account ID |
Epic Online Services Enum: EOS_EUserControllerType
These constants are used to describe the type of controller being used during the current player session.
Member | Description |
---|---|
EpicGames_UCT_Unknown |
The game controller type is unknown |
EpicGames_UCT_MouseKeyboard |
Mouse and keyboard controller |
EpicGames_UCT_GamepadControl |
Gamepad controller |
EpicGames_UCT_UCT_TouchControl |
Touch controller |
YoYoGames 2024