ドキュメント

Vivox Unreal SDK

Vivox Unreal SDK

Leave a channel

How to remove a player from a Vivox channel and disconnect from communication.
読み終わるまでの所要時間 1 分最終更新 9ヶ月前

When the game wants to remove a user from a channel, the game sends an
IChannelSession::Disconnect
message to the Vivox SDK. This object remains in the user’s
ILoginSession.ChannelSessions
list.
Optionally, you can use the
ILoginSession::DeleteChannelSession
method to remove the disconnected channel object from the list; it is safe to do so immediately after disconnecting.
  • If the session is completely disconnected, the object is immediately removed from the list.
  • If the session is still in the process of disconnecting, the object is removed when the disconnection process is complete.
    注
    Disconnection is not an immediate operation and can take several seconds to complete.
The following code displays an example of how to perform this operation:
/* . . . */// ChannelIdToLeave is the ChannelId of the channel that is being disconnected fromMyLoginSession.GetChannelSession(ChannelIdToLeave).Disconnect();// Optionally remove disconnected channel session from list of user’s channel sessionsMyLoginSession.DeleteChannelSession(ChannelIdToLeave);/* . . . */
注
During a channel disconnection, the IChannelSession::EventChannelStateChanged event runs when all intended changes to the audio or text state are complete. For more information, see the Initiating a channel join section in Join a channel.