gg.easy.airship 0.1.2185 → 0.1.2186

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.
Files changed (51) hide show
  1. package/Editor/Build/AirshipIOSBuildProcessor.cs +1 -0
  2. package/Editor/BuildMenu.cs +55 -15
  3. package/Editor/StreamingAssets.cs +82 -0
  4. package/Editor/StreamingAssets.cs.meta +3 -0
  5. package/Generator/LuauDirectCallbackGenerator.dll +0 -0
  6. package/Runtime/Code/AirshipConst.cs +1 -1
  7. package/Runtime/Code/Auth/AuthManager.cs +2 -2
  8. package/Runtime/Code/Authentication/EasyAuthenticator.cs +5 -2
  9. package/Runtime/Code/Bootstrap/AirshipEntryPoint.cs +0 -16
  10. package/Runtime/Code/Bootstrap/BundleDownloader.cs +10 -12
  11. package/Runtime/Code/Bootstrap/ClientBundleLoader.cs +17 -2
  12. package/Runtime/Code/Bootstrap/LuauScriptsDtoSerializer.cs +3 -3
  13. package/Runtime/Code/Bootstrap/ServerBootstrap.cs +3 -6
  14. package/Runtime/Code/Bundles/AirshipVersion.cs +1 -0
  15. package/Runtime/Code/CoreUI/Login/PickUsernamePage.cs +4 -1
  16. package/Runtime/Code/CoreUI/MainMenu/MainMenuLoadingScreen.prefab +7 -7
  17. package/Runtime/Code/Luau/LuauAssembly/BinaryBlob.cs +39 -7
  18. package/Runtime/Code/Luau/LuauCoreCallbacks.cs +2 -2
  19. package/Runtime/Code/Luau/LuauCoreReflection.cs +10 -8
  20. package/Runtime/Code/Luau/LuauPlugin.cs +1 -1
  21. package/Runtime/Code/Luau/LuauPluginNative.cs +5 -3
  22. package/Runtime/Code/Luau/ReflectionList.cs +9 -0
  23. package/Runtime/Code/MainMenu/MainMenuSceneManager.cs +9 -6
  24. package/Runtime/Code/NativePlugins/Airship.NativePlugins.asmdef +16 -0
  25. package/Runtime/Code/NativePlugins/NativeDelegateAttribute.cs +4 -3
  26. package/Runtime/Code/NativePlugins/NativeLibUtil.cs +4 -3
  27. package/Runtime/Code/NativePlugins/NativePluginAttribute.cs +4 -3
  28. package/Runtime/Code/NativePlugins/NativePluginHandles.cs +153 -8
  29. package/Runtime/Code/Network/Simulation/AirshipSimulationManager.cs +3 -1
  30. package/Runtime/Code/Network/StateSystem/AirshipNetworkedStateManager.cs +10 -11
  31. package/Runtime/Code/Network/UdpPingTool.cs +10 -1
  32. package/Runtime/Code/Player/Character/MovementSystems/Character/CharacterMovement.cs +2 -4
  33. package/Runtime/Code/Player/Character/MovementSystems/Character/CharacterMovementSettings.cs +0 -14
  34. package/Runtime/Code/Player/Character/MovementSystems/Character/CharacterPhysics.cs +11 -11
  35. package/Runtime/Code/Player/PlayerInfo.cs +3 -1
  36. package/Runtime/Code/Player/PlayerManagerBridge.cs +2 -2
  37. package/Runtime/Code/Player/UserData.cs +1 -0
  38. package/Runtime/Code/Quality/QualityManager.cs +2 -1
  39. package/Runtime/Code/VoiceChat/AirshipUniVoiceNetwork.cs +7 -3
  40. package/Runtime/Code/Zstd/ZstdNative.cs +3 -1
  41. package/Runtime/Plugins/Android/libLuauPlugin.so +0 -0
  42. package/Runtime/Plugins/Linux/libLuauPlugin.so +0 -0
  43. package/Runtime/Plugins/Mac/LuauPlugin.bundle/Contents/MacOS/LuauPlugin +0 -0
  44. package/Runtime/Plugins/Windows/x64/LuauPlugin.dll +0 -0
  45. package/Runtime/Plugins/iOS/LuauPluginIos.a +0 -0
  46. package/Runtime/Scenes/MainMenu.unity +82 -171
  47. package/ThirdParty/Mirror/Core/NetworkClient_TimeInterpolation.cs +3 -6
  48. package/ThirdParty/Mirror/Core/NetworkConnectionToClient.cs +2 -1
  49. package/package.json +1 -1
  50. package/Runtime/Code/NativePlugins/NativePlugins.asmdef +0 -3
  51. /package/Runtime/Code/NativePlugins/{NativePlugins.asmdef.meta → Airship.NativePlugins.asmdef.meta} +0 -0
@@ -19,6 +19,7 @@ namespace Editor.Build {
19
19
  var root = plist.root;
20
20
  var buildKey = "NSCameraUsageDescription";
21
21
  root.SetString(buildKey, "Use the camera to take profile pictures.");
22
+ root.SetBoolean("ITSAppUsesNonExemptEncryption", false);
22
23
  root.SetBoolean("GCSupportsGameMode", true);
23
24
  File.WriteAllText(plistPath, plist.WriteToString());
24
25
  #endif
@@ -2,6 +2,8 @@
2
2
  using System;
3
3
  using System.Collections.Generic;
4
4
  using System.Linq;
5
+ using Code.Bootstrap;
6
+ using NUnit;
5
7
  using UnityEditor;
6
8
  using UnityEditor.Build;
7
9
  using UnityEditor.Build.Profile;
@@ -266,8 +268,16 @@ namespace Editor {
266
268
  ReleaseAPK,
267
269
  ReleaseAAB,
268
270
  }
271
+
272
+ public enum AndroidEnvironment {
273
+ Production,
274
+ Staging,
275
+ }
269
276
 
270
- public static void BuildAndroidClient(AndroidBuildType buildType) {
277
+ public static void BuildAndroidClient(AndroidBuildType buildType, AndroidEnvironment environment) {
278
+ #if AIRSHIP_PLAYER
279
+ StreamingAssets.SetCoreMaterialPlatform(AirshipPlatform.Android);
280
+
271
281
  var development = buildType == AndroidBuildType.DevelopmentAPK;
272
282
  var buildApk = buildType != AndroidBuildType.ReleaseAAB;
273
283
 
@@ -279,18 +289,35 @@ namespace Editor {
279
289
  PlayerSettings.SplashScreen.show = false;
280
290
  PlayerSettings.SetScriptingBackend(NamedBuildTarget.Android, ScriptingImplementation.IL2CPP);
281
291
  PlayerSettings.Android.splitApplicationBinary = !buildApk;
282
-
292
+ PlayerSettings.Android.applicationEntry = AndroidApplicationEntry.GameActivity;
293
+
294
+ PlayerSettings.Android.keyaliasName = environment switch {
295
+ AndroidEnvironment.Production => "airship",
296
+ AndroidEnvironment.Staging => "airship-staging",
297
+ _ => throw new ArgumentOutOfRangeException(nameof(environment), environment, null)
298
+ };
299
+
300
+ var editorBuildScenes = new List<EditorBuildSettingsScene>();
301
+ foreach (var sceneName in scenes) {
302
+ editorBuildScenes.Add(new EditorBuildSettingsScene(sceneName, true));
303
+ }
304
+
283
305
  BuildProfile buildProfile;
284
306
  if (development) {
285
307
  buildProfile = AssetDatabase.LoadAssetAtPath<BuildProfile>("Assets/Settings/Build Profiles/Android Debug.asset");
286
308
  } else {
287
309
  buildProfile = AssetDatabase.LoadAssetAtPath<BuildProfile>("Assets/Settings/Build Profiles/Android Google Play.asset");
288
310
  }
289
- var options = new BuildPlayerWithProfileOptions();
290
- var editorBuildScenes = new List<EditorBuildSettingsScene>();
291
- foreach (var sceneName in scenes) {
292
- editorBuildScenes.Add(new EditorBuildSettingsScene(sceneName, true));
311
+
312
+ var defines = new List<string>();
313
+ defines.Add("AIRSHIP_PLAYER");
314
+ if (environment == AndroidEnvironment.Staging) {
315
+ defines.Add("AIRSHIP_STAGING");
316
+ defines.Add("AIRSHIP_INTERNAL");
293
317
  }
318
+ buildProfile.scriptingDefines = defines.ToArray();
319
+
320
+ var options = new BuildPlayerWithProfileOptions();
294
321
  buildProfile.overrideGlobalScenes = true;
295
322
  buildProfile.scenes = editorBuildScenes.ToArray();
296
323
  options.buildProfile = buildProfile;
@@ -298,8 +325,9 @@ namespace Editor {
298
325
  if (development) {
299
326
  options.options = BuildOptions.Development | BuildOptions.ConnectWithProfiler;
300
327
  }
301
-
302
- var report = BuildPipeline.BuildPlayer(options);
328
+
329
+ var report = BuildPipeline.BuildPlayer(options);
330
+
303
331
  var summary = report.summary;
304
332
  switch (summary.result) {
305
333
  case BuildResult.Succeeded:
@@ -319,8 +347,10 @@ namespace Editor {
319
347
  #endif
320
348
  break;
321
349
  }
322
-
350
+
351
+ StreamingAssets.ResetCoreMaterials();
323
352
  CreateAssetBundles.AddAllGameBundleScenes();
353
+ #endif
324
354
  }
325
355
 
326
356
  #if AIRSHIP_PLAYER
@@ -354,19 +384,29 @@ namespace Editor {
354
384
  BuildIOSClient(true, true);
355
385
  }
356
386
 
357
- [MenuItem("Airship/Create Binary/Client/Android (Google Play)", priority = 80)]
387
+ [MenuItem("Airship/Create Binary/Client/Android/Android Release (Google Play)", priority = 10)]
358
388
  public static void BuildAndroidClientMenuItem() {
359
- BuildAndroidClient(AndroidBuildType.ReleaseAAB);
389
+ BuildAndroidClient(AndroidBuildType.ReleaseAAB, AndroidEnvironment.Production);
360
390
  }
361
391
 
362
- [MenuItem("Airship/Create Binary/Client/Android (APK)", priority = 80)]
392
+ [MenuItem("Airship/Create Binary/Client/Android/Android APK", priority = 80)]
363
393
  public static void BuildAndroidProdAPK() {
364
- BuildAndroidClient(AndroidBuildType.ReleaseAPK);
394
+ BuildAndroidClient(AndroidBuildType.ReleaseAPK, AndroidEnvironment.Production);
365
395
  }
366
396
 
367
- [MenuItem("Airship/Create Binary/Client/Android (Development APK)", priority = 80)]
397
+ [MenuItem("Airship/Create Binary/Client/Android/Android APK (Development)", priority = 80)]
368
398
  public static void BuildAndroidDevelopmentClientMenuItem() {
369
- BuildAndroidClient(AndroidBuildType.DevelopmentAPK);
399
+ BuildAndroidClient(AndroidBuildType.DevelopmentAPK, AndroidEnvironment.Production);
400
+ }
401
+
402
+ [MenuItem("Airship/Create Binary/Client/Android/Android Staging APK", priority = 150)]
403
+ public static void BuildAndroidProdStagingAPK() {
404
+ BuildAndroidClient(AndroidBuildType.ReleaseAPK, AndroidEnvironment.Staging);
405
+ }
406
+
407
+ [MenuItem("Airship/Create Binary/Client/Android/Android Staging APK (Development)", priority = 150)]
408
+ public static void BuildAndroidDevelopmentStagingClientMenuItem() {
409
+ BuildAndroidClient(AndroidBuildType.DevelopmentAPK, AndroidEnvironment.Staging);
370
410
  }
371
411
  #endif
372
412
 
@@ -0,0 +1,82 @@
1
+ using System;
2
+ using System.IO;
3
+ using Code.Bootstrap;
4
+ using Editor;
5
+ using Editor.Util;
6
+ using UnityEditor;
7
+ using UnityEngine;
8
+
9
+ #if AIRSHIP_PLAYER
10
+ internal class StreamingAssets {
11
+ private static readonly string ShippedBundles = "Assets/StreamingAssets/ShippedBundles";
12
+ private static readonly string ShippedBundlesTmp = "Assets/StreamingAssets/ShippedBundles~";
13
+
14
+ public static readonly string CoreMaterialsAndroid = "Assets/StreamingAssets/ShippedBundles/CoreMaterials_Android";
15
+ public static readonly string CoreMaterialsWindows = "Assets/StreamingAssets/ShippedBundles/CoreMaterials_Windows";
16
+ public static readonly string CoreMaterialsIOS = "Assets/StreamingAssets/ShippedBundles/CoreMaterials_iOS";
17
+ public static readonly string CoreMaterialsMac = "Assets/StreamingAssets/ShippedBundles/CoreMaterials_Mac";
18
+
19
+ public static readonly string RelativeResourcesPath = "@easy/corematerials_shared/resources";
20
+
21
+ private static void ExcludeStreamingAssetsPath(string path) {
22
+ var targetPath = path.Replace("StreamingAssets", "StreamingAssets~");
23
+
24
+ if (!Directory.Exists(targetPath)) {
25
+ Directory.CreateDirectory(targetPath);
26
+ }
27
+ Directory.Move(path, targetPath);
28
+ }
29
+
30
+ private static void FixStreamingAssetsPath(string sourcePath) {
31
+ var resourcePath = PosixPath.Join(sourcePath, RelativeResourcesPath);
32
+ var excludedResourcePath = resourcePath.Replace("StreamingAssets", "StreamingAssets~");
33
+ if (!File.Exists(excludedResourcePath)) {
34
+ Debug.LogWarning($"Could not find {excludedResourcePath}");
35
+ return;
36
+ }
37
+ File.Move(excludedResourcePath, resourcePath);
38
+ AssetDatabase.ImportAsset(resourcePath);
39
+ }
40
+
41
+ public static void SetCoreMaterialPlatform(AirshipPlatform platform) {
42
+ var platformPath = platform switch {
43
+ AirshipPlatform.Android => CoreMaterialsAndroid,
44
+ _ => throw new ArgumentOutOfRangeException(nameof(platform), platform, null)
45
+ };
46
+
47
+ var paths = new[] {
48
+ CoreMaterialsAndroid,
49
+ CoreMaterialsMac,
50
+ CoreMaterialsWindows,
51
+ CoreMaterialsIOS,
52
+ };
53
+
54
+ foreach (var path in paths) {
55
+ if (path == platformPath) continue;
56
+ var resourcePath = PosixPath.Join(path, RelativeResourcesPath);
57
+ if (!File.Exists(resourcePath)) {
58
+ Debug.LogWarning($"could not find resource path {resourcePath}");
59
+ continue;
60
+ }
61
+
62
+
63
+ var targetPath = resourcePath.Replace("StreamingAssets", "StreamingAssets~");
64
+ var targetFolder = Path.GetDirectoryName(targetPath);
65
+ if (!Directory.Exists(targetFolder)) {
66
+ Directory.CreateDirectory(targetFolder);
67
+ }
68
+
69
+ File.Move(resourcePath, targetPath);
70
+ }
71
+
72
+ AssetDatabase.ImportAsset("Assets/StreamingAssets", ImportAssetOptions.ImportRecursive);
73
+ }
74
+
75
+ public static void ResetCoreMaterials() {
76
+ FixStreamingAssetsPath(CoreMaterialsAndroid);
77
+ FixStreamingAssetsPath(CoreMaterialsWindows);
78
+ FixStreamingAssetsPath(CoreMaterialsMac);
79
+ FixStreamingAssetsPath(CoreMaterialsIOS);
80
+ }
81
+ }
82
+ #endif
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: 23b1ca55a86f4a8597889786fd1941ab
3
+ timeCreated: 1758582757
@@ -6,7 +6,7 @@ using UnityEngine.Scripting;
6
6
  namespace Code {
7
7
  [LuauAPI][Preserve]
8
8
  public static class AirshipConst {
9
- public const int playerVersion = 18;
9
+ public const int playerVersion = 19;
10
10
  public static readonly IReadOnlyList<string> playerFlags = new string[] {
11
11
  "SkipLoading",
12
12
  };
@@ -136,7 +136,7 @@ public class AuthManager {
136
136
  });
137
137
 
138
138
  #if UNITY_ANDROID
139
- GoogleSignIn.Configuration = new GoogleSignInConfiguration() {
139
+ GoogleSignIn.Configuration ??= new GoogleSignInConfiguration() {
140
140
  RequestEmail = true,
141
141
  RequestProfile = true,
142
142
  RequestAuthCode = true,
@@ -144,7 +144,7 @@ public class AuthManager {
144
144
  #if UNITY_EDITOR || UNITY_STANDALONE
145
145
  ClientSecret = clientSecret,
146
146
  #endif
147
- };
147
+ };
148
148
  #endif
149
149
 
150
150
  #if AIRSHIP_ANDROID_DEBUG
@@ -207,6 +207,7 @@ namespace Code.Authentication {
207
207
  username = loginMessage.editorUsername,
208
208
  orgRoleName = "Owner",
209
209
  profileImageId = loginMessage.editorProfileImageId,
210
+ playerVersion = AirshipConst.playerVersion,
210
211
  });
211
212
  return await tcs.Task;
212
213
  }
@@ -215,7 +216,8 @@ namespace Code.Authentication {
215
216
  username = "Player" + this.connectionCounter,
216
217
  orgRoleName = "Owner",
217
218
  profileImageId = string.Empty,
218
- fullTransferPacket = "{}"
219
+ fullTransferPacket = "{}",
220
+ playerVersion = AirshipConst.playerVersion,
219
221
  });
220
222
  return await tcs.Task;
221
223
  }
@@ -244,7 +246,8 @@ namespace Code.Authentication {
244
246
  username = transferData.user.username,
245
247
  profileImageId = transferData.user.profileImageId,
246
248
  orgRoleName = transferData.orgRoleName,
247
- fullTransferPacket = fullTransferPacket
249
+ fullTransferPacket = fullTransferPacket,
250
+ playerVersion = loginMessage.playerVersion,
248
251
  });
249
252
  }).Catch((err) => {
250
253
  var error = err as RequestException;
@@ -1,8 +1,5 @@
1
- using System;
2
1
  using Code.Bootstrap;
3
- using Code.Bundles;
4
2
  using Sentry;
5
- using Sentry.Unity;
6
3
  using UnityEngine;
7
4
 
8
5
 
@@ -14,19 +11,6 @@ public class AirshipEntryPoint : Singleton<AirshipEntryPoint> {
14
11
  #if AIRSHIP_PLAYER
15
12
  Debug.unityLogger.logHandler = new AirshipLogHandler();
16
13
 
17
- SentryUnity.Init(options => {
18
- #if UNITY_IOS || UNITY_ANDROID
19
- options.Release = Application.version + "@" + AirshipVersion.GetVersionHash();
20
- #else
21
- options.Release = AirshipVersion.GetVersionHash();
22
- #endif
23
- #if AIRSHIP_STAGING
24
- options.Environment = "staging";
25
- #else
26
- options.Environment = "production";
27
- #endif
28
- });
29
-
30
14
  SentrySdk.ConfigureScope(scope => {
31
15
  scope.SetExtra("platform", AirshipPlatformUtil.GetLocalPlatform().ToString());
32
16
  scope.SetExtra("deviceType", DeviceBridge.GetDeviceType().ToString());
@@ -36,7 +36,7 @@ public class BundleDownloader : Singleton<BundleDownloader> {
36
36
  [CanBeNull] BundleLoadingScreen loadingScreen = null,
37
37
  [CanBeNull] string gameCodeZipUrl = null,
38
38
  bool downloadCodeZipOnClient = false,
39
- Action<bool> onComplete = null
39
+ Action<bool, string> onComplete = null
40
40
  ) {
41
41
  try {
42
42
  var totalSt = Stopwatch.StartNew();
@@ -47,8 +47,7 @@ public class BundleDownloader : Singleton<BundleDownloader> {
47
47
  remoteBundleFiles.AddRange(package.GetPublicRemoteBundleFiles(cdnUrl, platform));
48
48
  }
49
49
 
50
- if (privateRemoteFiles != null)
51
- {
50
+ if (privateRemoteFiles != null) {
52
51
  remoteBundleFiles.AddRange(privateRemoteFiles);
53
52
  }
54
53
 
@@ -205,12 +204,12 @@ public class BundleDownloader : Singleton<BundleDownloader> {
205
204
  Debug.LogError(
206
205
  $"Failed to download bundle file. Url={remoteBundleFile.Url} StatusCode={statusCode}");
207
206
  Debug.LogError(request.webRequest.error);
208
- onComplete?.Invoke(false);
207
+ onComplete?.Invoke(false, request.webRequest.error);
209
208
  return false;
210
209
  }
211
210
  } else if (!string.IsNullOrEmpty(request.webRequest.downloadHandler.error)) {
212
211
  Debug.LogError($"File download handler failed on bundle file {remoteBundleFile.fileName}. Error: {request.webRequest.downloadHandler.error}");
213
- onComplete?.Invoke(false);
212
+ onComplete?.Invoke(false, request.webRequest.downloadHandler.error);
214
213
  return false;
215
214
  } else {
216
215
  var size = Math.Floor((request.webRequest.downloadedBytes / 1000000f) * 10) / 10;
@@ -220,12 +219,12 @@ public class BundleDownloader : Singleton<BundleDownloader> {
220
219
  }
221
220
 
222
221
  if (!success && RunCore.IsServer()) {
223
- onComplete?.Invoke(false);
222
+ onComplete?.Invoke(false, "");
224
223
  return false;
225
224
  }
226
225
 
227
226
  if (!success && RunCore.IsClient()) {
228
- onComplete?.Invoke(false);
227
+ onComplete?.Invoke(false, "");
229
228
  return false;
230
229
  }
231
230
 
@@ -265,9 +264,8 @@ public class BundleDownloader : Singleton<BundleDownloader> {
265
264
  if (loadingScreen) {
266
265
  loadingScreen.SetError("Failed to download Main Menu scripts.");
267
266
  }
268
- if (RunCore.IsServer())
269
- {
270
- onComplete?.Invoke(false);
267
+ if (RunCore.IsServer()) {
268
+ onComplete?.Invoke(false, "");
271
269
  return false;
272
270
  }
273
271
  } else {
@@ -294,11 +292,11 @@ public class BundleDownloader : Singleton<BundleDownloader> {
294
292
  Debug.Log($"Unzipped code.zip in {unzipCodeSt.ElapsedMilliseconds} ms.");
295
293
  }
296
294
  Debug.Log($"Completed bundle downloader step in {totalSt.ElapsedMilliseconds} ms.");
297
- onComplete?.Invoke(true);
295
+ onComplete?.Invoke(true, "");
298
296
  return true;
299
297
  } catch (Exception e) {
300
298
  Debug.LogError("Failed to download bundles: " + e);
301
- onComplete?.Invoke(false);
299
+ onComplete?.Invoke(false, e.Message);
302
300
  return false;
303
301
  }
304
302
  }
@@ -9,6 +9,7 @@ using Code.Analytics;
9
9
  using Code.Luau.LuauAssembly.Protection;
10
10
  using Luau;
11
11
  using Mirror;
12
+ using Sentry;
12
13
  using UnityEngine;
13
14
  using UnityEngine.SceneManagement;
14
15
  using UnityEngine.Serialization;
@@ -71,6 +72,8 @@ namespace Code.Bootstrap {
71
72
 
72
73
  private int setupClientSessionCounter = 0;
73
74
 
75
+ public static string CurrentGameId;
76
+
74
77
  /// <summary>
75
78
  /// Client downloads and combines all LuauScriptDto objects into this single dto.
76
79
  /// This is then serialized to disk as a cache.
@@ -86,6 +89,13 @@ namespace Code.Bootstrap {
86
89
  }
87
90
  }
88
91
 
92
+ private void OnDestroy() {
93
+ CurrentGameId = "";
94
+ SentrySdk.ConfigureScope(scope => {
95
+ scope.SetExtra("gameId", "");
96
+ });
97
+ }
98
+
89
99
  public void SetupServer() {
90
100
  NetworkServer.RegisterHandler<RequestScriptsMessage>((conn, data) => {
91
101
  Debug.Log($"Sending {this.scriptsDtos.Count} script dtos to " + conn + " with hash " + this.scriptsHash);
@@ -170,6 +180,11 @@ namespace Code.Bootstrap {
170
180
 
171
181
  NetworkClient.RegisterHandler<InitializeGameMessage>(async data => {
172
182
  this.initMessage = data;
183
+ CurrentGameId = data.startupConfig.GameBundleId;
184
+ SentrySdk.ConfigureScope(scope => {
185
+ scope.SetExtra("gameId", CurrentGameId);
186
+ });
187
+
173
188
  NetworkManager.networkSceneName = data.startupConfig.StartingSceneName;
174
189
 
175
190
  StartCoroutine(this.LoadPackages(data.startupConfig));
@@ -387,10 +402,10 @@ namespace Code.Bootstrap {
387
402
  loadingScreen,
388
403
  null,
389
404
  false,
390
- (success) => {
405
+ (success, errorMsg) => {
391
406
  finishedDownload = true;
392
407
  if (!success) {
393
- loadingScreen.SetError("Failed to download game content. An error has occurred.");
408
+ loadingScreen.SetError("Failed to download game content. An error has occurred: " + errorMsg);
394
409
  }
395
410
  }
396
411
  );
@@ -20,7 +20,7 @@ namespace Code.Bootstrap {
20
20
  }
21
21
 
22
22
  public static class LuauScriptsDtoSerializer {
23
- private static Zstd.Zstd zstd = new(1024 * 4);
23
+ private static readonly Lazy<Zstd.Zstd> zstd = new(() => new Zstd.Zstd(1024 * 4));
24
24
  private static readonly Dictionary<string, CachedCompressedFile> compressedFileCache = new();
25
25
 
26
26
  [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
@@ -47,7 +47,7 @@ namespace Code.Bootstrap {
47
47
  Profiler.BeginSample("Luau Compress");
48
48
  var maxCompressionSize = Zstd.Zstd.GetCompressionBound(file.bytes);
49
49
  byte[] compressedBytes = new byte[maxCompressionSize];
50
- var compressedSize = zstd.Compress(file.bytes, compressedBytes);
50
+ var compressedSize = zstd.Value.Compress(file.bytes, compressedBytes);
51
51
  writer.WriteInt(compressedSize);
52
52
  writer.WriteBytes(compressedBytes, 0, compressedSize);
53
53
 
@@ -81,7 +81,7 @@ namespace Code.Bootstrap {
81
81
 
82
82
  // Decompress the bytes
83
83
  script.bytes = new byte[Zstd.Zstd.GetDecompressionBound(compressedBytes)];
84
- zstd.Decompress(new ReadOnlySpan<byte>(compressedBytes, 0, compressedBytesLen), script.bytes);
84
+ zstd.Value.Decompress(new ReadOnlySpan<byte>(compressedBytes, 0, compressedBytesLen), script.bytes);
85
85
 
86
86
  script.airshipBehaviour = reader.ReadBool();
87
87
 
@@ -458,14 +458,11 @@ public class ServerBootstrap : MonoBehaviour
458
458
  bool downloadComplete = false;
459
459
  if (!RunCore.IsEditor()) {
460
460
  BundleDownloader.Instance.DownloadBundles(startupConfig.CdnUrl, packages.ToArray(), privateBundleFiles, null, gameCodeZipUrl, false,
461
- (res) => {
462
- if (!res)
463
- {
461
+ (res, errorMsg) => {
462
+ if (!res) {
464
463
  Debug.LogWarning("[Airship]: Failed to download required files. See above logs for details. Shutting down server.");
465
464
  ShutdownDueToAssetFailure(1);
466
- }
467
- else
468
- {
465
+ } else {
469
466
  downloadComplete = true;
470
467
  }
471
468
  });
@@ -1,6 +1,7 @@
1
1
  using UnityEngine;
2
2
 
3
3
  namespace Code.Bundles {
4
+ [LuauAPI]
4
5
  public class AirshipVersion {
5
6
  private static string versionHash = null;
6
7
  public static string GetVersionHash() {
@@ -5,6 +5,7 @@ using Code.Http.Public;
5
5
  using Code.Platform.Shared;
6
6
  using ElRaccoone.Tweens;
7
7
  using Proyecto26;
8
+ using Sentry;
8
9
  using TMPro;
9
10
  using UnityEngine;
10
11
  using UnityEngine.SceneManagement;
@@ -107,7 +108,6 @@ public class PickUsernamePage : MonoBehaviour {
107
108
  var res = await InternalHttpManager.GetAsync(AirshipPlatformUrl.gameCoordinator +
108
109
  "/users/availability?username=" + username);
109
110
  avail = res.success;
110
- print("username check: " + res.data);
111
111
  if (!res.success) {
112
112
  SetResponse(this.usernameTakenText);
113
113
  Debug.LogError(res.error);
@@ -138,6 +138,9 @@ public class PickUsernamePage : MonoBehaviour {
138
138
  username = username,
139
139
  }));
140
140
  if (res.success) {
141
+ SentrySdk.ConfigureScope(scope => {
142
+ scope.User.Username = username;
143
+ });
141
144
  SceneManager.LoadScene("MainMenu");
142
145
  } else {
143
146
  Debug.LogError(res.error);
@@ -85,8 +85,8 @@ RectTransform:
85
85
  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
86
86
  m_AnchorMin: {x: 0, y: 0}
87
87
  m_AnchorMax: {x: 1, y: 1}
88
- m_AnchoredPosition: {x: -0.000061035156, y: 0}
89
- m_SizeDelta: {x: -59.999893, y: -40}
88
+ m_AnchoredPosition: {x: -0.000061035156, y: -5.5122}
89
+ m_SizeDelta: {x: -59.9999, y: -28.9756}
90
90
  m_Pivot: {x: 0.5, y: 0.5}
91
91
  --- !u!222 &7131854604237137100
92
92
  CanvasRenderer:
@@ -161,7 +161,7 @@ MonoBehaviour:
161
161
  m_charWidthMaxAdj: 0
162
162
  m_TextWrappingMode: 1
163
163
  m_wordWrappingRatios: 0.4
164
- m_overflowMode: 0
164
+ m_overflowMode: 1
165
165
  m_linkedTextComponent: {fileID: 0}
166
166
  parentLinkedComponent: {fileID: 0}
167
167
  m_enableKerning: 0
@@ -1012,7 +1012,7 @@ GameObject:
1012
1012
  - component: {fileID: 8811223116906599597}
1013
1013
  - component: {fileID: 6036842439956431236}
1014
1014
  m_Layer: 5
1015
- m_Name: Text (TMP)
1015
+ m_Name: RetryBtn
1016
1016
  m_TagString: Untagged
1017
1017
  m_Icon: {fileID: 0}
1018
1018
  m_NavMeshLayer: 0
@@ -1034,7 +1034,7 @@ RectTransform:
1034
1034
  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
1035
1035
  m_AnchorMin: {x: 0.5, y: 0}
1036
1036
  m_AnchorMax: {x: 0.5, y: 0}
1037
- m_AnchoredPosition: {x: 0, y: -57}
1037
+ m_AnchoredPosition: {x: 0, y: -75}
1038
1038
  m_SizeDelta: {x: 200, y: 50}
1039
1039
  m_Pivot: {x: 0.5, y: 0.5}
1040
1040
  --- !u!222 &1161445418170421426
@@ -1229,8 +1229,8 @@ RectTransform:
1229
1229
  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
1230
1230
  m_AnchorMin: {x: 0.5, y: 0.5}
1231
1231
  m_AnchorMax: {x: 0.5, y: 0.5}
1232
- m_AnchoredPosition: {x: -0, y: 0}
1233
- m_SizeDelta: {x: 521.6703, y: 103.36}
1232
+ m_AnchoredPosition: {x: -0, y: -20.2114}
1233
+ m_SizeDelta: {x: 521.6703, y: 143.7827}
1234
1234
  m_Pivot: {x: 0.5, y: 0.5}
1235
1235
  --- !u!222 &7156213477813682496
1236
1236
  CanvasRenderer:
@@ -1,31 +1,41 @@
1
1
  using System;
2
+ using System.Runtime.InteropServices;
2
3
  using Mirror;
3
4
  using Code.Util;
4
- using UnityEngine;
5
5
 
6
6
  namespace Assets.Luau {
7
7
  [Serializable]
8
8
  public class BinaryBlob : IEquatable<BinaryBlob> {
9
+ public int dataSize;
10
+ public int uncompressedDataSize;
11
+ public byte[] data;
12
+
9
13
  public BinaryBlob() {
10
14
  data = new byte[] { };
11
15
  dataSize = 0;
12
16
  }
13
17
 
14
18
  public BinaryBlob(byte[] bytes) {
15
- if (bytes.Length > uint.MaxValue) {
16
- throw new Exception("Length of binary blob data exceeds " + int.MaxValue + " bytes.");
17
- }
18
19
  dataSize = bytes.Length;
20
+ uncompressedDataSize = dataSize;
19
21
  data = bytes;
20
22
  }
21
-
22
- public int dataSize;
23
- public byte[] data;
23
+
24
+ public BinaryBlob(IntPtr nativeBinaryBlobPtr) {
25
+ var marshal = LuauBinaryBlobMarshal.FromIntPtr(nativeBinaryBlobPtr);
26
+ dataSize = (int)marshal.DataSize;
27
+ uncompressedDataSize = (int)marshal.UncompressedDataSize;
28
+ data = marshal.ReadData();
29
+ }
24
30
 
25
31
  public bool Equals(BinaryBlob other) {
26
32
  return this.dataSize == other?.dataSize;
27
33
  }
28
34
 
35
+ public bool IsCompressed() {
36
+ return data.Length > 0 && data[0] == 1 && dataSize < uncompressedDataSize;
37
+ }
38
+
29
39
  public byte[] CreateDiff(BinaryBlob other) {
30
40
  int length = Math.Max(other.data.Length, data.Length);
31
41
  var neededBytes = (int) Math.Ceiling(length / 8f);
@@ -82,6 +92,7 @@ namespace Assets.Luau {
82
92
  byte changedLength = bytes[0];
83
93
  if (changedLength == 0) return new BinaryBlob() {
84
94
  dataSize = dataSize,
95
+ uncompressedDataSize = uncompressedDataSize,
85
96
  data = (byte[]) data.Clone(),
86
97
  };
87
98
 
@@ -124,4 +135,25 @@ namespace Assets.Luau {
124
135
  return newBlob;
125
136
  }
126
137
  }
138
+
139
+ /// <summary>
140
+ /// Strictly used for marshalling BinaryBlob data only.
141
+ /// </summary>
142
+ [StructLayout(LayoutKind.Sequential)]
143
+ public struct LuauBinaryBlobMarshal {
144
+ // Ordering of these fields must match BinaryBlob struct in native LuauPlugin:
145
+ public readonly IntPtr Data;
146
+ public readonly ulong DataSize;
147
+ public readonly ulong UncompressedDataSize;
148
+
149
+ public static LuauBinaryBlobMarshal FromIntPtr(IntPtr ptr) {
150
+ return Marshal.PtrToStructure<LuauBinaryBlobMarshal>(ptr);
151
+ }
152
+
153
+ public byte[] ReadData() {
154
+ var bytes = new byte[DataSize];
155
+ Marshal.Copy(Data, bytes, 0, (int)DataSize);
156
+ return bytes;
157
+ }
158
+ }
127
159
  }
@@ -637,9 +637,9 @@ public partial class LuauCore : MonoBehaviour {
637
637
  case PODTYPE.POD_BINARYBLOB: {
638
638
  if (t.IsAssignableFrom(binaryBlobType)) {
639
639
  if (field != null) {
640
- field.SetValue(objectReference, NewBinaryBlobFromPointer(propertyData, (int)propertyDataSize));
640
+ field.SetValue(objectReference, NewBinaryBlobFromPointer(propertyData));
641
641
  } else {
642
- SetValue<BinaryBlob>(objectReference, NewBinaryBlobFromPointer(propertyData, (int)propertyDataSize), property);
642
+ SetValue<BinaryBlob>(objectReference, NewBinaryBlobFromPointer(propertyData), property);
643
643
  }
644
644
 
645
645
  return 0;