Skip to content

Commit c430ca0

Browse files
committed
Temp Remove Connection Check
1 parent 65219f1 commit c430ca0

File tree

7 files changed

+43
-67
lines changed

7 files changed

+43
-67
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<linker>
2+
<assembly fullname="Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
3+
<type fullname="UnityEngine.AddressableAssets.Addressables" preserve="all" />
4+
</assembly>
5+
<assembly fullname="Unity.Localization, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
6+
<type fullname="UnityEngine.Localization.Locale" preserve="all" />
7+
<type fullname="UnityEngine.Localization.Tables.SharedTableData" preserve="all" />
8+
<type fullname="UnityEngine.Localization.Tables.StringTable" preserve="all" />
9+
<type fullname="UnityEngine.Localization.LocaleIdentifier" preserve="nothing" serialized="true" />
10+
<type fullname="UnityEngine.Localization.Metadata.MetadataCollection" preserve="nothing" serialized="true" />
11+
<type fullname="UnityEngine.Localization.Tables.DistributedUIDGenerator" preserve="nothing" serialized="true" />
12+
<type fullname="UnityEngine.Localization.Tables.SharedTableData/SharedTableEntry" preserve="nothing" serialized="true" />
13+
<type fullname="UnityEngine.Localization.Tables.TableEntryData" preserve="nothing" serialized="true" />
14+
</assembly>
15+
<assembly fullname="Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
16+
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider" preserve="all" />
17+
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider" preserve="all" />
18+
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider" preserve="all" />
19+
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.LegacyResourcesProvider" preserve="all" />
20+
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.SceneProvider" preserve="all" />
21+
</assembly>
22+
<assembly fullname="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
23+
<type fullname="UnityEngine.Object" preserve="all" />
24+
</assembly>
25+
</linker>

Assets/AddressableAssetsData/link.xml.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
-166 Bytes
Binary file not shown.

Assets/Scripts/InstanceButton.cs

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@ public void LaunchCurrentInstance()
4545
if (JNIStorage.GetInstance(currInstName) == null)
4646
{
4747
Debug.Log("Instance is null!");
48-
49-
if (!JNIStorage.CheckConnectionAndThrow())
50-
{
51-
uiHandler.SetAndShowError("Unable to contact Microsoft servers, unable to create this instance!");
52-
return;
53-
}
5448

5549
CreateDefaultInstance(currInstName);
5650
return;
@@ -67,22 +61,16 @@ public void LaunchCurrentInstance()
6761
return;
6862
}
6963

70-
if (!OpenXRFeatureSystemInfo.GetHeadsetName().Contains("PICO"))
71-
{
72-
Task.Run(() =>
73-
{
74-
AndroidJNI.AttachCurrentThread();
75-
JNIStorage.apiClass.CallStatic("launchInstance", JNIStorage.activity, JNIStorage.accountObj,
76-
instance.raw);
77-
});
78-
}
79-
else
64+
async Task FinishAnim()
8065
{
81-
Application.Unload();
82-
JNIStorage.apiClass.CallStatic("launchInstance", JNIStorage.activity, JNIStorage.accountObj,
83-
instance.raw);
66+
await Task.Delay(200);
67+
XRGeneralSettings.Instance.Manager.activeLoader.Stop();
68+
XRGeneralSettings.Instance.Manager.activeLoader.Deinitialize();
69+
70+
Application.Quit();
71+
JNIStorage.apiClass.CallStatic("launchInstance", JNIStorage.activity, JNIStorage.accountObj, instance.raw);
8472
}
8573

86-
JNIStorage.instance.uiHandler.SetAndShowError("Instance is now launching, please wait... (Game will switch automatically when ready)");
74+
LeanTween.value(ScreenFade.gameObject,0, 1, 1).setOnUpdate(alpha => ScreenFade.alpha = alpha).setOnComplete(() => FinishAnim());
8775
}
8876
}

Assets/Scripts/JNIStorage.cs

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
using System.Collections.Generic;
2-
using System.Threading.Tasks;
32
using TMPro;
43
using UnityEngine;
5-
using UnityEngine.Serialization;
6-
using UnityEngine.UI;
74
using UnityEngine.CrashReportHandler;
8-
using UnityEngine.EventSystems;
9-
using UnityEngine.Networking;
105
using UnityEngine.XR.Management;
116

127
public class JNIStorage : MonoBehaviour
@@ -15,7 +10,6 @@ public class JNIStorage : MonoBehaviour
1510
public static AndroidJavaObject accountObj;
1611
public static AndroidJavaObject activity;
1712
public static AndroidJavaObject instancesObj;
18-
public static ConnectionStatus connectionStatus;
1913
public APIHandler apiHandler;
2014
public static JNIStorage instance;
2115
public List<string> supportedVersions;
@@ -24,25 +18,7 @@ public class JNIStorage : MonoBehaviour
2418
public ConfigHandler configHandler;
2519
public GameObject instancePrefab;
2620
public GameObject instanceArray;
27-
28-
public enum ConnectionStatus
29-
{
30-
Connected,
31-
Disconnected
32-
}
33-
34-
public static bool CheckConnectionAndThrow()
35-
{
36-
switch (connectionStatus)
37-
{
38-
case ConnectionStatus.Disconnected:
39-
return false;
40-
case ConnectionStatus.Connected:
41-
default:
42-
return true;
43-
}
44-
}
45-
21+
4622
static void CloseXR()
4723
{
4824
XRGeneralSettings.Instance.Manager.activeLoader.Stop();
@@ -71,8 +47,6 @@ private void Start()
7147
configHandler.LoadConfig();
7248
UpdateInstances();
7349
apiClass.SetStatic("model", OpenXRFeatureSystemInfo.GetHeadsetName());
74-
75-
CheckConnection();
7650
}
7751

7852
private void FillSupportedVersions(string[] supportedVersionsArray)
@@ -117,21 +91,4 @@ public void UpdateInstances()
11791
FillSupportedVersions(supportedVersionsArray);
11892
uiHandler.UpdateDropdowns(true, supportedVersions);
11993
}
120-
121-
public static async void CheckConnection()
122-
{
123-
UnityWebRequest request = UnityWebRequest.Get("https://piston-meta.mojang.com/mc/game/version_manifest_v2.json");
124-
request.SendWebRequest();
125-
126-
while (!request.isDone)
127-
await Task.Delay(16);
128-
129-
if (request.result != UnityWebRequest.Result.Success)
130-
{
131-
Debug.Log("Unable to contact Mojang servers" + request.error);
132-
connectionStatus = ConnectionStatus.Disconnected;
133-
}
134-
135-
connectionStatus = ConnectionStatus.Connected;
136-
}
13794
}

Assets/Scripts/UIHandler.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public class UIHandler : MonoBehaviour
2525
public static int selectedInstance;
2626
static string pfpUrl;
2727
static string profileName;
28-
private bool erroredConnection;
2928

3029
public LoginHandler loginHandler;
3130
public ModManager modManager;

ProjectSettings/ProjectSettings.asset

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ PlayerSettings:
142142
16:10: 1
143143
16:9: 1
144144
Others: 1
145-
bundleVersion: 6.0.0-RC1
145+
bundleVersion: 6.0.0-RC2
146146
preloadedAssets:
147147
- {fileID: 0}
148148
- {fileID: 0}
@@ -180,7 +180,7 @@ PlayerSettings:
180180
iPhone: 0
181181
tvOS: 0
182182
overrideDefaultApplicationIdentifier: 1
183-
AndroidBundleVersionCode: 31
183+
AndroidBundleVersionCode: 32
184184
AndroidMinSdkVersion: 29
185185
AndroidTargetSdkVersion: 32
186186
AndroidPreferredInstallLocation: 0

0 commit comments

Comments
 (0)