Skip to main content

DetectNetWortResultObserver [Player Network SDK Only]

Register the callback for network diagnostics, the game needs to process the callback function. For more information on the callback data structure, see GUADetectNetWortResult.

note

It is strongly recommended to perform registration in the startup function of the game application.[Player Network SDK Only].

Function Definition

The list of methods used to process the callback events.

Callback EventCommon[Player Network SDK Only][MSDK Only]
DetectNetWortResultEvents-StartDetectNetwork-
event OnResultHandler<GUADetectNetworkResult> DetectNetWortResultEvents;

Code Sample

UnionAdapterAPI.GetToolsService().DetectNetWortResultEvents += OnDetectNetWortResultEvents;

UnionAdapterAPI.GetToolsService().DetectNetWortResultEvents -= OnDetectNetWortResultEvents;

private void OnDetectNetWortResultEvents(GUADetectNetworkResult result)
{
string methodTag = "";
if (result.MethodId == (int)GUAMethodID.GUA_TOOLS_DETECT_NETWORK)
{
methodTag = "OnDetectNetworkResult";
}
Debug.Log(methodTag + result.ToString());
}