diff --git a/LoadBalancerProject-DONT-IMPORT-INTO-UNITY/LRM_LoadBalancer/Endpoint/Endpoint.cs b/LoadBalancerProject-DONT-IMPORT-INTO-UNITY/LRM_LoadBalancer/Endpoint/Endpoint.cs
index 7d67f91..c1c07d9 100644
--- a/LoadBalancerProject-DONT-IMPORT-INTO-UNITY/LRM_LoadBalancer/Endpoint/Endpoint.cs
+++ b/LoadBalancerProject-DONT-IMPORT-INTO-UNITY/LRM_LoadBalancer/Endpoint/Endpoint.cs
@@ -38,7 +38,7 @@ namespace LightReflectiveMirror.LoadBalancing
Logger.WriteLogMessage("Received auth req [" + receivedAuthKey + "] == [" + Program.conf.AuthKey + "]", ConsoleColor.Cyan);
// if server is authenticated
- if (receivedAuthKey != null && region != null && int.TryParse(region, out int regionId) &&
+ if (receivedAuthKey != null && region != null && int.TryParse(region, out int regionId) &&
address != null && endpointPort != null && gamePort != null && receivedAuthKey == Program.conf.AuthKey)
{
Logger.WriteLogMessage($"Server accepted: {address}:{gamePort}");
@@ -143,6 +143,18 @@ namespace LightReflectiveMirror.LoadBalancing
await context.Response.SendResponseAsync(low.Key.address != "Dummy" ? JsonConvert.SerializeObject(low.Key) : HttpStatusCode.InternalServerError);
}
+ [RestRoute("Options", "/api/join/")]
+ public async Task JoinRelayOptions(IHttpContext context)
+ {
+ var originHeaders = context.Request.Headers["Access-Control-Request-Headers"];
+
+ context.Response.Headers.Add("Access-Control-Allow-Origin", "*");
+ context.Response.Headers.Add("Access-Control-Allow-Methods", "POST, GET, OPTIONS");
+ context.Response.Headers.Add("Access-Control-Allow-Headers", originHeaders);
+
+ await context.Response.SendResponseAsync(HttpStatusCode.Ok);
+ }
+
///
/// Returns all the servers on all the relay nodes.
///
@@ -153,7 +165,7 @@ namespace LightReflectiveMirror.LoadBalancing
{
string region = context.Request.Headers["x-Region"];
- if(int.TryParse(region, out int regionID))
+ if (int.TryParse(region, out int regionID))
{
await context.Response.SendResponseAsync(_cachedRegionRooms[(LRMRegions)regionID]);
return;
@@ -163,6 +175,18 @@ namespace LightReflectiveMirror.LoadBalancing
await context.Response.SendResponseAsync(_cachedRegionRooms[LRMRegions.Any]);
}
+ [RestRoute("Options", "/api/masterlist/")]
+ public async Task GetMasterServerListOptions(IHttpContext context)
+ {
+ var originHeaders = context.Request.Headers["Access-Control-Request-Headers"];
+
+ context.Response.Headers.Add("Access-Control-Allow-Origin", "*");
+ context.Response.Headers.Add("Access-Control-Allow-Methods", "POST, GET, OPTIONS");
+ context.Response.Headers.Add("Access-Control-Allow-Headers", originHeaders);
+
+ await context.Response.SendResponseAsync(HttpStatusCode.Ok);
+ }
+
///
/// Returns stats. you're welcome
///
@@ -228,7 +252,7 @@ namespace LightReflectiveMirror.LoadBalancing
}
}
-
+
#endregion
}
diff --git a/ServerProject-DONT-IMPORT-INTO-UNITY/LRM/Endpoint.cs b/ServerProject-DONT-IMPORT-INTO-UNITY/LRM/Endpoint.cs
index cd54dd5..36a29c0 100644
--- a/ServerProject-DONT-IMPORT-INTO-UNITY/LRM/Endpoint.cs
+++ b/ServerProject-DONT-IMPORT-INTO-UNITY/LRM/Endpoint.cs
@@ -68,6 +68,9 @@ namespace LightReflectiveMirror.Endpoints
[RestRoute("Get", "/api/compressed/servers")]
public async Task ServerListCompressed(IHttpContext context)
{
+ context.Response.Headers.Add("Access-Control-Allow-Origin", "*");
+ context.Response.Headers.Add("Access-Control-Allow-Methods", "POST, GET, OPTIONS");
+
if (Program.conf.EndpointServerList)
{
await context.Response.SendResponseAsync(_cachedCompressedServerList);
@@ -75,6 +78,18 @@ namespace LightReflectiveMirror.Endpoints
else
await context.Response.SendResponseAsync(HttpStatusCode.Forbidden);
}
+
+ [RestRoute("Options", "/api/compressed/servers")]
+ public async Task ServerListCompressedOptions(IHttpContext context)
+ {
+ var originHeaders = context.Request.Headers["Access-Control-Request-Headers"];
+
+ context.Response.Headers.Add("Access-Control-Allow-Origin", "*");
+ context.Response.Headers.Add("Access-Control-Allow-Methods", "POST, GET, OPTIONS");
+ context.Response.Headers.Add("Access-Control-Allow-Headers", originHeaders);
+
+ await context.Response.SendResponseAsync(HttpStatusCode.Ok);
+ }
}
public class EndpointServer
diff --git a/UnityProject/Assets/JsonDotNet/Assemblies/AOT/Newtonsoft.Json.dll.meta b/UnityProject/Assets/JsonDotNet/Assemblies/AOT/Newtonsoft.Json.dll.meta
index ea21e1f..80c05ab 100644
--- a/UnityProject/Assets/JsonDotNet/Assemblies/AOT/Newtonsoft.Json.dll.meta
+++ b/UnityProject/Assets/JsonDotNet/Assemblies/AOT/Newtonsoft.Json.dll.meta
@@ -1,61 +1,90 @@
fileFormatVersion: 2
guid: 6a3c684705042f345975d924f6983e36
-timeCreated: 1466788352
-licenseType: Store
PluginImporter:
- serializedVersion: 1
+ externalObjects: {}
+ serializedVersion: 2
iconMap: {}
executionOrder: {}
+ defineConstraints: []
isPreloaded: 0
+ isOverridable: 0
+ isExplicitlyReferenced: 0
+ validateReferences: 1
platformData:
- Android:
+ - first:
+ : Linux
+ second:
+ enabled: 0
+ settings:
+ CPU: x86
+ - first:
+ : OSXIntel
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ - first:
+ : OSXIntel64
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ - first:
+ : SamsungTV
+ second:
+ enabled: 1
+ settings:
+ STV_MODEL: STANDARD_13
+ - first:
+ : Tizen
+ second:
+ enabled: 1
+ settings: {}
+ - first:
+ Android: Android
+ second:
enabled: 1
settings:
CPU: AnyCPU
- Any:
+ - first:
+ Any:
+ second:
enabled: 0
settings: {}
- Editor:
+ - first:
+ Editor: Editor
+ second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- Linux:
- enabled: 0
- settings:
- CPU: x86
- Linux64:
- enabled: 0
- settings:
- CPU: x86_64
- OSXIntel:
+ - first:
+ Standalone: Linux64
+ second:
enabled: 0
settings:
CPU: AnyCPU
- OSXIntel64:
+ - first:
+ Standalone: Win
+ second:
enabled: 0
settings:
CPU: AnyCPU
- SamsungTV:
- enabled: 1
+ - first:
+ Standalone: Win64
+ second:
+ enabled: 0
settings:
- STV_MODEL: STANDARD_13
- Tizen:
+ CPU: AnyCPU
+ - first:
+ WebGL: WebGL
+ second:
enabled: 1
settings: {}
- WebGL:
- enabled: 1
- settings: {}
- Win:
- enabled: 0
- settings:
- CPU: AnyCPU
- Win64:
- enabled: 0
- settings:
- CPU: AnyCPU
- WindowsStoreApps:
+ - first:
+ Windows Store Apps: WindowsStoreApps
+ second:
enabled: 1
settings:
CPU: AnyCPU
@@ -63,12 +92,16 @@ PluginImporter:
PlaceholderPath: Assets/JsonDotNet/Assemblies/Standalone/Newtonsoft.Json.dll
SDK: AnySDK
ScriptingBackend: Il2Cpp
- iOS:
+ - first:
+ iPhone: iOS
+ second:
enabled: 1
settings:
CompileFlags:
FrameworkDependencies:
- tvOS:
+ - first:
+ tvOS: tvOS
+ second:
enabled: 1
settings: {}
userData:
diff --git a/UnityProject/Assets/JsonDotNet/Assemblies/Standalone/Newtonsoft.Json.dll.meta b/UnityProject/Assets/JsonDotNet/Assemblies/Standalone/Newtonsoft.Json.dll.meta
index e130150..51d1c02 100644
--- a/UnityProject/Assets/JsonDotNet/Assemblies/Standalone/Newtonsoft.Json.dll.meta
+++ b/UnityProject/Assets/JsonDotNet/Assemblies/Standalone/Newtonsoft.Json.dll.meta
@@ -1,63 +1,92 @@
fileFormatVersion: 2
guid: 17aef65a15b471f468b5fbeb4ff0c6a1
-timeCreated: 1466788349
-licenseType: Store
PluginImporter:
- serializedVersion: 1
+ externalObjects: {}
+ serializedVersion: 2
iconMap: {}
executionOrder: {}
+ defineConstraints: []
isPreloaded: 0
+ isOverridable: 0
+ isExplicitlyReferenced: 0
+ validateReferences: 1
platformData:
- Android:
+ - first:
+ : Linux
+ second:
+ enabled: 1
+ settings:
+ CPU: x86
+ - first:
+ : LinuxUniversal
+ second:
+ enabled: 1
+ settings:
+ CPU: AnyCPU
+ - first:
+ : OSXIntel
+ second:
+ enabled: 1
+ settings:
+ CPU: AnyCPU
+ - first:
+ : OSXIntel64
+ second:
+ enabled: 1
+ settings:
+ CPU: AnyCPU
+ - first:
+ : SamsungTV
+ second:
+ enabled: 0
+ settings:
+ STV_MODEL: STANDARD_13
+ - first:
+ Android: Android
+ second:
enabled: 0
settings:
CPU: AnyCPU
- Any:
+ - first:
+ Any:
+ second:
enabled: 0
settings: {}
- Editor:
+ - first:
+ Editor: Editor
+ second:
enabled: 1
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- Linux:
- enabled: 1
- settings:
- CPU: x86
- Linux64:
- enabled: 1
- settings:
- CPU: x86_64
- LinuxUniversal:
+ - first:
+ Standalone: Linux64
+ second:
enabled: 1
settings:
CPU: AnyCPU
- OSXIntel:
+ - first:
+ Standalone: OSXUniversal
+ second:
enabled: 1
settings:
CPU: AnyCPU
- OSXIntel64:
+ - first:
+ Standalone: Win
+ second:
enabled: 1
settings:
CPU: AnyCPU
- OSXUniversal:
+ - first:
+ Standalone: Win64
+ second:
enabled: 1
settings:
CPU: AnyCPU
- SamsungTV:
- enabled: 0
- settings:
- STV_MODEL: STANDARD_13
- Win:
- enabled: 1
- settings:
- CPU: AnyCPU
- Win64:
- enabled: 1
- settings:
- CPU: AnyCPU
- WindowsStoreApps:
+ - first:
+ Windows Store Apps: WindowsStoreApps
+ second:
enabled: 0
settings:
CPU: AnyCPU
@@ -65,7 +94,9 @@ PluginImporter:
PlaceholderPath:
SDK: AnySDK
ScriptingBackend: Il2Cpp
- iOS:
+ - first:
+ iPhone: iOS
+ second:
enabled: 0
settings:
CompileFlags:
diff --git a/UnityProject/Assets/JsonDotNet/Assemblies/Windows/Newtonsoft.Json.dll.meta b/UnityProject/Assets/JsonDotNet/Assemblies/Windows/Newtonsoft.Json.dll.meta
index b91baae..149f7bc 100644
--- a/UnityProject/Assets/JsonDotNet/Assemblies/Windows/Newtonsoft.Json.dll.meta
+++ b/UnityProject/Assets/JsonDotNet/Assemblies/Windows/Newtonsoft.Json.dll.meta
@@ -1,55 +1,80 @@
fileFormatVersion: 2
guid: 9b6ba260dada0ea4a871a42011f8b87d
-timeCreated: 1466788355
-licenseType: Store
PluginImporter:
- serializedVersion: 1
+ externalObjects: {}
+ serializedVersion: 2
iconMap: {}
executionOrder: {}
+ defineConstraints: []
isPreloaded: 0
+ isOverridable: 0
+ isExplicitlyReferenced: 0
+ validateReferences: 1
platformData:
- Android:
+ - first:
+ : Linux
+ second:
+ enabled: 0
+ settings:
+ CPU: x86
+ - first:
+ : OSXIntel
+ second:
enabled: 0
settings:
CPU: AnyCPU
- Any:
+ - first:
+ : OSXIntel64
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ - first:
+ : SamsungTV
+ second:
+ enabled: 0
+ settings:
+ STV_MODEL: STANDARD_13
+ - first:
+ Android: Android
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ - first:
+ Any:
+ second:
enabled: 0
settings: {}
- Editor:
+ - first:
+ Editor: Editor
+ second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- Linux:
- enabled: 0
- settings:
- CPU: x86
- Linux64:
- enabled: 0
- settings:
- CPU: x86_64
- OSXIntel:
+ - first:
+ Standalone: Linux64
+ second:
enabled: 0
settings:
CPU: AnyCPU
- OSXIntel64:
+ - first:
+ Standalone: Win
+ second:
enabled: 0
settings:
CPU: AnyCPU
- SamsungTV:
- enabled: 0
- settings:
- STV_MODEL: STANDARD_13
- Win:
+ - first:
+ Standalone: Win64
+ second:
enabled: 0
settings:
CPU: AnyCPU
- Win64:
- enabled: 0
- settings:
- CPU: AnyCPU
- WindowsStoreApps:
+ - first:
+ Windows Store Apps: WindowsStoreApps
+ second:
enabled: 1
settings:
CPU: AnyCPU
@@ -57,7 +82,9 @@ PluginImporter:
PlaceholderPath: Assets/JsonDotNet/Assemblies/Standalone/Newtonsoft.Json.dll
SDK: AnySDK
ScriptingBackend: DotNet
- iOS:
+ - first:
+ iPhone: iOS
+ second:
enabled: 0
settings:
CompileFlags:
diff --git a/UnityProject/Assets/Mirror/Runtime/Transport/LRM/LRMTransport/LRMTransportOverrides.cs b/UnityProject/Assets/Mirror/Runtime/Transport/LRM/LRMTransport/LRMTransportOverrides.cs
index 7d56ec0..1f6d979 100644
--- a/UnityProject/Assets/Mirror/Runtime/Transport/LRM/LRMTransport/LRMTransportOverrides.cs
+++ b/UnityProject/Assets/Mirror/Runtime/Transport/LRM/LRMTransport/LRMTransportOverrides.cs
@@ -80,10 +80,17 @@ namespace LightReflectiveMirror
_clientSendBuffer.WriteString(ref pos, address);
_clientSendBuffer.WriteBool(ref pos, _directConnectModule != null);
- if (GetLocalIp() == null)
+ if (_directConnectModule == null)
+ {
_clientSendBuffer.WriteString(ref pos, "0.0.0.0");
+ }
else
- _clientSendBuffer.WriteString(ref pos, GetLocalIp());
+ {
+ if (GetLocalIp() == null)
+ _clientSendBuffer.WriteString(ref pos, "0.0.0.0");
+ else
+ _clientSendBuffer.WriteString(ref pos, GetLocalIp());
+ }
_isClient = true;
diff --git a/UnityProject/Assets/Mirror/Runtime/Transport/LRM/LRMTransport/LRMTransportRequests.cs b/UnityProject/Assets/Mirror/Runtime/Transport/LRM/LRMTransport/LRMTransportRequests.cs
index 5ac3f23..2203529 100644
--- a/UnityProject/Assets/Mirror/Runtime/Transport/LRM/LRMTransport/LRMTransportRequests.cs
+++ b/UnityProject/Assets/Mirror/Runtime/Transport/LRM/LRMTransport/LRMTransportRequests.cs
@@ -185,10 +185,6 @@ namespace LightReflectiveMirror
using (UnityWebRequest webRequest = UnityWebRequest.Get(uri))
{
- webRequest.SetRequestHeader("Access-Control-Allow-Credentials", "true");
- webRequest.SetRequestHeader("Access-Control-Allow-Headers", "Accept, X-Access-Token, X-Application-Name, X-Request-Sent-Time");
- webRequest.SetRequestHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
- webRequest.SetRequestHeader("Access-Control-Allow-Origin", "*");
webRequest.SetRequestHeader("x-Region", ((int)region).ToString());
// Request and wait for the desired page.
yield return webRequest.SendWebRequest();
diff --git a/UnityProject/Assets/Mirror/Runtime/Transport/LRM/LRMTransport/LightReflectiveMirrorTransport.cs b/UnityProject/Assets/Mirror/Runtime/Transport/LRM/LRMTransport/LightReflectiveMirrorTransport.cs
index 2fd399c..6101eb8 100644
--- a/UnityProject/Assets/Mirror/Runtime/Transport/LRM/LRMTransport/LightReflectiveMirrorTransport.cs
+++ b/UnityProject/Assets/Mirror/Runtime/Transport/LRM/LRMTransport/LightReflectiveMirrorTransport.cs
@@ -263,7 +263,7 @@ namespace LightReflectiveMirror
break;
case OpCodes.RequestNATConnection:
// Called when the LRM node would like us to establish a NAT puncher connection. Its safe to ignore if NAT punch is disabled.
- if (GetLocalIp() != null && _directConnectModule != null && useNATPunch)
+ if (useNATPunch && GetLocalIp() != null && _directConnectModule != null)
{
byte[] initalData = new byte[150];
int sendPos = 0;
diff --git a/UnityProject/ProjectSettings/ProjectSettings.asset b/UnityProject/ProjectSettings/ProjectSettings.asset
index 11b9e3e..702997d 100644
--- a/UnityProject/ProjectSettings/ProjectSettings.asset
+++ b/UnityProject/ProjectSettings/ProjectSettings.asset
@@ -514,6 +514,7 @@ PlayerSettings:
webGLWasmStreaming: 0
scriptingDefineSymbols:
1: MIRROR;MIRROR_17_0_OR_NEWER;MIRROR_18_0_OR_NEWER;MIRROR_24_0_OR_NEWER;MIRROR_26_0_OR_NEWER;MIRROR_27_0_OR_NEWER;MIRROR_28_0_OR_NEWER;MIRROR_29_0_OR_NEWER;MIRROR_30_0_OR_NEWER;MIRROR_30_5_2_OR_NEWER;MIRROR_32_1_2_OR_NEWER;MIRROR_32_1_4_OR_NEWER;MIRROR_35_0_OR_NEWER;MIRROR_35_1_OR_NEWER
+ 13: MIRROR;MIRROR_17_0_OR_NEWER;MIRROR_18_0_OR_NEWER;MIRROR_24_0_OR_NEWER;MIRROR_26_0_OR_NEWER;MIRROR_27_0_OR_NEWER;MIRROR_28_0_OR_NEWER;MIRROR_29_0_OR_NEWER;MIRROR_30_0_OR_NEWER;MIRROR_30_5_2_OR_NEWER;MIRROR_32_1_2_OR_NEWER;MIRROR_32_1_4_OR_NEWER;MIRROR_35_0_OR_NEWER;MIRROR_35_1_OR_NEWER
platformArchitecture: {}
scriptingBackend: {}
il2cppCompilerConfiguration: {}
@@ -526,6 +527,7 @@ PlayerSettings:
gcWBarrierValidation: 0
apiCompatibilityLevelPerPlatform:
Standalone: 3
+ WebGL: 3
m_RenderingPath: 1
m_MobileRenderingPath: 1
metroPackageName: UnityProject