gg.easy.airship 0.1.2133 → 0.1.2134

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 (131) hide show
  1. package/AuthenticationForUnity/Runtime/Cdm.Authentication.asmdef +3 -1
  2. package/Editor/CreateAssetBundles.cs +5 -0
  3. package/Editor/Easy.Airship.Editor.asmdef +2 -1
  4. package/Editor/LuauImporter.cs +19 -40
  5. package/Runtime/Code/Airship/Resources/Scripts/Editor/Airship.Airship.Editor.asmdef +2 -1
  6. package/Runtime/Code/AirshipConst.cs +2 -2
  7. package/Runtime/Code/Auth/AuthManager.cs +62 -20
  8. package/Runtime/Code/Bootstrap/ClientBundleLoader.cs +1 -1
  9. package/Runtime/Code/Bundles/SystemRoot.cs +26 -11
  10. package/Runtime/Code/Easy.Airship.asmdef +2 -1
  11. package/Runtime/Code/GoogleSignIn/.vscode/settings.json +55 -0
  12. package/Runtime/Code/GoogleSignIn/CONTRIBUTING.md +24 -0
  13. package/Runtime/Code/GoogleSignIn/CONTRIBUTING.md.meta +7 -0
  14. package/Runtime/Code/GoogleSignIn/Editor/iOS/PListImporter.cs +21 -0
  15. package/Runtime/Code/GoogleSignIn/Editor/iOS/PListImporter.cs.meta +11 -0
  16. package/Runtime/Code/GoogleSignIn/Editor/iOS/PListProcessor.cs +69 -0
  17. package/Runtime/Code/GoogleSignIn/Editor/iOS/PListProcessor.cs.meta +11 -0
  18. package/Runtime/Code/GoogleSignIn/Editor/iOS.meta +8 -0
  19. package/Runtime/Code/GoogleSignIn/Editor.meta +8 -0
  20. package/Runtime/Code/GoogleSignIn/GoogleSignIn/Editor/GoogleSignInDependencies.xml +16 -0
  21. package/Runtime/Code/GoogleSignIn/GoogleSignIn/Editor/GoogleSignInDependencies.xml.meta +10 -0
  22. package/Runtime/Code/GoogleSignIn/GoogleSignIn/Editor/google-signin-plugin_v1.0.4.txt +33 -0
  23. package/Runtime/Code/GoogleSignIn/GoogleSignIn/Editor/google-signin-plugin_v1.0.4.txt.meta +11 -0
  24. package/Runtime/Code/GoogleSignIn/GoogleSignIn/Editor.meta +9 -0
  25. package/Runtime/Code/GoogleSignIn/GoogleSignIn/Future.cs +99 -0
  26. package/Runtime/Code/GoogleSignIn/GoogleSignIn/Future.cs.meta +14 -0
  27. package/Runtime/Code/GoogleSignIn/GoogleSignIn/GoogleSignIn.cs +214 -0
  28. package/Runtime/Code/GoogleSignIn/GoogleSignIn/GoogleSignIn.cs.meta +14 -0
  29. package/Runtime/Code/GoogleSignIn/GoogleSignIn/GoogleSignInConfiguration.cs +68 -0
  30. package/Runtime/Code/GoogleSignIn/GoogleSignIn/GoogleSignInConfiguration.cs.meta +14 -0
  31. package/Runtime/Code/GoogleSignIn/GoogleSignIn/GoogleSignInStatusCode.cs +53 -0
  32. package/Runtime/Code/GoogleSignIn/GoogleSignIn/GoogleSignInStatusCode.cs.meta +14 -0
  33. package/Runtime/Code/GoogleSignIn/GoogleSignIn/GoogleSignInUser.cs +76 -0
  34. package/Runtime/Code/GoogleSignIn/GoogleSignIn/GoogleSignInUser.cs.meta +14 -0
  35. package/Runtime/Code/GoogleSignIn/GoogleSignIn/Impl/BaseObject.cs +67 -0
  36. package/Runtime/Code/GoogleSignIn/GoogleSignIn/Impl/BaseObject.cs.meta +14 -0
  37. package/Runtime/Code/GoogleSignIn/GoogleSignIn/Impl/GoogleSignInImpl.cs +371 -0
  38. package/Runtime/Code/GoogleSignIn/GoogleSignIn/Impl/GoogleSignInImpl.cs.meta +14 -0
  39. package/Runtime/Code/GoogleSignIn/GoogleSignIn/Impl/GoogleSignInImplEditor.cs +211 -0
  40. package/Runtime/Code/GoogleSignIn/GoogleSignIn/Impl/GoogleSignInImplEditor.cs.meta +11 -0
  41. package/Runtime/Code/GoogleSignIn/GoogleSignIn/Impl/NativeFuture.cs +86 -0
  42. package/Runtime/Code/GoogleSignIn/GoogleSignIn/Impl/NativeFuture.cs.meta +14 -0
  43. package/Runtime/Code/GoogleSignIn/GoogleSignIn/Impl/SignInHelperObject.cs +42 -0
  44. package/Runtime/Code/GoogleSignIn/GoogleSignIn/Impl/SignInHelperObject.cs.meta +14 -0
  45. package/Runtime/Code/GoogleSignIn/GoogleSignIn/Impl.meta +9 -0
  46. package/Runtime/Code/GoogleSignIn/GoogleSignIn/link.xml +5 -0
  47. package/Runtime/Code/GoogleSignIn/GoogleSignIn/link.xml.meta +7 -0
  48. package/Runtime/Code/GoogleSignIn/GoogleSignIn.asmdef +3 -0
  49. package/Runtime/Code/GoogleSignIn/GoogleSignIn.asmdef.meta +7 -0
  50. package/Runtime/Code/GoogleSignIn/GoogleSignIn.meta +9 -0
  51. package/Runtime/Code/GoogleSignIn/LICENSE +215 -0
  52. package/Runtime/Code/GoogleSignIn/LICENSE.meta +7 -0
  53. package/Runtime/Code/GoogleSignIn/Plugins/Android/src/main/java/com/google/googlesignin/GoogleSignInHelper.java +295 -0
  54. package/Runtime/Code/GoogleSignIn/Plugins/Android/src/main/java/com/google/googlesignin/GoogleSignInHelper.java.meta +32 -0
  55. package/Runtime/Code/GoogleSignIn/Plugins/Android/src/main/java/com/google/googlesignin/IListener.java +13 -0
  56. package/Runtime/Code/GoogleSignIn/Plugins/Android/src/main/java/com/google/googlesignin/IListener.java.meta +32 -0
  57. package/Runtime/Code/GoogleSignIn/Plugins/Android/src/main/java/com/google/googlesignin.meta +8 -0
  58. package/Runtime/Code/GoogleSignIn/Plugins/Android/src/main/java/com/google.meta +8 -0
  59. package/Runtime/Code/GoogleSignIn/Plugins/Android/src/main/java/com.meta +8 -0
  60. package/Runtime/Code/GoogleSignIn/Plugins/Android/src/main/java.meta +8 -0
  61. package/Runtime/Code/GoogleSignIn/Plugins/Android/src/main.meta +8 -0
  62. package/Runtime/Code/GoogleSignIn/Plugins/Android/src.meta +8 -0
  63. package/Runtime/Code/GoogleSignIn/Plugins/Android.meta +8 -0
  64. package/Runtime/Code/GoogleSignIn/Plugins/iOS/GoogleSignIn.h +39 -0
  65. package/Runtime/Code/GoogleSignIn/Plugins/iOS/GoogleSignIn.h.meta +35 -0
  66. package/Runtime/Code/GoogleSignIn/Plugins/iOS/GoogleSignIn.mm +371 -0
  67. package/Runtime/Code/GoogleSignIn/Plugins/iOS/GoogleSignIn.mm.meta +35 -0
  68. package/Runtime/Code/GoogleSignIn/Plugins/iOS/GoogleSignInAppController.h +37 -0
  69. package/Runtime/Code/GoogleSignIn/Plugins/iOS/GoogleSignInAppController.h.meta +35 -0
  70. package/Runtime/Code/GoogleSignIn/Plugins/iOS/GoogleSignInAppController.mm +93 -0
  71. package/Runtime/Code/GoogleSignIn/Plugins/iOS/GoogleSignInAppController.mm.meta +35 -0
  72. package/Runtime/Code/GoogleSignIn/Plugins/iOS.meta +9 -0
  73. package/Runtime/Code/GoogleSignIn/Plugins.meta +9 -0
  74. package/Runtime/Code/GoogleSignIn/README.md +232 -0
  75. package/Runtime/Code/GoogleSignIn/README.md.meta +7 -0
  76. package/Runtime/Code/GoogleSignIn/Samples~/SignInSample/MainScene.unity +0 -0
  77. package/Runtime/Code/GoogleSignIn/Samples~/SignInSample/MainScene.unity.meta +10 -0
  78. package/Runtime/Code/GoogleSignIn/Samples~/SignInSample/SigninSampleScript.cs +117 -0
  79. package/Runtime/Code/GoogleSignIn/Samples~/SignInSample/SigninSampleScript.cs.meta +14 -0
  80. package/Runtime/Code/GoogleSignIn/Samples~/SignInSample.meta +9 -0
  81. package/Runtime/Code/GoogleSignIn/package.json +23 -0
  82. package/Runtime/Code/GoogleSignIn/package.json.meta +7 -0
  83. package/Runtime/Code/GoogleSignIn.meta +3 -0
  84. package/Runtime/Code/Luau/Airship.LuauCore.asmdef +2 -1
  85. package/Runtime/Code/Luau/BinaryBlob.cs +170 -217
  86. package/Runtime/Code/Luau/LuauCompiler.cs +13 -22
  87. package/Runtime/Code/Luau/LuauCoreCallbacks.cs +5 -2
  88. package/Runtime/Code/Luau/LuauCoreReflection.cs +2 -2
  89. package/Runtime/Code/Luau/LuauPlugin.cs +11 -2
  90. package/Runtime/Code/Luau/LuauState.cs +1 -0
  91. package/Runtime/Code/Luau/ThreadManager.cs +10 -1
  92. package/Runtime/Code/LuauAPI/EventSystemAPI.cs +18 -5
  93. package/Runtime/Code/LuauAPI/PhysicsAPI.cs +19 -0
  94. package/Runtime/Code/LuauAPI/PointerEventDataAPI.cs +9 -0
  95. package/Runtime/Code/LuauAPI/PointerEventDataAPI.cs.meta +3 -0
  96. package/Runtime/Code/Network/StateSystem/AirshipNetworkedStateManager.cs +32 -30
  97. package/Runtime/Code/Player/Accessories/AccessoryBuilder.cs +6 -4
  98. package/Runtime/Code/Player/Character/MovementSystems/Character/CharacterMovement.cs +483 -247
  99. package/Runtime/Code/Player/Character/MovementSystems/Character/CharacterPhysics.cs +138 -141
  100. package/Runtime/Code/Player/Character/MovementSystems/Character/Structures/CharacterInputData.cs +4 -3
  101. package/Runtime/Code/Player/Character/MovementSystems/Character/Structures/CharacterSnapshotData.cs +10 -27
  102. package/Runtime/Code/ProjectSetup/PhysicsSetup.cs +3 -3
  103. package/Runtime/Code/RemoteConsole/ServerConsole.cs +1 -1
  104. package/Runtime/Code/VoiceChat/AirshipUniVoiceNetwork.cs +7 -1
  105. package/Runtime/Code/VoxelWorld/Editor/Airship.VoxelWorld.Editor.asmdef +2 -1
  106. package/Runtime/Code/VoxelWorld/Editor/VoxelWorldEditor.cs +3 -3
  107. package/Runtime/Code/VoxelWorld/Resources/VoxelWorldDefaultBlocks/{DefaultVoxelBlockDefinionList.asset → DefaultVoxelBlockDefinitionList.asset} +1 -1
  108. package/Runtime/Code/VoxelWorld/VoxelBlockDefinitionList.cs +8 -6
  109. package/Runtime/Code/VoxelWorld/VoxelBlocks.cs +5 -2
  110. package/Runtime/Code/Zstd/Zstd.asmdef +14 -0
  111. package/Runtime/Code/Zstd/Zstd.asmdef.meta +7 -0
  112. package/Runtime/Code/Zstd/Zstd.cs +192 -0
  113. package/Runtime/Code/Zstd/Zstd.cs.meta +2 -0
  114. package/Runtime/Code/Zstd/ZstdNative.cs +416 -0
  115. package/Runtime/Code/Zstd/ZstdNative.cs.meta +3 -0
  116. package/Runtime/Code/Zstd.meta +8 -0
  117. package/Runtime/Plugins/Android/libLuauPlugin.so +0 -0
  118. package/Runtime/Plugins/Android/libLuauPlugin.so.meta +1 -0
  119. package/Runtime/Plugins/Linux/libLuauPlugin.so +0 -0
  120. package/Runtime/Plugins/Mac/LuauPlugin.bundle/Contents/Info.plist +1 -1
  121. package/Runtime/Plugins/Mac/LuauPlugin.bundle/Contents/MacOS/LuauPlugin +0 -0
  122. package/Runtime/Plugins/Windows/x64/LuauPlugin.dll +0 -0
  123. package/Runtime/Plugins/Windows/x64/LuauPlugin.pdb +0 -0
  124. package/Runtime/Plugins/iOS/LuauPluginIos.a +0 -0
  125. package/Runtime/Scenes/CoreScene.unity +312 -216
  126. package/Runtime/Scenes/MainMenu.unity +129 -80
  127. package/URP/AirshipURPAsset.asset +1 -1
  128. package/package.json +1 -1
  129. package/AuthenticationForUnity/Runtime/Browser/AndroidBrowser.cs +0 -85
  130. package/AuthenticationForUnity/Runtime/Browser/AndroidBrowser.cs.meta +0 -3
  131. /package/Runtime/Code/VoxelWorld/Resources/VoxelWorldDefaultBlocks/{DefaultVoxelBlockDefinionList.asset.meta → DefaultVoxelBlockDefinitionList.asset.meta} +0 -0
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "name": "Cdm.Authentication",
3
3
  "rootNamespace": "Cdm.Authentication",
4
- "references": [],
4
+ "references": [
5
+ "GUID:2a0340569ab0e1245a38e0d6c7b2529b"
6
+ ],
5
7
  "includePlatforms": [],
6
8
  "excludePlatforms": [],
7
9
  "allowUnsafeCode": false,
@@ -532,6 +532,11 @@ public static class CreateAssetBundles {
532
532
  public static void BuildiOSAssetBundles() {
533
533
  BuildGameAssetBundles(AirshipPlatform.iOS);
534
534
  }
535
+
536
+ [MenuItem("Airship/Internal/Build Android Game Bundles")]
537
+ public static void BuildAndroidAssetBundles() {
538
+ BuildGameAssetBundles(AirshipPlatform.Android);
539
+ }
535
540
  #endif
536
541
 
537
542
  #if AIRSHIP_INTERNAL
@@ -65,7 +65,8 @@
65
65
  "GUID:627104647b9c04b4ebb8978a92ecac63",
66
66
  "GUID:6e5063adab271564ba0098a06a8cebda",
67
67
  "GUID:3b5390adca4e2bb4791cb930316d6f3e",
68
- "GUID:725ee7191c021de4dbf9269590ded755"
68
+ "GUID:725ee7191c021de4dbf9269590ded755",
69
+ "GUID:2a0340569ab0e1245a38e0d6c7b2529b"
69
70
  ],
70
71
  "includePlatforms": [
71
72
  "Editor"
@@ -15,8 +15,7 @@ using Newtonsoft.Json;
15
15
  using Debug = UnityEngine.Debug;
16
16
 
17
17
  [UnityEditor.AssetImporters.ScriptedImporter(2, "lua")]
18
- public class LuauImporter : UnityEditor.AssetImporters.ScriptedImporter
19
- {
18
+ public class LuauImporter : UnityEditor.AssetImporters.ScriptedImporter {
20
19
  private const string IconOk = "Packages/gg.easy.airship/Editor/LuauAssetIcon.png";
21
20
  private const string IconFail = "Packages/gg.easy.airship/Editor/LuauAssetIconError.png";
22
21
 
@@ -32,13 +31,6 @@ public class LuauImporter : UnityEditor.AssetImporters.ScriptedImporter
32
31
 
33
32
  private static bool _mutableGlobalsSet = false;
34
33
 
35
- protected struct CompilationResult
36
- {
37
- public IntPtr Data;
38
- public long DataSize;
39
- public bool Compiled;
40
- }
41
-
42
34
  private static Dictionary<string, string> ParseLuauDirectives(string source) {
43
35
  Dictionary<string, string> directives = null;
44
36
 
@@ -92,7 +84,7 @@ public class LuauImporter : UnityEditor.AssetImporters.ScriptedImporter
92
84
  Debug.Log("Byte count: " + byteCounter);
93
85
  }
94
86
 
95
- protected (string fileName, CompilationResult? result) CompileLuauAsset(UnityEditor.AssetImporters.AssetImportContext ctx, AirshipScript subAsset, string assetPath) {
87
+ protected (string fileName, LuauCompiler.CompilationResult? result) CompileLuauAsset(UnityEditor.AssetImporters.AssetImportContext ctx, AirshipScript subAsset, string assetPath) {
96
88
  ClearStopOfCompilationCoroutine();
97
89
 
98
90
  if (!_mutableGlobalsSet) {
@@ -114,8 +106,8 @@ public class LuauImporter : UnityEditor.AssetImporters.ScriptedImporter
114
106
  // Read Lua source
115
107
  var data = File.ReadAllText(assetPath);
116
108
 
117
- IntPtr filenameStr = Marshal.StringToCoTaskMemUTF8(assetPath); //Ok
118
- IntPtr dataStr = Marshal.StringToCoTaskMemUTF8(data); //Ok
109
+ var filenameStr = Marshal.StringToCoTaskMemUTF8(assetPath);
110
+ var dataStr = Marshal.StringToCoTaskMemUTF8(data);
119
111
 
120
112
  // Parse and store Luau directives:
121
113
  var directives = ParseLuauDirectives(data);
@@ -133,28 +125,24 @@ public class LuauImporter : UnityEditor.AssetImporters.ScriptedImporter
133
125
  // Compile
134
126
  StopwatchCompile.Start();
135
127
  var len = Encoding.UTF8.GetByteCount(data);
136
- IntPtr res = LuauPlugin.LuauCompileCode(dataStr, len, filenameStr, ctx.assetPath.Length, 1);
128
+ var res = LuauPlugin.LuauCompileCode(dataStr, len, filenameStr, ctx.assetPath.Length, LuauPlugin.LuauOptimizationLevel.Baseline);
137
129
  StopwatchCompile.Stop();
138
130
 
139
131
  Marshal.FreeCoTaskMem(dataStr);
140
132
  Marshal.FreeCoTaskMem(filenameStr);
141
133
 
142
134
  // Figure out what happened
143
- var resStruct = Marshal.PtrToStructure<CompilationResult>(res);
144
- // Debug.Log("Compilation of " + ctx.assetPath + ": " + resStruct.Compiled.ToString());
135
+ var compilationResult = Marshal.PtrToStructure<LuauCompiler.CompilationResult>(res);
145
136
 
146
137
  var ext = Path.GetExtension(ctx.assetPath);
147
138
  var fileName = assetPath.Substring(0, assetPath.Length - ext.Length) + ".bytes";
148
139
 
149
- // var subAsset = ScriptableObject.CreateInstance<Luau.BinaryFile>();
150
-
151
- bool compileSuccess = true;
152
- string compileErrMessage = "none";
140
+ var compileSuccess = true;
141
+ var compileErrMessage = "none";
153
142
 
154
143
  // Get metadata from JSON file (if it's found):
155
144
  var metadataFilepath = $"{assetPath}.json~";
156
- if (File.Exists(metadataFilepath))
157
- {
145
+ if (File.Exists(metadataFilepath)) {
158
146
  var json = File.ReadAllText(metadataFilepath);
159
147
  var (metadata, err) = LuauMetadata.FromJson(json);
160
148
 
@@ -170,11 +158,10 @@ public class LuauImporter : UnityEditor.AssetImporters.ScriptedImporter
170
158
  }
171
159
  }
172
160
 
173
- subAsset.m_path = FileExtensions.Transform( ctx.assetPath, FileExtensions.Typescript, FileExtensions.Lua);
161
+ subAsset.m_path = FileExtensions.Transform(ctx.assetPath, FileExtensions.Typescript, FileExtensions.Lua);
174
162
 
175
- if (!resStruct.Compiled)
176
- {
177
- var resString = Marshal.PtrToStringUTF8(resStruct.Data, (int)resStruct.DataSize);
163
+ if (!compilationResult.Compiled) {
164
+ var resString = Marshal.PtrToStringUTF8(compilationResult.Data, (int)compilationResult.DataSize);
178
165
  compileSuccess = false;
179
166
  compileErrMessage = resString;
180
167
  ctx.LogImportError($"Failed to compile {ctx.assetPath}: {resString}");
@@ -183,21 +170,19 @@ public class LuauImporter : UnityEditor.AssetImporters.ScriptedImporter
183
170
  subAsset.m_compiled = compileSuccess;
184
171
  subAsset.m_compilationError = compileErrMessage;
185
172
 
186
- var bytes = new byte[resStruct.DataSize];
187
- Marshal.Copy(resStruct.Data, bytes, 0, (int)resStruct.DataSize);
173
+ var bytes = new byte[compilationResult.DataSize];
174
+ Marshal.Copy(compilationResult.Data, bytes, 0, (int)compilationResult.DataSize);
188
175
 
189
176
  subAsset.m_bytes = bytes;
190
177
  byteCounter += bytes.Length;
191
178
 
192
179
  CompiledFiles.Add(subAsset);
193
180
  _elapsed = Stopwatch.ElapsedMilliseconds;
194
-
195
-
196
181
 
197
182
  ClearStopOfCompilationCoroutine();
198
183
  _stopOfCompilationCoroutine = EditorCoroutineUtility.StartCoroutineOwnerless(ScheduleStopOfCompilation());
199
184
 
200
- return (fileName, resStruct);
185
+ return (fileName, compilationResult);
201
186
  }
202
187
 
203
188
  public override unsafe void OnImportAsset(UnityEditor.AssetImporters.AssetImportContext ctx) {
@@ -212,16 +197,14 @@ public class LuauImporter : UnityEditor.AssetImporters.ScriptedImporter
212
197
  ctx.SetMainObject(luauScript);
213
198
  }
214
199
 
215
- private static void ClearStopOfCompilationCoroutine()
216
- {
200
+ private static void ClearStopOfCompilationCoroutine() {
217
201
  if (_stopOfCompilationCoroutine == null) return;
218
202
 
219
203
  EditorCoroutineUtility.StopCoroutine(_stopOfCompilationCoroutine);
220
204
  _stopOfCompilationCoroutine = null;
221
205
  }
222
206
 
223
- private static IEnumerator ScheduleStopOfCompilation()
224
- {
207
+ private static IEnumerator ScheduleStopOfCompilation() {
225
208
  // Wait 1 frame
226
209
  yield return null;
227
210
 
@@ -235,14 +218,12 @@ public class LuauImporter : UnityEditor.AssetImporters.ScriptedImporter
235
218
  }
236
219
 
237
220
  private static bool previouslyCompiledWithErrors = false;
238
- private static void LogResults()
239
- {
221
+ private static void LogResults() {
240
222
  // Count success & failure compilations
241
223
  var numCompiled = CompiledFiles.Count;
242
224
  var numSuccess = 0;
243
225
  var numFailure = 0;
244
- foreach (var binaryFile in CompiledFiles)
245
- {
226
+ foreach (var binaryFile in CompiledFiles) {
246
227
  if (binaryFile.m_compiled) numSuccess++;
247
228
  else numFailure++;
248
229
  }
@@ -257,8 +238,6 @@ public class LuauImporter : UnityEditor.AssetImporters.ScriptedImporter
257
238
  var successFormat = numSuccess > 0 ? "<color=#77f777>{0} succeeded</color>" : "{0} succeeded";
258
239
  var failureFormat = numFailure > 0 ? "<color=#ff534a>{1} failed</color>" : "{1} failed";
259
240
 
260
-
261
-
262
241
  if (EditorIntegrationsConfig.instance.typescriptVerbose || numFailure > 0 || previouslyCompiledWithErrors) {
263
242
  Debug.LogFormat(
264
243
  $"{numCompiled} lua source{(numCompiled == 1 ? "" : "s")} compiled in {elapsedTime} ({successFormat}, {failureFormat})", numSuccess, numFailure);
@@ -57,7 +57,8 @@
57
57
  "GUID:6e5063adab271564ba0098a06a8cebda",
58
58
  "GUID:3b5390adca4e2bb4791cb930316d6f3e",
59
59
  "GUID:725ee7191c021de4dbf9269590ded755",
60
- "GUID:77ccaf49895b0d64e87cd4b4faf83c49"
60
+ "GUID:77ccaf49895b0d64e87cd4b4faf83c49",
61
+ "GUID:2a0340569ab0e1245a38e0d6c7b2529b"
61
62
  ],
62
63
  "includePlatforms": [
63
64
  "Editor"
@@ -1,11 +1,11 @@
1
1
  // ReSharper disable InconsistentNaming
2
2
  namespace Code {
3
3
  public static class AirshipConst {
4
- public const int playerVersion = 5;
4
+ public const int playerVersion = 8;
5
5
 
6
6
  /// <summary>
7
7
  /// The server will kick clients that have a playerVersion lower than this value.
8
8
  /// </summary>
9
- public const int minAcceptedPlayerVersionOnServer = 5;
9
+ public const int minAcceptedPlayerVersionOnServer = 8;
10
10
  }
11
11
  }
@@ -5,6 +5,7 @@ using Cdm.Authentication.Browser;
5
5
  using Cdm.Authentication.Clients;
6
6
  using Cdm.Authentication.OAuth2;
7
7
  using Code.Http.Internal;
8
+ using Google;
8
9
  using JetBrains.Annotations;
9
10
  using Proyecto26;
10
11
  using RSG;
@@ -16,9 +17,9 @@ public class AuthManager {
16
17
  public static Action authed;
17
18
 
18
19
  private static string GetAccountJSONPath() {
19
- var stagingExtension = "";
20
+ var stagingExtension = "";
20
21
  #if AIRSHIP_STAGING
21
- stagingExtension = "_staging";
22
+ stagingExtension = "_staging";
22
23
  #endif
23
24
  #if DEVELOPMENT_BUILD
24
25
  return Path.Combine(Application.persistentDataPath, $"account_devbuild{stagingExtension}.json");
@@ -84,8 +85,8 @@ public class AuthManager {
84
85
  string clientId = "987279961241-0mjidme48us0fis0vtqk4jqrsmk7ar0n.apps.googleusercontent.com";
85
86
  string clientSecret = "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";
86
87
  #else
87
- string clientId = "457451560440-fvhufuvt3skas9m046jqin0l10h8uaph.apps.googleusercontent.com";
88
- string clientSecret = "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";
88
+ string clientId = "457451560440-fvhufuvt3skas9m046jqin0l10h8uaph.apps.googleusercontent.com";
89
+ string clientSecret = "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";
89
90
  #endif
90
91
  string redirectUri = "http://localhost:8080";
91
92
 
@@ -99,16 +100,6 @@ public class AuthManager {
99
100
  clientSecret = null;
100
101
  redirectUri = "gg.easy.airship:/oauth2";
101
102
  #endif
102
- #endif
103
-
104
- #if UNITY_ANDROID && !UNITY_EDITOR
105
- #if AIRSHIP_STAGING
106
- // TODO
107
- #else
108
- clientId = "457451560440-htottasd1788to2boc7lg08jrkduotg1.apps.googleusercontent.com";
109
- clientSecret = null;
110
- redirectUri = "https://airship.gg/oauth2";
111
- #endif
112
103
  #endif
113
104
 
114
105
  var auth = new GoogleAuth(new AuthorizationCodeFlow.Configuration() {
@@ -120,9 +111,32 @@ public class AuthManager {
120
111
  redirectUri = redirectUri,
121
112
  scope = "openid email profile",
122
113
  });
114
+
115
+ GoogleSignIn.Configuration = new GoogleSignInConfiguration() {
116
+ RequestEmail = true,
117
+ RequestProfile = true,
118
+ RequestAuthCode = true,
119
+ WebClientId = clientId,
120
+ #if UNITY_EDITOR || UNITY_STANDALONE
121
+ ClientSecret = clientSecret,
122
+ #endif
123
+ };
123
124
 
124
- Debug.Log($"Redirect URI: {redirectUri}");
125
+ #if AIRSHIP_ANDROID_DEBUG
126
+ GoogleSignIn.DefaultInstance.EnableDebugLogging(true);
127
+ #endif
125
128
 
129
+ var accessToken = "";
130
+
131
+ #if UNITY_ANDROID
132
+ var (user, err) = await AuthWithGoogleAndroid();
133
+ if (err != null) {
134
+ return (false, err);
135
+ }
136
+
137
+ var accessTokenRes = await auth.ExchangeCodeForAccessTokenAsync($"http://localhost?code={user.AuthCode}");
138
+ accessToken = accessTokenRes.accessToken;
139
+ #else
126
140
  var crossPlatformBrowser = new CrossPlatformBrowser();
127
141
  var standaloneBrowser = new StandaloneBrowser();
128
142
  standaloneBrowser.closePageResponse =
@@ -133,16 +147,16 @@ public class AuthManager {
133
147
  crossPlatformBrowser.platformBrowsers.Add(RuntimePlatform.OSXEditor, standaloneBrowser);
134
148
  crossPlatformBrowser.platformBrowsers.Add(RuntimePlatform.OSXPlayer, standaloneBrowser);
135
149
  crossPlatformBrowser.platformBrowsers.Add(RuntimePlatform.IPhonePlayer, new ASWebAuthenticationSessionBrowser());
136
- crossPlatformBrowser.platformBrowsers.Add(RuntimePlatform.Android, new DeepLinkBrowser());
137
- // crossPlatformBrowser.platformBrowsers.Add(RuntimePlatform.Android, new AndroidBrowser("http://*:8080"));
138
150
 
139
151
  using var authenticationSession = new AuthenticationSession(auth, crossPlatformBrowser);
140
152
 
141
153
  // Opens a browser to log user in
142
154
  AccessTokenResponse accessTokenResponse = await authenticationSession.AuthenticateAsync();
143
- if (accessTokenResponse.accessToken != "") {
155
+ accessToken = accessTokenResponse.accessToken;
156
+ #endif
157
+ if (accessToken != "") {
144
158
  var reqBody = new SignInWithIdpRequest() {
145
- postBody = "access_token=" + accessTokenResponse.accessToken + "&providerId=google.com",
159
+ postBody = "access_token=" + accessToken + "&providerId=google.com",
146
160
  requestUri = "http://localhost",
147
161
  returnSecureToken = true
148
162
  };
@@ -177,5 +191,33 @@ public class AuthManager {
177
191
  Debug.Log("Login cancelled.");
178
192
  return (false, ""); // Don't return a display error
179
193
  }
180
- }
194
+ }
195
+
196
+ #if UNITY_ANDROID
197
+ private static Task<(GoogleSignInUser user, string error)> AuthWithGoogleAndroid() {
198
+ GoogleSignIn.Configuration.UseGameSignIn = false;
199
+
200
+ return GoogleSignIn.DefaultInstance.SignIn().ContinueWith(OnAuthGoogleAndroidFinished, TaskScheduler.FromCurrentSynchronizationContext());
201
+ }
202
+
203
+ private static (GoogleSignInUser user, string error) OnAuthGoogleAndroidFinished(Task<GoogleSignInUser> task) {
204
+ if (task.IsFaulted) {
205
+ // Attempt to get the SignInException and return the message:
206
+ if (task.Exception != null) {
207
+ using var enumerator = task.Exception.InnerExceptions.GetEnumerator();
208
+ if (enumerator.MoveNext()) {
209
+ var err = (GoogleSignIn.SignInException)enumerator.Current;
210
+ return (null, $"{err!.Status}: {err!.Message}");
211
+ }
212
+ }
213
+ return (null, "Unknown sign in exception");
214
+ }
215
+
216
+ if (task.IsCanceled) {
217
+ return (null, "Sign in cancelled");
218
+ }
219
+
220
+ return (task.Result, null);
221
+ }
222
+ #endif
181
223
  }
@@ -177,7 +177,7 @@ namespace Code.Bootstrap {
177
177
  NetworkClient.Send(new ClientFinishedPreparingMessage());
178
178
  }, false);
179
179
 
180
- NetworkClient.RegisterHandler<LuauBytesMessage>(async data => {
180
+ NetworkClient.RegisterHandler<LuauBytesMessage>(data => {
181
181
  int totalCounter = 0;
182
182
  foreach (var files in data.scriptsDto.files) {
183
183
  totalCounter += files.Value.Count;
@@ -185,7 +185,16 @@ public class SystemRoot : Singleton<SystemRoot> {
185
185
  var enums = new List<IEnumerator>();
186
186
  foreach (var bundleId in unloadList) {
187
187
  var loadedBundle = this.loadedAssetBundles[bundleId];
188
- enums.Add(this.UnloadBundleAsync(loadedBundle));
188
+
189
+ // We keep code.zip when we will re-loading this same package (code.zip update)
190
+ // Code.zip is always downloaded on join before this code runs, so we know it'll be up-to-date.
191
+ bool keepCodeZip = false;
192
+ var samePackageIdBeingLoaded = packages.Find(p => p.id.ToLower() == loadedBundle.airshipPackage.id.ToLower());
193
+ if (samePackageIdBeingLoaded != null) {
194
+ keepCodeZip = true;
195
+ }
196
+
197
+ enums.Add(this.UnloadBundleAsync(loadedBundle, keepCodeZip));
189
198
  }
190
199
  yield return this.WaitAll(enums.ToArray());
191
200
 
@@ -413,19 +422,25 @@ public class SystemRoot : Singleton<SystemRoot> {
413
422
  #endif
414
423
  }
415
424
 
416
- public IEnumerator UnloadBundleAsync(LoadedAssetBundle loadedBundle) {
417
- Debug.Log($"[SystemRoot]: Unloading bundle {loadedBundle.bundleId}/{loadedBundle.assetBundleFile}");
425
+ public IEnumerator UnloadBundleAsync(LoadedAssetBundle loadedBundle, bool keepCodeZip) {
426
+ var msg = $"[SystemRoot]: Unloading bundle {loadedBundle.bundleId}/{loadedBundle.assetBundleFile}";
427
+ if (keepCodeZip) {
428
+ msg += ". Keeping code.zip";
429
+ }
430
+ Debug.Log(msg);
418
431
  this.networkNetworkPrefabLoader.UnloadNetCollectionId(loadedBundle.netCollectionId);
419
-
420
- if (this.luauFiles.TryGetValue(loadedBundle.bundleId, out var files)) {
421
- int count = files.Count;
422
- foreach (var s in files.Values) {
423
- Object.Destroy(s);
432
+
433
+ if (!keepCodeZip) {
434
+ if (this.luauFiles.TryGetValue(loadedBundle.bundleId, out var files)) {
435
+ int count = files.Count;
436
+ foreach (var s in files.Values) {
437
+ Object.Destroy(s);
438
+ }
439
+ this.luauFiles.Remove(loadedBundle.bundleId);
440
+ Debug.Log($"Unloaded {count} script files.");
424
441
  }
425
- this.luauFiles.Remove(loadedBundle.bundleId);
426
- Debug.Log($"Unloaded {count} script files.");
427
442
  }
428
-
443
+
429
444
  var ao = loadedBundle.assetBundle.UnloadAsync(true);
430
445
  while (!ao.isDone) {
431
446
  yield return null;
@@ -51,7 +51,8 @@
51
51
  "GUID:6806a62c384838046a3c66c44f06d75f",
52
52
  "GUID:325984b52e4128546bc7558552f8b1d2",
53
53
  "GUID:3b5390adca4e2bb4791cb930316d6f3e",
54
- "GUID:725ee7191c021de4dbf9269590ded755"
54
+ "GUID:725ee7191c021de4dbf9269590ded755",
55
+ "GUID:2a0340569ab0e1245a38e0d6c7b2529b"
55
56
  ],
56
57
  "includePlatforms": [],
57
58
  "excludePlatforms": [],
@@ -0,0 +1,55 @@
1
+ {
2
+ "files.exclude": {
3
+ "**/.DS_Store": true,
4
+ "**/.git": true,
5
+ "**/.gitmodules": true,
6
+ "**/*.booproj": true,
7
+ "**/*.pidb": true,
8
+ "**/*.suo": true,
9
+ "**/*.user": true,
10
+ "**/*.userprefs": true,
11
+ "**/*.unityproj": true,
12
+ "**/*.dll": true,
13
+ "**/*.exe": true,
14
+ "**/*.pdf": true,
15
+ "**/*.mid": true,
16
+ "**/*.midi": true,
17
+ "**/*.wav": true,
18
+ "**/*.gif": true,
19
+ "**/*.ico": true,
20
+ "**/*.jpg": true,
21
+ "**/*.jpeg": true,
22
+ "**/*.png": true,
23
+ "**/*.psd": true,
24
+ "**/*.tga": true,
25
+ "**/*.tif": true,
26
+ "**/*.tiff": true,
27
+ "**/*.3ds": true,
28
+ "**/*.3DS": true,
29
+ "**/*.fbx": true,
30
+ "**/*.FBX": true,
31
+ "**/*.lxo": true,
32
+ "**/*.LXO": true,
33
+ "**/*.ma": true,
34
+ "**/*.MA": true,
35
+ "**/*.obj": true,
36
+ "**/*.OBJ": true,
37
+ "**/*.asset": true,
38
+ "**/*.cubemap": true,
39
+ "**/*.flare": true,
40
+ "**/*.mat": true,
41
+ "**/*.meta": true,
42
+ "**/*.prefab": true,
43
+ "**/*.unity": true,
44
+ "build/": true,
45
+ "Build/": true,
46
+ "Library/": true,
47
+ "library/": true,
48
+ "obj/": true,
49
+ "Obj/": true,
50
+ "ProjectSettings/": true,
51
+ "temp/": true,
52
+ "Temp/": true
53
+ },
54
+ "dotnet.defaultSolution": "TestGoogleSignIn.sln"
55
+ }
@@ -0,0 +1,24 @@
1
+ Want to contribute? Great! First, read this page (including the small print at the end).
2
+
3
+ ### Before you contribute
4
+ Before we can use your code, you must sign the
5
+ [Google Individual Contributor License Agreement](https://developers.google.com/open-source/cla/individual?csw=1)
6
+ (CLA), which you can do online. The CLA is necessary mainly because you own the
7
+ copyright to your changes, even after your contribution becomes part of our
8
+ codebase, so we need your permission to use and distribute your code. We also
9
+ need to be sure of various other things — for instance that you'll tell us if you
10
+ know that your code infringes on other people's patents. You don't have to sign
11
+ the CLA until after you've submitted your code for review and a member has
12
+ approved it, but you must do it before we can put your code into our codebase.
13
+ Before you start working on a larger contribution, you should get in touch with
14
+ us first through the issue tracker with your idea so that we can help out and
15
+ possibly guide you. Coordinating up front makes it much easier to avoid
16
+ frustration later on.
17
+
18
+ ### Code reviews
19
+ All submissions, including submissions by project members, require review. We
20
+ use Github pull requests for this purpose.
21
+
22
+ ### The small print
23
+ Contributions made by corporations are covered by a different agreement than
24
+ the one above, the Software Grant and Corporate Contributor License Agreement.
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: bf5b818b5e6f1fb4b920c2d651dd2f82
3
+ TextScriptImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,21 @@
1
+ #if UNITY_EDITOR
2
+ using System.IO;
3
+
4
+ using UnityEngine;
5
+
6
+ using UnityEditor.AssetImporters;
7
+
8
+ [ScriptedImporter(1, "plist")]
9
+ public class PListImporter : ScriptedImporter
10
+ {
11
+ public override void OnImportAsset(AssetImportContext ctx)
12
+ {
13
+ if(ctx.mainObject is TextAsset)
14
+ return;
15
+
16
+ var subAsset = new TextAsset(File.ReadAllText(ctx.assetPath));
17
+ ctx.AddObjectToAsset("text", subAsset);
18
+ ctx.SetMainObject(subAsset);
19
+ }
20
+ }
21
+ #endif
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 57db1ee44933e4015a8e5b4f29a487e8
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,69 @@
1
+ #if UNITY_EDITOR
2
+ using UnityEngine;
3
+
4
+ using UnityEditor;
5
+ #if UNITY_IOS
6
+ using UnityEditor.iOS.Xcode;
7
+ #endif
8
+
9
+ using UnityEditor.Build;
10
+ using UnityEditor.Build.Reporting;
11
+
12
+ using System;
13
+ using System.IO;
14
+ using System.Linq;
15
+ using System.Collections.Generic;
16
+
17
+ public class PListProcessor : IPostprocessBuildWithReport
18
+ {
19
+ public int callbackOrder => 99999;
20
+
21
+ public void OnPostprocessBuild(BuildReport report)
22
+ {
23
+ #if UNITY_IOS
24
+ string projectBundleId = PlayerSettings.GetApplicationIdentifier(BuildTargetGroup.iOS);
25
+ var plistFiles = AssetDatabase.FindAssets("glob:\"**/*.plist\"").Select((guid) => {
26
+ var doc = new PlistDocument();
27
+ doc.ReadFromFile(AssetDatabase.GUIDToAssetPath(guid));
28
+ return doc;
29
+ }).Where((doc) => {
30
+ return doc.root.values.TryGetValue("BUNDLE_ID",out var element) && element.AsString() == projectBundleId;
31
+ }).ToArray();
32
+
33
+ if(!(plistFiles?.Length > 0))
34
+ return;
35
+
36
+ var google = plistFiles.FirstOrDefault();
37
+
38
+ if(!(google.root.values.TryGetValue("CLIENT_ID",out var CLIENT_ID) && CLIENT_ID?.AsString() is string clientID && clientID.EndsWith("googleusercontent.com")))
39
+ throw new KeyNotFoundException("CLIENT_ID");
40
+ if(!(google.root.values.TryGetValue("REVERSED_CLIENT_ID",out var REVERSED_CLIENT_ID) && REVERSED_CLIENT_ID?.AsString() is string reversedClientID && reversedClientID.StartsWith("com.googleusercontent")))
41
+ throw new KeyNotFoundException("REVERSED_CLIENT_ID");
42
+
43
+ string plistPath = Path.Combine( report.summary.outputPath, "Info.plist" );
44
+
45
+ var info = new PlistDocument();
46
+ info.ReadFromFile(plistPath);
47
+
48
+ info.root.SetString("GIDClientID",clientID);
49
+ var CFBundleURLTypes = (info.root.values.TryGetValue("CFBundleURLTypes",out var element) ? element.AsArray() : null) ?? info.root.CreateArray("CFBundleURLTypes");
50
+ if(!(CFBundleURLTypes?.values?.Count > 0 && CFBundleURLTypes.values.OfType<PlistElementDict>().Select((dict) => dict.values.TryGetValue("CFBundleURLSchemes",out var value) ? value?.AsArray() : null).OfType<PlistElementArray>().SelectMany((array) => array.values).Any((item) => item?.AsString() == reversedClientID)))
51
+ {
52
+ var dict = CFBundleURLTypes.AddDict();
53
+ dict.SetString("CFBundleTypeRole","Editor");
54
+ dict.CreateArray("CFBundleURLSchemes").AddString(reversedClientID);
55
+ }
56
+
57
+ if(google.root.values.TryGetValue("WEB_CLIENT_ID",out var WEB_CLIENT_ID) && WEB_CLIENT_ID?.AsString() is string webClientID && !string.IsNullOrWhiteSpace(webClientID))
58
+ {
59
+ if(webClientID.EndsWith("googleusercontent.com"))
60
+ info.root.SetString("GIDServerClientID",webClientID);
61
+ else throw new ArgumentException("WebClientID");
62
+ }
63
+
64
+ info.WriteToFile(plistPath);
65
+ #endif
66
+ }
67
+ }
68
+
69
+ #endif
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 97598a1b92cb146879db81f44bfeb14d
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: 71aabb773a37445bb8dcac856c8c672e
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: b15db503f08f84da789165e1557fdd7b
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant: