Browse Source

Made authentication using Dev Auth Tool optional through the use of a scene property; otherwise the account portal is used. Also made the camera clear flags into solid color, so the status text is more readable.

master
Nico de Poel 4 years ago
parent
commit
f500998846
  1. 3
      Assets/Scenes/SampleScene.unity
  2. 14
      Assets/Scripts/EpicVoiceChatTest.cs

3
Assets/Scenes/SampleScene.unity

@ -248,7 +248,7 @@ Camera:
m_GameObject: {fileID: 963194225}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_ClearFlags: 2
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
@ -325,6 +325,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 6c676bf5a9c4b4c439178f1f9effb0e8, type: 3}
m_Name:
m_EditorClassIdentifier:
devAuthAddress:
--- !u!4 &1498573725
Transform:
m_ObjectHideFlags: 0

14
Assets/Scripts/EpicVoiceChatTest.cs

@ -29,6 +29,9 @@ public class EpicVoiceChatTest : MonoBehaviour
// This also allows multiple clients to connect to the same lobby without having to communicate the ID among each other.
private const string DebugLobbyId = "a0f6a51f-6b61-4c95-9ed8-a1d508fe4eb6";
[SerializeField]
private string devAuthAddress;
private readonly StringBuilder status = new StringBuilder("Status:\n");
private PlatformInterface platformInterface;
@ -246,16 +249,23 @@ public class EpicVoiceChatTest : MonoBehaviour
}
#else
private Credentials GetEpicCredentials() // This is platform-specific (actually it's not, we can skip this on consoles)
{
if (!string.IsNullOrEmpty(devAuthAddress))
{
return new Credentials
{
// Type = LoginCredentialType.AccountPortal, // Use ExternalAuth on console platform
Id = "192.168.1.100:8888",
Id = devAuthAddress,
Type = LoginCredentialType.Developer,
Token = SystemInfo.deviceName,
};
}
return new Credentials
{
Type = LoginCredentialType.AccountPortal, // Use ExternalAuth on console platform
};
}
private void HandleLoginResult(LoginCallbackInfo data)
{
switch (data.ResultCode)

Loading…
Cancel
Save