MarkSessionLoad [Player Network SDK Only]
[Player Network SDK Only] This API marks the start of the data collection session.
Under normal conditions, Player Network SDK does not collect performance data. It will only start to collect performance data after a session start marker and then upload the data to the SDK server.
Sessions in Player Network SDK have purely logical significance. They have no direct association with physical scenes. Therefore, the session marker API can be called at any location. Generally, it is called before the Application.LoadLevel
function in Unity.
If users add the ID of the battle server to be measured in extra_json
in the session marker, the network latency speed measurement will start automatically.
Supported Platform
- Unity
- Unreal Engine
Supports
Android, iOS, Windows
platform.Supports
Android, iOS, Windows
platform.Function Definition
- Unity
- Unreal Engine
void MarkSessionLoad(string sessionName,string extra_json)
static void MarkSessionLoad(const char *session_name, const std::string &extra_json = "{}");
Input Parameters
- Unity
- Unreal Engine
Parameter | Type | Description |
---|---|---|
sessionName | string | Session name |
extra_json | string | Additional parameters as a JSON string defined by the game |
Parameter | Type | Description |
---|---|---|
session_name | char* | Session name |
extra_json | std::string | Additional parameters as a JSON string defined by the game |
Additional Parameter JSON String
Parameter | Type | Description |
---|---|---|
GAME_BATTLE_SERVER_ID | string | ID of battle server for speed testing |
Code Sample
- Unity
- Unreal Engine
string sessionName = "UnityScene";
string extra_json = "{\"GAME_BATTLE_SERVER_ID\":\"id\"}";
UnionAdapterAPI.GetReportService().MarkSessionLoad("UnityScene", extra_json); // Start the network speed test
std::string extra_json = "{\"GAME_BATTLE_SERVER_ID\":\"id\"}";
GUA_NAMESPACE::GUAReportService::MarkSessionLoad("UnrealScene", extra_json); // Start the network speed test