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,
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) { }
}
/// <summary>
@ -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) { }
}
/// <summary>
@ -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) { }
}
/// <summary>
@ -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);
}
}

Loading…
Cancel
Save