gg.easy.airship 0.1.2151 → 0.1.2154
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Editor/Artifacts/AirshipPrefabUtility.cs +1 -1
- package/Editor/GrayProfilePicture.png +0 -0
- package/Editor/GrayProfilePicture.png.meta +11 -8
- package/Editor/Toolbar/EditorToolbar.cs +51 -34
- package/Editor/TypescriptServices/Compiler/TypescriptCompilationService.cs +0 -6
- package/Editor/TypescriptServices/Editor/TypescriptLogService.cs +2 -2
- package/Editor/TypescriptServices/TypescriptServices.cs +38 -15
- package/Runtime/Code/Bootstrap/BundleDownloader.cs +5 -0
- package/Runtime/Code/Bootstrap/ClientBundleLoader.cs +15 -3
- package/Runtime/Code/CoreUI/CoreLoadingScreen.prefab +1086 -41
- package/Runtime/Code/CoreUI/Loading/CoreLoadingScreen.cs +24 -9
- package/Runtime/Code/Luau/Editor/LuauCoreEditor.cs +14 -1
- package/Runtime/Code/MainMenu/MainMenuSceneManager.cs +1 -3
- package/Runtime/Code/Network/Messaging/MessagingManager.cs +477 -0
- package/Runtime/Code/Network/Messaging/MessagingManager.cs.meta +2 -0
- package/Runtime/Code/Network/Messaging.meta +8 -0
- package/Runtime/Code/Network/Simulation/AirshipNetworkedObject.cs +4 -4
- package/Runtime/Code/Network/Simulation/AirshipSimulationManager.cs +10 -10
- package/Runtime/Code/Network/Simulation/History.cs +16 -16
- package/Runtime/Code/Network/StateSystem/AirshipNetworkedStateManager.cs +41 -35
- package/Runtime/Code/Network/StateSystem/Implementations/TestMovementSystem/TestMovement.cs +3 -3
- package/Runtime/Code/Network/StateSystem/NetworkedStateSystem.cs +3 -3
- package/Runtime/Code/Network/StateSystem/Structures/InputCommand.cs +1 -1
- package/Runtime/Code/Network/StateSystem/Structures/StateDiff.cs +1 -1
- package/Runtime/Code/Network/StateSystem/Structures/StateSnapshot.cs +1 -1
- package/Runtime/Code/Platform/Shared/AirshipPlatformUrl.cs +7 -0
- package/Runtime/Code/Player/Character/Animation/CharacterAnimationHelper.cs +10 -4
- package/Runtime/Code/Player/Character/MovementSystems/Character/CharacterMovement.cs +9 -5
- package/Runtime/Code/Player/Character/MovementSystems/Character/Structures/CharacterSnapshotData.cs +1 -1
- package/Runtime/Code/Player/Character/MovementSystems/Character/Structures/CharacterStateDiff.cs +1 -1
- package/Runtime/Code/VisualGraph/VisualGraphUI.shadergraph +17 -14
- package/Runtime/Scenes/CoreScene.unity +165 -0
- package/ThirdParty/Mirror/Core/NetworkManager.cs +6 -2
- package/ThirdParty/Packages/MQTTnet.4.3.7/MQTTnet.nuspec +41 -0
- package/ThirdParty/Packages/MQTTnet.4.3.7/MQTTnet.nuspec.meta +7 -0
- package/ThirdParty/Packages/MQTTnet.4.3.7/lib/netstandard2.0/MQTTnet.dll +0 -0
- package/ThirdParty/Packages/MQTTnet.4.3.7/lib/netstandard2.0/MQTTnet.dll.meta +2 -0
- package/ThirdParty/Packages/MQTTnet.4.3.7/lib/netstandard2.0.meta +8 -0
- package/ThirdParty/Packages/MQTTnet.4.3.7/lib.meta +8 -0
- package/ThirdParty/Packages/MQTTnet.4.3.7.meta +8 -0
- package/package.json +1 -1
|
@@ -17,7 +17,7 @@ namespace Airship.Editor {
|
|
|
17
17
|
return false;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
var meshFilter = component.GetComponentsInChildren<MeshFilter>(); // because of 'SendMessage' we can't force reconcile these
|
|
20
|
+
var meshFilter = component.GetComponentsInChildren<MeshFilter>(true); // because of 'SendMessage' we can't force reconcile these
|
|
21
21
|
if (meshFilter.Length > 0) {
|
|
22
22
|
prefabComponent = null;
|
|
23
23
|
return false;
|
|
Binary file
|
|
@@ -43,7 +43,7 @@ TextureImporter:
|
|
|
43
43
|
nPOTScale: 0
|
|
44
44
|
lightmap: 0
|
|
45
45
|
compressionQuality: 50
|
|
46
|
-
spriteMode:
|
|
46
|
+
spriteMode: 2
|
|
47
47
|
spriteExtrude: 1
|
|
48
48
|
spriteMeshType: 1
|
|
49
49
|
alignment: 0
|
|
@@ -67,9 +67,9 @@ TextureImporter:
|
|
|
67
67
|
swizzle: 50462976
|
|
68
68
|
cookieLightType: 0
|
|
69
69
|
platformSettings:
|
|
70
|
-
- serializedVersion:
|
|
70
|
+
- serializedVersion: 4
|
|
71
71
|
buildTarget: DefaultTexturePlatform
|
|
72
|
-
maxTextureSize:
|
|
72
|
+
maxTextureSize: 128
|
|
73
73
|
resizeAlgorithm: 0
|
|
74
74
|
textureFormat: -1
|
|
75
75
|
textureCompression: 1
|
|
@@ -80,7 +80,7 @@ TextureImporter:
|
|
|
80
80
|
ignorePlatformSupport: 0
|
|
81
81
|
androidETC2FallbackOverride: 0
|
|
82
82
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
83
|
-
- serializedVersion:
|
|
83
|
+
- serializedVersion: 4
|
|
84
84
|
buildTarget: Standalone
|
|
85
85
|
maxTextureSize: 2048
|
|
86
86
|
resizeAlgorithm: 0
|
|
@@ -93,7 +93,7 @@ TextureImporter:
|
|
|
93
93
|
ignorePlatformSupport: 0
|
|
94
94
|
androidETC2FallbackOverride: 0
|
|
95
95
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
96
|
-
- serializedVersion:
|
|
96
|
+
- serializedVersion: 4
|
|
97
97
|
buildTarget: Server
|
|
98
98
|
maxTextureSize: 2048
|
|
99
99
|
resizeAlgorithm: 0
|
|
@@ -106,7 +106,7 @@ TextureImporter:
|
|
|
106
106
|
ignorePlatformSupport: 0
|
|
107
107
|
androidETC2FallbackOverride: 0
|
|
108
108
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
109
|
-
- serializedVersion:
|
|
109
|
+
- serializedVersion: 4
|
|
110
110
|
buildTarget: Android
|
|
111
111
|
maxTextureSize: 2048
|
|
112
112
|
resizeAlgorithm: 0
|
|
@@ -119,8 +119,8 @@ TextureImporter:
|
|
|
119
119
|
ignorePlatformSupport: 0
|
|
120
120
|
androidETC2FallbackOverride: 0
|
|
121
121
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
122
|
-
- serializedVersion:
|
|
123
|
-
buildTarget:
|
|
122
|
+
- serializedVersion: 4
|
|
123
|
+
buildTarget: iOS
|
|
124
124
|
maxTextureSize: 2048
|
|
125
125
|
resizeAlgorithm: 0
|
|
126
126
|
textureFormat: -1
|
|
@@ -136,6 +136,7 @@ TextureImporter:
|
|
|
136
136
|
serializedVersion: 2
|
|
137
137
|
sprites: []
|
|
138
138
|
outline: []
|
|
139
|
+
customData:
|
|
139
140
|
physicsShape: []
|
|
140
141
|
bones: []
|
|
141
142
|
spriteID: 5e97eb03825dee720800000000000000
|
|
@@ -145,6 +146,8 @@ TextureImporter:
|
|
|
145
146
|
edges: []
|
|
146
147
|
weights: []
|
|
147
148
|
secondaryTextures: []
|
|
149
|
+
spriteCustomMetadata:
|
|
150
|
+
entries: []
|
|
148
151
|
nameFileIdTable: {}
|
|
149
152
|
mipmapLimitGroupName:
|
|
150
153
|
pSDRemoveMatte: 0
|
|
@@ -159,6 +159,7 @@ namespace Airship.Editor
|
|
|
159
159
|
private static Material profilePicRounded;
|
|
160
160
|
private static Texture signedOutIcon;
|
|
161
161
|
private static Texture2D signedInIcon;
|
|
162
|
+
private static Texture2D signedInIconRaw;
|
|
162
163
|
public static byte[] signedInIconBytes = new byte[]{};
|
|
163
164
|
/** True when fetching game info for publish (publish shouldn't be clickable during this) */
|
|
164
165
|
private static bool fetchingPublishInfo;
|
|
@@ -178,16 +179,13 @@ namespace Airship.Editor
|
|
|
178
179
|
RunCore.launchInDedicatedServerMode = EditorPrefs.GetBool("AirshipDedicatedServerMode", false);
|
|
179
180
|
ToolbarExtender.RightToolbarGUI.Add(OnRightToolbarGUI);
|
|
180
181
|
ToolbarExtender.LeftToolbarGUI.Add(OnLeftToolbarGUI);
|
|
181
|
-
|
|
182
|
+
|
|
182
183
|
if (EditorAuthManager.localUser != null || !string.IsNullOrEmpty(InternalHttpManager.editorUserId)) {
|
|
183
184
|
FetchAndUpdateSignedInIcon();
|
|
184
185
|
}
|
|
185
186
|
EditorAuthManager.localUserChanged += (user) => {
|
|
186
187
|
if (EditorAuthManager.signInStatus != EditorAuthSignInStatus.SIGNED_IN) {
|
|
187
188
|
signedInIconBytes = new byte[]{};
|
|
188
|
-
// EditorIcons.Instance.signedInIcon = new byte[] {};
|
|
189
|
-
// EditorUtility.SetDirty(EditorIcons.Instance);
|
|
190
|
-
// AssetDatabase.SaveAssetIfDirty(EditorIcons.Instance);
|
|
191
189
|
RepaintToolbar();
|
|
192
190
|
return;
|
|
193
191
|
}
|
|
@@ -204,12 +202,8 @@ namespace Airship.Editor
|
|
|
204
202
|
EditorAuthManager.DownloadProfilePicture().ContinueWith((t) => {
|
|
205
203
|
if (t.Result == null) return;
|
|
206
204
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
// EditorIcons.Instance.signedInIcon = signedInIcon.EncodeToPNG();
|
|
210
|
-
// EditorUtility.SetDirty(EditorIcons.Instance);
|
|
211
|
-
// AssetDatabase.SaveAssetIfDirty(EditorIcons.Instance);
|
|
212
|
-
RepaintToolbar();
|
|
205
|
+
signedInIconRaw = t.Result;
|
|
206
|
+
GetSignedInIcon();
|
|
213
207
|
}, TaskScheduler.FromCurrentSynchronizationContext());
|
|
214
208
|
}
|
|
215
209
|
|
|
@@ -242,24 +236,34 @@ namespace Airship.Editor
|
|
|
242
236
|
}
|
|
243
237
|
}
|
|
244
238
|
|
|
245
|
-
private static Texture2D
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
profilePicRounded = AssetDatabase.LoadAssetAtPath<Material>("Packages/gg.easy.airship/Editor/Hidden_EditorProfilePicRounded.mat");
|
|
251
|
-
|
|
252
|
-
RenderTexture.active = rt;
|
|
253
|
-
Graphics.Blit(source, rt, profilePicRounded);
|
|
239
|
+
private static Texture2D ResizeAndRoundTexture(Texture2D source, int targetWidth, int targetHeight) {
|
|
240
|
+
if (source == null || !source.isReadable) {
|
|
241
|
+
Debug.LogError("Unable to set signed in icon: Source texture is null or unreadable.");
|
|
242
|
+
return null;
|
|
243
|
+
}
|
|
254
244
|
|
|
255
|
-
|
|
245
|
+
// Downsize texture and round on CPU. There are problems when using Graphics.Blit to
|
|
246
|
+
// create this texture (it may not be ready on startup and will cause crashes when not
|
|
247
|
+
// ready).
|
|
248
|
+
var result = new Texture2D(targetWidth, targetHeight);
|
|
249
|
+
var newPixels = new Color[targetHeight * targetWidth];
|
|
250
|
+
var srcPixels = source.GetPixels();
|
|
251
|
+
for (var x = 0; x < targetWidth; x++) {
|
|
252
|
+
for (var y = 0; y < targetHeight; y++) {
|
|
253
|
+
var u = x / (float)targetWidth;
|
|
254
|
+
var v = y / (float)targetHeight;
|
|
255
|
+
// Cut out pixels outside of a circle
|
|
256
|
+
if ((u - 0.5) * (u - 0.5) + (v - 0.5) * (v - 0.5) > 0.25) continue;
|
|
257
|
+
|
|
258
|
+
var i = x + y * targetWidth;
|
|
259
|
+
var srcX = Mathf.Clamp(Mathf.RoundToInt(u * source.width), 0, source.width - 1);
|
|
260
|
+
var srcY = Mathf.Clamp(Mathf.RoundToInt(v * source.height), 0, source.height - 1);
|
|
261
|
+
newPixels[i] = srcPixels[srcX + srcY * source.width];
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
result.SetPixels(newPixels);
|
|
256
265
|
result.filterMode = FilterMode.Bilinear;
|
|
257
|
-
result.ReadPixels(new Rect(0, 0, targetWidth, targetHeight), 0, 0);
|
|
258
266
|
result.Apply();
|
|
259
|
-
|
|
260
|
-
RenderTexture.active = null;
|
|
261
|
-
RenderTexture.ReleaseTemporary(rt);
|
|
262
|
-
|
|
263
267
|
return result;
|
|
264
268
|
}
|
|
265
269
|
|
|
@@ -280,14 +284,7 @@ namespace Airship.Editor
|
|
|
280
284
|
if (gameSettings == null)
|
|
281
285
|
gameSettings = AssetDatabase.LoadAssetAtPath<Texture2D>(IconSettings);
|
|
282
286
|
if (signedOutIcon == null)
|
|
283
|
-
signedOutIcon =
|
|
284
|
-
if (signedInIcon == null && AirshipToolbar.signedInIconBytes != null && AirshipToolbar.signedInIconBytes.Length > 0) {
|
|
285
|
-
Texture2D result = new Texture2D(128, 128);
|
|
286
|
-
result.filterMode = FilterMode.Bilinear;
|
|
287
|
-
result.LoadImage(AirshipToolbar.signedInIconBytes);
|
|
288
|
-
result.Apply();
|
|
289
|
-
signedInIcon = result;
|
|
290
|
-
}
|
|
287
|
+
signedOutIcon = AssetDatabase.LoadAssetAtPath<Texture2D>(SignedOutIcon);
|
|
291
288
|
|
|
292
289
|
if (coreUpdateTexture == null) {
|
|
293
290
|
coreUpdateTexture = AssetDatabase.LoadAssetAtPath<Texture2D>(coreUpdateIcon);
|
|
@@ -327,7 +324,7 @@ namespace Airship.Editor
|
|
|
327
324
|
GUI.enabled = true;
|
|
328
325
|
|
|
329
326
|
EditorGUIUtility.SetIconSize(new Vector2(16, 16));
|
|
330
|
-
Texture profileIcon =
|
|
327
|
+
Texture profileIcon = GetSignedInIcon();
|
|
331
328
|
if (profileIcon == null || EditorAuthManager.signInStatus == EditorAuthSignInStatus.SIGNED_OUT) {
|
|
332
329
|
profileIcon = signedOutIcon;
|
|
333
330
|
}
|
|
@@ -466,5 +463,25 @@ namespace Airship.Editor
|
|
|
466
463
|
|
|
467
464
|
GUILayout.Space(5);
|
|
468
465
|
}
|
|
466
|
+
|
|
467
|
+
private static Texture2D GetSignedInIcon() {
|
|
468
|
+
if (signedInIcon != null) return signedInIcon;
|
|
469
|
+
|
|
470
|
+
if (AirshipToolbar.signedInIconBytes != null && AirshipToolbar.signedInIconBytes.Length > 0) {
|
|
471
|
+
Texture2D result = new Texture2D(128, 128);
|
|
472
|
+
result.filterMode = FilterMode.Bilinear;
|
|
473
|
+
result.LoadImage(AirshipToolbar.signedInIconBytes);
|
|
474
|
+
result.Apply();
|
|
475
|
+
signedInIcon = result;
|
|
476
|
+
return signedInIcon;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
if (signedInIconRaw != null) {
|
|
480
|
+
signedInIcon = ResizeAndRoundTexture(signedInIconRaw, 128, 128);
|
|
481
|
+
signedInIconBytes = signedInIcon.EncodeToPNG();
|
|
482
|
+
return signedInIcon;
|
|
483
|
+
}
|
|
484
|
+
return null;
|
|
485
|
+
}
|
|
469
486
|
}
|
|
470
487
|
}
|
|
@@ -475,12 +475,6 @@ using Object = UnityEngine.Object;
|
|
|
475
475
|
BuildTypescript(new []{ TypescriptProjectsService.Project }, flags);
|
|
476
476
|
}
|
|
477
477
|
internal static void BuildTypescript(TypescriptProject[] projects, TypeScriptCompileFlags compileFlags = 0) {
|
|
478
|
-
var gameConfig = GameConfig.Load();
|
|
479
|
-
if (!gameConfig) {
|
|
480
|
-
Debug.LogError("Failed to load gameConfig for compilation step");
|
|
481
|
-
return;
|
|
482
|
-
}
|
|
483
|
-
|
|
484
478
|
var isRunningServices = TypescriptCompilationServicesState.instance.CompilerCount > 0;
|
|
485
479
|
if (isRunningServices) StopCompilerServices();
|
|
486
480
|
|
|
@@ -140,12 +140,12 @@ namespace Airship.Editor {
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
internal static void StartLogging() {
|
|
143
|
+
if (started) return;
|
|
144
|
+
|
|
143
145
|
if (!Directory.Exists(LogFolder)) {
|
|
144
146
|
Directory.CreateDirectory(LogFolder);
|
|
145
147
|
}
|
|
146
148
|
|
|
147
|
-
if (started) return;
|
|
148
|
-
|
|
149
149
|
string logDir = Path.GetDirectoryName(Application.consoleLogPath);
|
|
150
150
|
logPath = LogFilePath;
|
|
151
151
|
prevLogPath = LogFilePrevPath; // lol
|
|
@@ -48,7 +48,7 @@ namespace Airship.Editor {
|
|
|
48
48
|
/// <summary>
|
|
49
49
|
/// Main static class for handling the TypeScript services
|
|
50
50
|
/// </summary>
|
|
51
|
-
public
|
|
51
|
+
public class TypescriptServices : AssetPostprocessor {
|
|
52
52
|
internal static event CompilerCrashEvent CompilerCrash;
|
|
53
53
|
|
|
54
54
|
/// <summary>
|
|
@@ -87,10 +87,18 @@ namespace Airship.Editor {
|
|
|
87
87
|
Debug.LogWarning("[TypescriptServices] Skipped, in Airship Player mode");
|
|
88
88
|
return;
|
|
89
89
|
#endif
|
|
90
|
+
TypescriptLogService.StartLogging();
|
|
91
|
+
|
|
90
92
|
// On project load we'll force a full compile to try and get all the refs up to date
|
|
91
93
|
if (!SessionState.GetBool("TypescriptInitialBoot", false) && IsValidEditorContext) {
|
|
92
94
|
SessionState.SetBool("TypescriptInitialBoot", true);
|
|
93
|
-
|
|
95
|
+
|
|
96
|
+
if (HasAllPackagesDownloaded()) {
|
|
97
|
+
TypescriptCompilationService.BuildTypescript(TypeScriptCompileFlags.FullClean | TypeScriptCompileFlags.Setup | TypeScriptCompileFlags.DisplayProgressBar);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
TypescriptLogService.LogWarning("Skipped precompile due to not having packages downloaded yet");
|
|
101
|
+
}
|
|
94
102
|
}
|
|
95
103
|
|
|
96
104
|
// If a server or clone - ignore
|
|
@@ -145,20 +153,31 @@ namespace Airship.Editor {
|
|
|
145
153
|
}
|
|
146
154
|
}
|
|
147
155
|
|
|
156
|
+
#if !AIRSHIP_PLAYER
|
|
157
|
+
private static bool assetDbReady = false;
|
|
158
|
+
// ReSharper disable once Unity.IncorrectMethodSignature
|
|
159
|
+
private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets,
|
|
160
|
+
string[] movedFromAssetPaths, bool didDomainReload) {
|
|
161
|
+
if (!IsValidEditorContext || !didDomainReload) return;
|
|
162
|
+
if (!assetDbReady) assetDbReady = true;
|
|
163
|
+
}
|
|
164
|
+
#endif
|
|
165
|
+
|
|
148
166
|
private static bool HasAllPackagesDownloaded() {
|
|
167
|
+
if (!assetDbReady) return false;
|
|
168
|
+
|
|
149
169
|
var gameConfig = GameConfig.Load();
|
|
150
|
-
|
|
151
|
-
if (!project.localSource && !project.IsDownloaded()) return false;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
return true;
|
|
170
|
+
return gameConfig != null && gameConfig.packages.All(project => project.localSource || project.IsDownloaded());
|
|
155
171
|
}
|
|
156
172
|
|
|
157
173
|
private static IEnumerator InitializeProject() {
|
|
158
174
|
TypescriptProjectsService.ReloadProjects();
|
|
159
175
|
TypescriptCompilationService.ClearIncrementalCache(); // clear incremental cache
|
|
176
|
+
TypescriptLogService.LogInfo("Checking and waiting for packages to download...");
|
|
160
177
|
yield return new WaitUntil(HasAllPackagesDownloaded);
|
|
178
|
+
TypescriptLogService.LogInfo("Packages are OK, will now initialize TypeScript");
|
|
161
179
|
yield return InitializeTypeScript();
|
|
180
|
+
TypescriptLogService.LogInfo("TypeScript initialized, now starting the TypeScript runtime");
|
|
162
181
|
yield return StartTypescriptRuntime();
|
|
163
182
|
}
|
|
164
183
|
|
|
@@ -193,12 +212,13 @@ namespace Airship.Editor {
|
|
|
193
212
|
|
|
194
213
|
private static IEnumerator StartTypescriptRuntime() {
|
|
195
214
|
TypescriptProjectsService.ReloadProject();
|
|
215
|
+
|
|
196
216
|
|
|
197
217
|
// Wait for updates
|
|
198
|
-
if (AirshipUpdateService.IsUpdatingAirship || AirshipPackagesWindow.IsModifyingPackages) {
|
|
218
|
+
if (AirshipUpdateService.IsUpdatingAirship || AirshipPackagesWindow.IsModifyingPackages || !HasAllPackagesDownloaded()) {
|
|
199
219
|
IsAwaitingRestart = true;
|
|
200
220
|
yield return new WaitUntil(() =>
|
|
201
|
-
!AirshipPackagesWindow.IsModifyingPackages && !AirshipUpdateService.IsUpdatingAirship);
|
|
221
|
+
!AirshipPackagesWindow.IsModifyingPackages && !AirshipUpdateService.IsUpdatingAirship && HasAllPackagesDownloaded());
|
|
202
222
|
IsAwaitingRestart = false;
|
|
203
223
|
}
|
|
204
224
|
|
|
@@ -228,6 +248,7 @@ namespace Airship.Editor {
|
|
|
228
248
|
return;
|
|
229
249
|
}
|
|
230
250
|
|
|
251
|
+
TypescriptLogService.LogInfo("Enforcing default config settings");
|
|
231
252
|
project.EnforceDefaultConfigurationSettings();
|
|
232
253
|
CompilerCrash += OnCrash;
|
|
233
254
|
|
|
@@ -243,6 +264,7 @@ namespace Airship.Editor {
|
|
|
243
264
|
}
|
|
244
265
|
|
|
245
266
|
if (!SessionState.GetBool("InitializedTypescriptServices", false)) {
|
|
267
|
+
TypescriptLogService.LogInfo("Running initial setup for TypeScript services");
|
|
246
268
|
SessionState.SetBool("InitializedTypescriptServices", true);
|
|
247
269
|
TypescriptCompilationService.StopCompilerServices();
|
|
248
270
|
|
|
@@ -259,6 +281,7 @@ namespace Airship.Editor {
|
|
|
259
281
|
}
|
|
260
282
|
}
|
|
261
283
|
else {
|
|
284
|
+
TypescriptLogService.LogInfo("Attempting to resume TypeScript compilation services...");
|
|
262
285
|
TypescriptCompilationService.StopCompilerServices(shouldRestart: TypescriptCompilationService.IsWatchModeRunning);
|
|
263
286
|
}
|
|
264
287
|
|
|
@@ -324,12 +347,12 @@ namespace Airship.Editor {
|
|
|
324
347
|
invokedCrashEvent = false;
|
|
325
348
|
}
|
|
326
349
|
|
|
327
|
-
var shouldAutostart = !IsCompilerActive && !TypescriptCompilationService.Crashed &&
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
if (!shouldAutostart) return;
|
|
331
|
-
TypescriptLogService.LogWarning("Found compiler inactive, doing an automatic restart");
|
|
332
|
-
EditorCoroutines.Execute(StartTypescriptRuntime());
|
|
350
|
+
// var shouldAutostart = !IsCompilerActive && !TypescriptCompilationService.Crashed &&
|
|
351
|
+
// ShouldCompilerBeRunning && !IsAwaitingRestart && !IsCompilerStoppedByUser && HasAllPackagesDownloaded();
|
|
352
|
+
//
|
|
353
|
+
// if (!shouldAutostart) return;
|
|
354
|
+
// TypescriptLogService.LogWarning("Found compiler inactive, doing an automatic restart");
|
|
355
|
+
// EditorCoroutines.Execute(StartTypescriptRuntime());
|
|
333
356
|
}
|
|
334
357
|
}
|
|
335
358
|
}
|
|
@@ -180,6 +180,11 @@ public class BundleDownloader : Singleton<BundleDownloader> {
|
|
|
180
180
|
if (i >= bundleFilesToDownload.Count) break; // code.zip requests
|
|
181
181
|
var remoteBundleFile = bundleFilesToDownload[i];
|
|
182
182
|
bool success = false;
|
|
183
|
+
|
|
184
|
+
// Test error
|
|
185
|
+
// Debug.LogError("Forcing download fail.");
|
|
186
|
+
// onComplete?.Invoke(false);
|
|
187
|
+
// return false;
|
|
183
188
|
|
|
184
189
|
if (request.webRequest.result != UnityWebRequest.Result.Success) {
|
|
185
190
|
var statusCode = request.webRequest.responseCode;
|
|
@@ -55,6 +55,7 @@ namespace Code.Bootstrap {
|
|
|
55
55
|
[SerializeField]
|
|
56
56
|
public ServerBootstrap serverBootstrap;
|
|
57
57
|
private List<NetworkConnectionToClient> connectionsReadyToLoadGameScene = new();
|
|
58
|
+
private InitializeGameMessage initMessage;
|
|
58
59
|
|
|
59
60
|
public bool scriptsReady = false;
|
|
60
61
|
public bool packagesReady = false;
|
|
@@ -144,6 +145,10 @@ namespace Code.Bootstrap {
|
|
|
144
145
|
}
|
|
145
146
|
}
|
|
146
147
|
|
|
148
|
+
public void RetryDownload() {
|
|
149
|
+
StartCoroutine(this.LoadPackages(this.initMessage.startupConfig));
|
|
150
|
+
}
|
|
151
|
+
|
|
147
152
|
/// <summary>
|
|
148
153
|
/// Called when client starts but before it's ready.
|
|
149
154
|
/// </summary>
|
|
@@ -163,6 +168,7 @@ namespace Code.Bootstrap {
|
|
|
163
168
|
this.isFinishedPreparing = false;
|
|
164
169
|
|
|
165
170
|
NetworkClient.RegisterHandler<InitializeGameMessage>(async data => {
|
|
171
|
+
this.initMessage = data;
|
|
166
172
|
NetworkManager.networkSceneName = data.startupConfig.StartingSceneName;
|
|
167
173
|
|
|
168
174
|
StartCoroutine(this.LoadPackages(data.startupConfig));
|
|
@@ -361,16 +367,16 @@ namespace Code.Bootstrap {
|
|
|
361
367
|
} else {
|
|
362
368
|
BundleDownloader.Instance.downloadAccepted = false;
|
|
363
369
|
bool finishedDownload = false;
|
|
364
|
-
BundleDownloader.Instance.DownloadBundles(
|
|
370
|
+
var downloadResult = BundleDownloader.Instance.DownloadBundles(
|
|
365
371
|
startupConfig.CdnUrl,
|
|
366
372
|
packages.ToArray(),
|
|
367
373
|
null,
|
|
368
374
|
loadingScreen,
|
|
369
375
|
null,
|
|
370
376
|
false,
|
|
371
|
-
|
|
377
|
+
(success) => {
|
|
372
378
|
finishedDownload = true;
|
|
373
|
-
if (!
|
|
379
|
+
if (!success) {
|
|
374
380
|
loadingScreen.SetError("Failed to download game content. An error has occurred.");
|
|
375
381
|
}
|
|
376
382
|
}
|
|
@@ -379,6 +385,12 @@ namespace Code.Bootstrap {
|
|
|
379
385
|
while (!finishedDownload) {
|
|
380
386
|
yield return null;
|
|
381
387
|
}
|
|
388
|
+
|
|
389
|
+
// Something failed in the bundle downloader.
|
|
390
|
+
// So we stop and wait for player to press retry (which calls this function again)
|
|
391
|
+
if (!downloadResult.Result) {
|
|
392
|
+
yield break;
|
|
393
|
+
}
|
|
382
394
|
|
|
383
395
|
yield return new WaitUntil(() => this.scriptsReady);
|
|
384
396
|
}
|