Retrieve Party Data (Server-Side)
Last updated on
Use this function to retrieve specific party data from the server side. Make sure the game server is authenticated to allow this API call.
- Unreal Engine
- Unity
FString PartyId = FString("SomePartyId");
FRegistry::ServerLobby.GetPartyStorage(PartyId, THandler<FAccelByteModelsPartyDataNotif>::CreateLambda([](const FAccelByteModelsPartyDataNotif& Result)
{
// Do something if GetPartyStorage has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetPartyStorage has an error
UE_LOG(LogTemp, Log, TEXT("Error GetPartyStorage, Error Code: %d Error Message: %s"), ErrorCode, *ErrorMessage);
}));
string partyId = "SomePartyId";
AccelBytePlugin.GetLobby().Connect();
AccelByteServerPlugin.GetLobby().GetPartyStorage(partyId, result =>
{
if (result.IsError)
{
// Do something if GetPartyStorage has an error
Debug.Log($"Error GetPartyStorage, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if GetPartyStorage has been successful
}
});