Remote Peer
Huddle01Core.PeerAdded(string peerInfo);
This event gets invoked when any peer is added in the current room. Subscribe to this event to get the notification
Parameters
Param | Type | Description |
---|---|---|
peerInfo | string | The peer ID of the Remote Peer who has joined the room |
.csharp
private void OnEnable()
{
Huddle01Core.PeerAdded += OnPeerJoined;
}
private void OnDisable()
{
Huddle01Core.PeerAdded -= OnPeerJoined;
}
private void OnPeerJoined(string peerId)
{
Debug.Log($"Peer Joined : {peerId}");
}
Huddle01Core.PeerLeft(string peerId);
This is called when any peer left current room. Subscribe to this event to get the notification
Parameters
Param | Type | Description |
---|---|---|
peerId | string | The peer ID of the Remote Peer who has left the room |
.csharp
private void OnEnable()
{
Huddle01Core.PeerLeft += OnPeerLeft;
}
private void OnDisable()
{
Huddle01Core.PeerLeft -= OnPeerLeft;
}
private void OnPeerLeft(string peerId)
{
Debug.Log($"Peer left : {peerId}");
}
Huddle01Core.PeerMetadata(string peerMetadata)
This is called when any peer in the room update its metadata. Subscribe to this event to get the notification
Parameters
Param | Type | Description |
---|---|---|
peerMetadata | string | The peer ID of the Remote Peer who has updated the metadata. Peerid is a part od metadata |
.csharp
private void OnEnable()
{
Huddle01Core.PeerMetadata += OnPeerMetaDataUpdated;
}
private void OnDisable()
{
Huddle01Core.PeerMetadata -= OnPeerMetaDataUpdated;
}
private void OnPeerMetaDataUpdated(PeerMetadata peerInfo)
{
Debug.Log($"OnPeerMetaDataUpdated : {peerInfo.PeerId}");
}