Hi Guys, im looking at the shooter demo and come across something that i cant seem to figure out or find documentation on, could someone enlighten me
const UWorld* World = GetWorld();
const IOnlineEventsPtr Events = Online::GetEventsInterface(World);
const IOnlineIdentityPtr Identity = Online::GetIdentityInterface(World);
if (Events.IsValid() && Identity.IsValid())
{
AShooterPlayerController* PC = Cast<AShooterPlayerController>(Pawn->Controller);
if (PC)
{
ULocalPlayer* LocalPlayer = Cast<ULocalPlayer>(PC->Player);
if (LocalPlayer)
{
const int32 UserIndex = LocalPlayer->GetControllerId();
TSharedPtr<const FUniqueNetId> UniqueID = Identity->GetUniquePlayerId(UserIndex);
if (UniqueID.IsValid())
{
FVector Location = Pawn->GetActorLocation();
FOnlineEventParms Params;
Params.Add( TEXT( "SectionId" ), FVariantData( (int32)0 ) ); // unused
Params.Add( TEXT( "GameplayModeId" ), FVariantData( (int32)1 ) ); // @Todo determine game mode (ffa v tdm)
Params.Add( TEXT( "DifficultyLevelId" ), FVariantData( (int32)0 ) ); // unused
Params.Add( TEXT( "ItemId" ), FVariantData( (int32)Weapon->GetAmmoType() + 1 ) ); // @Todo come up with a better way to determine item id, currently health is 0 and ammo counts from 1
Params.Add( TEXT( "AcquisitionMethodId" ), FVariantData( (int32)0 ) ); // unused
Params.Add( TEXT( "LocationX" ), FVariantData( Location.X ) );
Params.Add( TEXT( "LocationY" ), FVariantData( Location.Y ) );
Params.Add( TEXT( "LocationZ" ), FVariantData( Location.Z ) );
Params.Add( TEXT( "ItemQty" ), FVariantData( (int32)Qty ) );
Events->TriggerEvent(*UniqueID, TEXT("CollectPowerup"), Params);
}
}
}
}
the *"Events->TriggerEvent(UniqueID, TEXT(“CollectPowerup”), Params);"
I can see it gets the GetEventsInterface near the top, which in itself im not familiar with, i cant see an endpoint that this gets received at or what listens to it?
could someone tell me how this TriggerEvent system works please?
ive searched everywhere and cant seem to find the correct documentation on how this functions and its driving me a bit insane
Kind regards