Documentation

Support

Vivox Unreal SDK

Vivox Unreal SDK

Participant events

Manage participant events when users join or leave channels.
Read time 1 minuteLast updated 2 days ago

The Vivox SDK posts information about individual participants in a channel that is visible to all other participants. This includes the following information:
  • When a user joins a channel
  • When a user leaves a channel
  • When there is an important change in user state, such as whether the user is speaking or typing
Handling participant events is optional. If there is no visualization of user state (for example, displaying who has voice enabled), then the game can ignore these events. To provide a visualization of user state information, a game must handle the following messages:
  • IChannelSession::EventAfterParticipantAdded
  • IChannelSession::EventBeforeBeforeParticipantRemoved
  • IChannelSession::EventAfterParticipantUpdated
The following code displays an example of how to handle these messages:
void UMyGameClass::OnChannelParticipantAdded(const IParticipant &Participant){ ChannelId Channel = Participant.ParentChannelSession().Channel(); UE_LOG(MyLog, Log, TEXT("%s has been added to %s\n"), *Participant.Account().Name(), *Channel.Name());}void UMyGameClass::OnChannelParticipantRemoved(const IParticipant &Participant){ ChannelId Channel = Participant.ParentChannelSession().Channel(); UE_LOG(MyLog, Log, TEXT("%s has been removed from %s\n"), *Participant.Account().Name(), *Channel.Name());}void UMyGameClass::OnChannelParticipantUpdated(const IParticipant &Participant){ ChannelId Channel = Participant.ParentChannelSession().Channel(); UE_LOG(MyLog, Log, TEXT("%s has been updated in %s\n"), *Participant.Account().Name(), *Channel.Name());}