From be28c3272c8496ba5d9d9be02158743d9823d050 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Mon, 20 Jun 2022 11:53:35 +0200 Subject: [PATCH] A bit of cleanup --- Assets/Scripts/EOSVoiceChat.cs | 50 ++++++++++------------------------ 1 file changed, 14 insertions(+), 36 deletions(-) diff --git a/Assets/Scripts/EOSVoiceChat.cs b/Assets/Scripts/EOSVoiceChat.cs index d39bbb8..cfbb01b 100644 --- a/Assets/Scripts/EOSVoiceChat.cs +++ b/Assets/Scripts/EOSVoiceChat.cs @@ -98,12 +98,7 @@ public class EOSVoiceChat: IDisposable LobbyDetailsHandle = lobbyDetails, PresenceEnabled = false, }; - lobbyInterface.JoinLobby - ( - ref joinLobbyOptions, - connectArgs, - HandleLobbyJoined - ); + lobbyInterface.JoinLobby(ref joinLobbyOptions, connectArgs, HandleLobbyJoined); break; default: 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? EnableRTCRoom = true, }; - lobbyInterface.CreateLobby - ( - ref createLobbyOptions, - connectArgs, - HandleLobbyCreated - ); + lobbyInterface.CreateLobby(ref createLobbyOptions, connectArgs, HandleLobbyCreated); break; } } @@ -237,8 +227,6 @@ public class EOSVoiceChat: IDisposable if (!IsConnected) return; - void OnUpdateSendingCallback(ref UpdateSendingCallbackInfo data) { } - var updateSendingOptions = new UpdateSendingOptions { LocalUserId = localUserProvider.Invoke(), @@ -246,6 +234,8 @@ public class EOSVoiceChat: IDisposable AudioStatus = muted ? RTCAudioStatus.Disabled : RTCAudioStatus.Enabled, }; audioInterface.UpdateSending(ref updateSendingOptions, null, OnUpdateSendingCallback); + + void OnUpdateSendingCallback(ref UpdateSendingCallbackInfo data) { } } /// @@ -257,8 +247,6 @@ public class EOSVoiceChat: IDisposable if (!IsConnected) return; - void OnUpdateReceivingCallback(ref UpdateReceivingCallbackInfo data) { } - var updateReceivingOptions = new UpdateReceivingOptions { LocalUserId = localUserProvider.Invoke(), @@ -267,6 +255,8 @@ public class EOSVoiceChat: IDisposable AudioEnabled = !muted, }; audioInterface.UpdateReceiving(ref updateReceivingOptions, null, OnUpdateReceivingCallback); + + void OnUpdateReceivingCallback(ref UpdateReceivingCallbackInfo data) { } } /// @@ -278,8 +268,6 @@ public class EOSVoiceChat: IDisposable if (!IsConnected) return; - void OnUpdateReceivingCallback(ref UpdateReceivingCallbackInfo data) { } - var localUserId = localUserProvider.Invoke(); foreach (var remoteProductUser in chatUsers.Keys) { @@ -292,6 +280,8 @@ public class EOSVoiceChat: IDisposable }; audioInterface.UpdateReceiving(ref updateReceivingOptions, null, OnUpdateReceivingCallback); } + + void OnUpdateReceivingCallback(ref UpdateReceivingCallbackInfo data) { } } /// @@ -392,12 +382,8 @@ public class EOSVoiceChat: IDisposable if (!onConnectionChangedCallbackId.HasValue) { var addNotifyOptions = new AddNotifyRTCRoomConnectionChangedOptions(); - onConnectionChangedCallbackId = lobbyInterface.AddNotifyRTCRoomConnectionChanged - ( - ref addNotifyOptions, - null, - HandleConnectionChanged - ); + onConnectionChangedCallbackId = lobbyInterface.AddNotifyRTCRoomConnectionChanged( + ref addNotifyOptions, null, HandleConnectionChanged); } if (!onParticipantStatusChangedCallbackId.HasValue) @@ -407,12 +393,8 @@ public class EOSVoiceChat: IDisposable LocalUserId = localUserId, RoomName = rtcRoomName, }; - onParticipantStatusChangedCallbackId = rtcInterface.AddNotifyParticipantStatusChanged - ( - ref addNotifyOptions, - null, - HandleParticipantStatusChanged - ); + onParticipantStatusChangedCallbackId = rtcInterface.AddNotifyParticipantStatusChanged( + ref addNotifyOptions, null, HandleParticipantStatusChanged); } if (!onParticipantUpdatedCallbackId.HasValue) @@ -422,12 +404,8 @@ public class EOSVoiceChat: IDisposable LocalUserId = localUserId, RoomName = rtcRoomName, }; - onParticipantUpdatedCallbackId = audioInterface.AddNotifyParticipantUpdated - ( - ref addNotifyOptions, - null, - HandleParticipantUpdated - ); + onParticipantUpdatedCallbackId = audioInterface.AddNotifyParticipantUpdated( + ref addNotifyOptions, null, HandleParticipantUpdated); } }