Browse Source

A bit of cleanup

master
Nico de Poel 4 years ago
parent
commit
be28c3272c
  1. 50
      Assets/Scripts/EOSVoiceChat.cs

50
Assets/Scripts/EOSVoiceChat.cs

@ -98,12 +98,7 @@ public class EOSVoiceChat: IDisposable
LobbyDetailsHandle = lobbyDetails, LobbyDetailsHandle = lobbyDetails,
PresenceEnabled = false, PresenceEnabled = false,
}; };
lobbyInterface.JoinLobby
(
ref joinLobbyOptions,
connectArgs,
HandleLobbyJoined
);
lobbyInterface.JoinLobby(ref joinLobbyOptions, connectArgs, HandleLobbyJoined);
break; break;
default: default:
Debug.Log($"Creating new chat lobby..."); Debug.Log($"Creating new chat lobby...");
@ -119,12 +114,7 @@ public class EOSVoiceChat: IDisposable
BucketId = Application.productName, // TODO: do we need anything more specific than this? BucketId = Application.productName, // TODO: do we need anything more specific than this?
EnableRTCRoom = true, EnableRTCRoom = true,
}; };
lobbyInterface.CreateLobby
(
ref createLobbyOptions,
connectArgs,
HandleLobbyCreated
);
lobbyInterface.CreateLobby(ref createLobbyOptions, connectArgs, HandleLobbyCreated);
break; break;
} }
} }
@ -237,8 +227,6 @@ public class EOSVoiceChat: IDisposable
if (!IsConnected) if (!IsConnected)
return; return;
void OnUpdateSendingCallback(ref UpdateSendingCallbackInfo data) { }
var updateSendingOptions = new UpdateSendingOptions var updateSendingOptions = new UpdateSendingOptions
{ {
LocalUserId = localUserProvider.Invoke(), LocalUserId = localUserProvider.Invoke(),
@ -246,6 +234,8 @@ public class EOSVoiceChat: IDisposable
AudioStatus = muted ? RTCAudioStatus.Disabled : RTCAudioStatus.Enabled, AudioStatus = muted ? RTCAudioStatus.Disabled : RTCAudioStatus.Enabled,
}; };
audioInterface.UpdateSending(ref updateSendingOptions, null, OnUpdateSendingCallback); audioInterface.UpdateSending(ref updateSendingOptions, null, OnUpdateSendingCallback);
void OnUpdateSendingCallback(ref UpdateSendingCallbackInfo data) { }
} }
/// <summary> /// <summary>
@ -257,8 +247,6 @@ public class EOSVoiceChat: IDisposable
if (!IsConnected) if (!IsConnected)
return; return;
void OnUpdateReceivingCallback(ref UpdateReceivingCallbackInfo data) { }
var updateReceivingOptions = new UpdateReceivingOptions var updateReceivingOptions = new UpdateReceivingOptions
{ {
LocalUserId = localUserProvider.Invoke(), LocalUserId = localUserProvider.Invoke(),
@ -267,6 +255,8 @@ public class EOSVoiceChat: IDisposable
AudioEnabled = !muted, AudioEnabled = !muted,
}; };
audioInterface.UpdateReceiving(ref updateReceivingOptions, null, OnUpdateReceivingCallback); audioInterface.UpdateReceiving(ref updateReceivingOptions, null, OnUpdateReceivingCallback);
void OnUpdateReceivingCallback(ref UpdateReceivingCallbackInfo data) { }
} }
/// <summary> /// <summary>
@ -278,8 +268,6 @@ public class EOSVoiceChat: IDisposable
if (!IsConnected) if (!IsConnected)
return; return;
void OnUpdateReceivingCallback(ref UpdateReceivingCallbackInfo data) { }
var localUserId = localUserProvider.Invoke(); var localUserId = localUserProvider.Invoke();
foreach (var remoteProductUser in chatUsers.Keys) foreach (var remoteProductUser in chatUsers.Keys)
{ {
@ -292,6 +280,8 @@ public class EOSVoiceChat: IDisposable
}; };
audioInterface.UpdateReceiving(ref updateReceivingOptions, null, OnUpdateReceivingCallback); audioInterface.UpdateReceiving(ref updateReceivingOptions, null, OnUpdateReceivingCallback);
} }
void OnUpdateReceivingCallback(ref UpdateReceivingCallbackInfo data) { }
} }
/// <summary> /// <summary>
@ -392,12 +382,8 @@ public class EOSVoiceChat: IDisposable
if (!onConnectionChangedCallbackId.HasValue) if (!onConnectionChangedCallbackId.HasValue)
{ {
var addNotifyOptions = new AddNotifyRTCRoomConnectionChangedOptions(); var addNotifyOptions = new AddNotifyRTCRoomConnectionChangedOptions();
onConnectionChangedCallbackId = lobbyInterface.AddNotifyRTCRoomConnectionChanged
(
ref addNotifyOptions,
null,
HandleConnectionChanged
);
onConnectionChangedCallbackId = lobbyInterface.AddNotifyRTCRoomConnectionChanged(
ref addNotifyOptions, null, HandleConnectionChanged);
} }
if (!onParticipantStatusChangedCallbackId.HasValue) if (!onParticipantStatusChangedCallbackId.HasValue)
@ -407,12 +393,8 @@ public class EOSVoiceChat: IDisposable
LocalUserId = localUserId, LocalUserId = localUserId,
RoomName = rtcRoomName, RoomName = rtcRoomName,
}; };
onParticipantStatusChangedCallbackId = rtcInterface.AddNotifyParticipantStatusChanged
(
ref addNotifyOptions,
null,
HandleParticipantStatusChanged
);
onParticipantStatusChangedCallbackId = rtcInterface.AddNotifyParticipantStatusChanged(
ref addNotifyOptions, null, HandleParticipantStatusChanged);
} }
if (!onParticipantUpdatedCallbackId.HasValue) if (!onParticipantUpdatedCallbackId.HasValue)
@ -422,12 +404,8 @@ public class EOSVoiceChat: IDisposable
LocalUserId = localUserId, LocalUserId = localUserId,
RoomName = rtcRoomName, RoomName = rtcRoomName,
}; };
onParticipantUpdatedCallbackId = audioInterface.AddNotifyParticipantUpdated
(
ref addNotifyOptions,
null,
HandleParticipantUpdated
);
onParticipantUpdatedCallbackId = audioInterface.AddNotifyParticipantUpdated(
ref addNotifyOptions, null, HandleParticipantUpdated);
} }
} }

Loading…
Cancel
Save