com.adrenak.univoice 4.10.2 → 4.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -44,7 +44,7 @@ namespace Adrenak.UniVoice.Networks
44
44
 
45
45
  public void Dispose()
46
46
  {
47
- if (_networkManager)
47
+ if (_networkManager != null)
48
48
  {
49
49
  _networkManager.ClientManager.OnClientConnectionState -= OnClientConnectionStateChanged;
50
50
  _networkManager.ClientManager.OnAuthenticated -= OnClientAuthenticated;
@@ -97,7 +97,6 @@ namespace Adrenak.UniVoice.Networks
97
97
 
98
98
  private void OnClientConnectionStateChanged(ClientConnectionStateArgs args)
99
99
  {
100
- // TODO - do we need to check if host or is this enough?
101
100
  if (args.ConnectionState == LocalConnectionState.Started)
102
101
  {
103
102
  OnServerConnected(0);
@@ -150,7 +149,7 @@ namespace Adrenak.UniVoice.Networks
150
149
  return true;
151
150
  });
152
151
  }
153
-
152
+
154
153
  // We iterate through each recipient peer that the sender wants to send audio to, checking if
155
154
  // they have muted the sender, before forwarding the audio to them.
156
155
  foreach (var recipient in peersToForwardAudioTo) {
@@ -199,14 +198,16 @@ namespace Adrenak.UniVoice.Networks
199
198
 
200
199
  private void OnServerConnected(int connId)
201
200
  {
202
- Debug.unityLogger.Log(LogType.Log, TAG, $"Client {connId} connected");
201
+ if (ClientIDs.Contains(connId))
202
+ return;
203
203
  ClientIDs.Add(connId);
204
+ Debug.unityLogger.Log(LogType.Log, TAG, $"Client {connId} connected. IDs now: {string.Join(", ", ClientIDs)}");
204
205
  }
205
206
 
206
207
  private void OnServerDisconnected(int connId)
207
208
  {
208
209
  ClientIDs.Remove(connId);
209
- Debug.unityLogger.Log(LogType.Log, TAG, $"Client {connId} disconnected");
210
+ Debug.unityLogger.Log(LogType.Log, TAG, $"Client {connId} disconnected. IDs now: {string.Join(", ", ClientIDs)}");
210
211
  }
211
212
 
212
213
  private void SendToClient(int clientConnId, byte[] bytes, Channel channel)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.adrenak.univoice",
3
- "version": "4.10.2",
3
+ "version": "4.10.3",
4
4
  "displayName": "Adrenak.UniVoice",
5
5
  "description": "Voice chat/VoIP framework for Unity.",
6
6
  "unity": "2021.2",