diff --git a/Assets/Scripts/EOSVoiceChat.cs b/Assets/Scripts/EOSVoiceChat.cs index a3c93f7..79f408d 100644 --- a/Assets/Scripts/EOSVoiceChat.cs +++ b/Assets/Scripts/EOSVoiceChat.cs @@ -19,7 +19,7 @@ public class EOSVoiceChat private readonly LobbyInterface lobbyInterface; private readonly RTCInterface rtcInterface; private readonly RTCAudioInterface audioInterface; - private readonly Func productUserProvider; + private readonly Func localUserProvider; private readonly IProductUserMapper productUserMapper; private readonly Dictionary chatUsers = new Dictionary(); @@ -36,12 +36,12 @@ public class EOSVoiceChat /// public EOSVoiceChat( LobbyInterface lobbyInterface, RTCInterface rtcInterface, RTCAudioInterface audioInterface, - Func productUserProvider, IProductUserMapper productUserMapper) + Func localUserProvider, IProductUserMapper productUserMapper) { this.lobbyInterface = lobbyInterface; this.rtcInterface = rtcInterface; this.audioInterface = audioInterface; - this.productUserProvider = productUserProvider; + this.localUserProvider = localUserProvider; this.productUserMapper = productUserMapper; } @@ -58,7 +58,7 @@ public class EOSVoiceChat lobbyInterface.CreateLobbySearch(new CreateLobbySearchOptions { MaxResults = 1 }, out var searchHandle); searchHandle.SetLobbyId(new LobbySearchSetLobbyIdOptions { LobbyId = chatLobbyName }); - var localUserId = productUserProvider.Invoke(); + var localUserId = localUserProvider.Invoke(); searchHandle.Find(new LobbySearchFindOptions { LocalUserId = localUserId }, null, findData => { switch (findData.ResultCode) @@ -162,7 +162,7 @@ public class EOSVoiceChat rtcRoomName = null; var result = lobbyInterface.GetRTCRoomName( - new GetRTCRoomNameOptions { LocalUserId = productUserProvider.Invoke(), LobbyId = connectedLobbyId }, + new GetRTCRoomNameOptions { LocalUserId = localUserProvider.Invoke(), LobbyId = connectedLobbyId }, out string roomName); if (result != Result.Success) @@ -186,7 +186,7 @@ public class EOSVoiceChat ( new LeaveLobbyOptions { - LocalUserId = productUserProvider.Invoke(), + LocalUserId = localUserProvider.Invoke(), LobbyId = connectedLobbyId, }, null, @@ -208,7 +208,7 @@ public class EOSVoiceChat audioInterface.UpdateSending(new UpdateSendingOptions { - LocalUserId = productUserProvider.Invoke(), + LocalUserId = localUserProvider.Invoke(), RoomName = rtcRoomName, AudioStatus = muted ? RTCAudioStatus.Disabled : RTCAudioStatus.Enabled, }, null, data => { }); @@ -227,7 +227,7 @@ public class EOSVoiceChat { audioInterface.UpdateReceiving(new UpdateReceivingOptions { - LocalUserId = productUserProvider.Invoke(), + LocalUserId = localUserProvider.Invoke(), ParticipantId = remoteProductUser, RoomName = rtcRoomName, AudioEnabled = !muted, @@ -244,7 +244,7 @@ public class EOSVoiceChat if (!IsConnected) return; - var localUserId = productUserProvider.Invoke(); + var localUserId = localUserProvider.Invoke(); foreach (var remoteProductUser in chatUsers.Keys) { audioInterface.UpdateReceiving(new UpdateReceivingOptions @@ -265,7 +265,7 @@ public class EOSVoiceChat { audioInterface.SetAudioOutputSettings(new SetAudioOutputSettingsOptions { - LocalUserId = productUserProvider.Invoke(), + LocalUserId = localUserProvider.Invoke(), DeviceId = null, // Default output device Volume = volume * 50f, }); @@ -275,7 +275,7 @@ public class EOSVoiceChat /// Whether the requested player is currently talking or not. /// This can be either the local player or a remote player. /// - public bool IsUserTalking(string playerId) + public bool IsPlayerTalking(string playerId) { foreach (var chatUser in chatUsers.Values) { @@ -292,7 +292,7 @@ public class EOSVoiceChat private void SubscribeToRoomNotifications() { - var localUserId = productUserProvider.Invoke(); + var localUserId = localUserProvider.Invoke(); if (!onConnectionChangedCallbackId.HasValue) {