Skip to main content

Guild Callback (GroupBaseResultObserver)

If you are using Unreal Engine, see GroupBaseResultObserver for Unreal Engine SDK.

Register the callback for the Player Network SDK guild module; the game needs to register the callback for handling.For more on the callback data structure, see BaseResult.

note

It is strongly recommended that games register during the application start-up function.

Function definition

// Add INTLBaseResult Callback
public static void AddGroupBaseResultObserver(OnINTLResultHandler<INTLBaseResult> callback);
// Remove INTLBaseResult Callback
public static void RemoveGroupBaseResultObserver(OnINTLResultHandler<INTLBaseResult> callback);

Code sample

// Add Callback
public void AddGroupObserver()
{
INTLAPI.AddGroupBaseResultObserver(OnGroupBaseEvent);
}

// Remove Callback
public void RemoveFriendObserver()
{
INTLAPI.RemoveGroupBaseResultObserver(OnGroupBaseEvent);
}

// OnGroupBaseEvent for INTLBaseResult
public void OnGroupBaseEvent(INTLBaseResult ret)
{
Debug.Log($"MethodID: {ret.MethodId}");

string methodTag = "";
if (ret.MethodId == (int)INTLMethodID.INTL_GROUP_SHOW_AGREEMENT_WINDOW)
{
methodTag = "ShowAgreementWindow";
} else if (ret.MethodId == (int)INTLMethodID.INTL_GROUP_SHOW_ROOM)
{
methodTag = "ShowRoom";
}
ShowLogInNewLine(methodTag + Tools.Instance.GetRetString(ret));
}