Interface IChatroomNetwork
Namespace: Adrenak.UniVoice
Assembly: cs.temp.dll.dll
Syntax
public interface IChatroomNetwork : IDisposable
Properties
OwnID
The ID of the local user in the current chatroom
Declaration
short OwnID { get; }
Property Value
Type | Description |
---|---|
Int16 |
PeerIDs
IDs of all the peers in the current chatroom (excluding OwnID)
Declaration
List<short> PeerIDs { get; }
Property Value
Type | Description |
---|---|
List<Int16> |
Methods
CloseChatroom(Object)
Closes a chatroom that the local user is hosting
Declaration
void CloseChatroom(object data = null)
Parameters
Type | Name | Description |
---|---|---|
Object | data | Any arguments used for closing the chatroom |
HostChatroom(Object)
Creates a chatroom
Declaration
void HostChatroom(object data = null)
Parameters
Type | Name | Description |
---|---|---|
Object | data | Any arguments for hosting a chatroom |
JoinChatroom(Object)
Joins a chatroom
Declaration
void JoinChatroom(object data = null)
Parameters
Type | Name | Description |
---|---|---|
Object | data | Any arguments used to join a chatroom |
LeaveChatroom(Object)
Leaves the chatroom the local user is currently in, if any
Declaration
void LeaveChatroom(object data = null)
Parameters
Type | Name | Description |
---|---|---|
Object | data | Any arguments used to leave a chatroom |
SendAudioSegment(Int16, ChatroomAudioSegment)
Sends audio data over the network
Declaration
void SendAudioSegment(short peerID, ChatroomAudioSegment data)
Parameters
Type | Name | Description |
---|---|---|
Int16 | peerID | |
ChatroomAudioSegment | data | The data to be transmitted. |
Events
OnAudioReceived
Fired when the network receives audio data from a peer. The first argument is the ID of the user the audio came from. The second is the audio segment.
Declaration
event Action<short, ChatroomAudioSegment> OnAudioReceived
Event Type
Type | Description |
---|---|
Action<Int16, ChatroomAudioSegment> |
OnAudioSent
Fired when the local user sets audio data to a peer. The first argument is the ID of the user the audio was sent to. The second is the audio segment.
Declaration
event Action<short, ChatroomAudioSegment> OnAudioSent
Event Type
Type | Description |
---|---|
Action<Int16, ChatroomAudioSegment> |
OnChatroomCreationFailed
Fired when the attempt to create a chatroom fails. Provides an exception as event data.
Declaration
event Action<Exception> OnChatroomCreationFailed
Event Type
Type | Description |
---|---|
Action<Exception> |
OnChatroomJoinFailed
Fired when an attempt to join a chatroom fails. Provides an exception as event data.
Declaration
event Action<Exception> OnChatroomJoinFailed
Event Type
Type | Description |
---|---|
Action<Exception> |
OnClosedChatroom
Fired when a chatroom is closed.
Declaration
event Action OnClosedChatroom
Event Type
Type | Description |
---|---|
Action |
OnCreatedChatroom
Fired when a chatroom is created.
Declaration
event Action OnCreatedChatroom
Event Type
Type | Description |
---|---|
Action |
OnJoinedChatroom
Fired when the local user joins a chatroom. Provides the chatroom ID assigned as event data.
Declaration
event Action<short> OnJoinedChatroom
Event Type
Type | Description |
---|---|
Action<Int16> |
OnLeftChatroom
Fired when the local user leaves a chatroom
Declaration
event Action OnLeftChatroom
Event Type
Type | Description |
---|---|
Action |
OnPeerJoinedChatroom
Fired when a peer joins the chatroom. Provides the ID of the peer as event data. NOTE: This action also MUST be called for all previously existing peers when a local user connects to a network. This allows the local user to know about the users that were in the chatroom before they joined.
Declaration
event Action<short> OnPeerJoinedChatroom
Event Type
Type | Description |
---|---|
Action<Int16> |
OnPeerLeftChatroom
Fired when a peer leaves the chatroom. Provides the ID of the peer as event data.
Declaration
event Action<short> OnPeerLeftChatroom
Event Type
Type | Description |
---|---|
Action<Int16> |