gg.easy.airship 0.1.2170 → 0.1.2171
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/Packages/AirshipPackagesWindow.cs +5 -1
- package/Editor/Util/AirshipEditorUtil.cs +1 -1
- package/Runtime/Code/AirshipConst.cs +3 -2
- package/Runtime/Code/CoreUI/Login/LoginApp.cs +13 -3
- package/Runtime/Code/Luau/AirshipComponent.cs +2 -1
- package/Runtime/Code/Luau/LuauCore.cs +5 -0
- package/Runtime/Code/Luau/LuauCoreCallbacks.cs +1 -1
- package/Runtime/Code/Luau/LuauMetadataPropertySerializer.cs +10 -7
- package/Runtime/Code/Luau/LuauPlugin.cs +26 -0
- package/Runtime/Code/Luau/LuauState.cs +4 -0
- package/Runtime/Code/Luau/ThreadManager.cs +9 -0
- package/Runtime/Code/LuauAPI/Bridge.cs +11 -0
- package/Runtime/Code/Network/Simulation/AirshipNetworkedObject.cs +25 -13
- package/Runtime/Code/Network/Simulation/AirshipSimulationManager.cs +0 -3
- package/Runtime/Code/Network/StateSystem/AirshipNetworkedStateManager.cs +0 -1
- package/Runtime/Code/Player/Character/Animation/CharacterAnimationHelper.cs +81 -108
- package/Runtime/Code/Player/Character/MovementSystems/Character/CharacterAnimationSyncData.cs +12 -12
- package/Runtime/Code/Player/Character/MovementSystems/Character/CharacterMovement.cs +166 -109
- package/Runtime/Code/Player/Character/MovementSystems/Character/CharacterMovementSettings.cs +1 -7
- package/Runtime/Code/Player/Character/MovementSystems/Character/CharacterPhysics.cs +5 -4
- package/Runtime/Code/VoxelWorld/VoxelCompressUtil.cs +3 -1
- package/Runtime/Code/VoxelWorld/VoxelWorld.cs +74 -84
- package/Runtime/Code/VoxelWorld/WorldSaveFile.cs +77 -26
- package/Runtime/Plugins/Android/libLuauPlugin.so +0 -0
- package/Runtime/Plugins/Linux/libLuauPlugin.so +0 -0
- package/Runtime/Plugins/Mac/LuauPlugin.bundle/Contents/Info.plist +7 -7
- package/Runtime/Plugins/Mac/LuauPlugin.bundle/Contents/MacOS/LuauPlugin +0 -0
- package/Runtime/Plugins/Windows/x64/LuauPlugin.dll +0 -0
- package/Runtime/Plugins/Windows/x64/LuauPlugin.pdb +0 -0
- package/Runtime/Plugins/iOS/LuauPluginIos.a +0 -0
- package/Runtime/Scenes/Login.unity +547 -414
- package/package.json +1 -1
|
@@ -416,7 +416,11 @@ namespace Editor.Packages {
|
|
|
416
416
|
// Act as if we are building all asset bundles (including CoreMaterials).
|
|
417
417
|
// This is so our current build target will have references to those asset bundles.
|
|
418
418
|
// This is paired with changes to Scriptable Build Pipeline that prevent these bundles from actually being built.
|
|
419
|
-
|
|
419
|
+
var compileUrpShaders = true;
|
|
420
|
+
if (packageDoc.id.ToLower() == "@easy/core") {
|
|
421
|
+
compileUrpShaders = false;
|
|
422
|
+
}
|
|
423
|
+
List<AssetBundleBuild> builds = CreateAssetBundles.GetPackageAssetBundleBuilds(compileUrpShaders);
|
|
420
424
|
|
|
421
425
|
foreach (var platform in platforms) {
|
|
422
426
|
var st = Stopwatch.StartNew();
|
|
@@ -60,7 +60,7 @@ public class AirshipEditorUtil {
|
|
|
60
60
|
int counter = 0;
|
|
61
61
|
for (int i = 0; i < total; i++) {
|
|
62
62
|
string path = AssetDatabase.GUIDToAssetPath(prefabGUIDs[i]);
|
|
63
|
-
if (path.Contains("Assets/Polygon Arsenal") || path.Contains("Assets/Hovl") || path.Contains("
|
|
63
|
+
if (path.Contains("Assets/Polygon Arsenal") || path.Contains("Assets/Hovl") || path.Contains("Assets/Raygeas")) {
|
|
64
64
|
continue;
|
|
65
65
|
}
|
|
66
66
|
EditorUtility.DisplayProgressBar("Reimporting Prefabs", path, (float)i / total);
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
// ReSharper disable InconsistentNaming
|
|
2
|
+
|
|
2
3
|
namespace Code {
|
|
3
4
|
public static class AirshipConst {
|
|
4
|
-
public const int playerVersion =
|
|
5
|
+
public const int playerVersion = 14;
|
|
5
6
|
|
|
6
7
|
/// <summary>
|
|
7
8
|
/// The server will kick clients that have a playerVersion lower than this value.
|
|
8
9
|
/// </summary>
|
|
9
10
|
public const int minAcceptedPlayerVersionOnServer = 13;
|
|
10
11
|
}
|
|
11
|
-
}
|
|
12
|
+
}
|
|
@@ -139,9 +139,9 @@ public class LoginApp : MonoBehaviour {
|
|
|
139
139
|
this.loading = false;
|
|
140
140
|
if (this.mobileMode) {
|
|
141
141
|
if (fullScreen) {
|
|
142
|
-
NativeTween.
|
|
142
|
+
NativeTween.AnchorMax(this.mobileBottom, new Vector2(1f, 0.74f), instant ? 0f : 0.12f);
|
|
143
143
|
} else {
|
|
144
|
-
NativeTween.
|
|
144
|
+
NativeTween.AnchorMax(this.mobileBottom, new Vector2(1f, 0.46f), instant ? 0f : 0.12f);
|
|
145
145
|
}
|
|
146
146
|
this.mobileLoginPage.SetActive(false);
|
|
147
147
|
this.mobilePickUsernamePage.SetActive(false);
|
|
@@ -157,9 +157,19 @@ public class LoginApp : MonoBehaviour {
|
|
|
157
157
|
} else {
|
|
158
158
|
this.backButton.SetActive(pageGameObject != this.loginPage);
|
|
159
159
|
}
|
|
160
|
-
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
public void BackToLoginPage() {
|
|
163
|
+
RouteToPage(this.mobileMode ? this.mobileLoginPage : this.loginPage, false);
|
|
164
|
+
}
|
|
161
165
|
|
|
162
166
|
public async void PressContinueWithGoogle() {
|
|
167
|
+
// Uncomment to test transition
|
|
168
|
+
// if (true) {
|
|
169
|
+
// RouteToPage(this.mobileMode ? this.mobilePickUsernamePage : this.pickUsernamePage, true);
|
|
170
|
+
// return;
|
|
171
|
+
// }
|
|
172
|
+
|
|
163
173
|
loading = true;
|
|
164
174
|
var authResult = await AuthManager.AuthWithGoogle();
|
|
165
175
|
if (!authResult.success) {
|
|
@@ -325,6 +325,7 @@ public class AirshipComponent : MonoBehaviour, ITriggerReceiver {
|
|
|
325
325
|
|
|
326
326
|
private void OnDestroy() {
|
|
327
327
|
ComponentIdToScriptName.Remove(_airshipComponentId);
|
|
328
|
+
LuauCore.onResetInstance -= OnLuauReset;
|
|
328
329
|
|
|
329
330
|
if (thread == IntPtr.Zero || !LuauCore.IsReady) return;
|
|
330
331
|
|
|
@@ -336,7 +337,6 @@ public class AirshipComponent : MonoBehaviour, ITriggerReceiver {
|
|
|
336
337
|
LuauPlugin.LuauDestroyThread(thread);
|
|
337
338
|
}
|
|
338
339
|
thread = IntPtr.Zero;
|
|
339
|
-
LuauCore.onResetInstance -= OnLuauReset;
|
|
340
340
|
}
|
|
341
341
|
|
|
342
342
|
#region Collision Events
|
|
@@ -460,6 +460,7 @@ public class AirshipComponent : MonoBehaviour, ITriggerReceiver {
|
|
|
460
460
|
private void OnLuauReset(LuauContext ctx) {
|
|
461
461
|
if (ctx == context) {
|
|
462
462
|
thread = IntPtr.Zero;
|
|
463
|
+
LuauCore.onResetInstance -= OnLuauReset;
|
|
463
464
|
}
|
|
464
465
|
}
|
|
465
466
|
|
|
@@ -139,6 +139,7 @@ public partial class LuauCore : MonoBehaviour {
|
|
|
139
139
|
|
|
140
140
|
var stringCount = unityAPIClasses.Count;
|
|
141
141
|
var stringList = new IntPtr[stringCount];
|
|
142
|
+
var stringLenList = new int[stringCount];
|
|
142
143
|
eventConnections.Clear();
|
|
143
144
|
|
|
144
145
|
var counter = 0;
|
|
@@ -146,9 +147,11 @@ public partial class LuauCore : MonoBehaviour {
|
|
|
146
147
|
var apiName = api.Value.GetAPIType().Name;
|
|
147
148
|
var strPtr = Marshal.StringToCoTaskMemUTF8(apiName);
|
|
148
149
|
stringList[counter] = strPtr;
|
|
150
|
+
stringLenList[counter] = apiName.Length;
|
|
149
151
|
counter += 1;
|
|
150
152
|
}
|
|
151
153
|
var stringAddresses = GCHandle.Alloc(stringList, GCHandleType.Pinned);
|
|
154
|
+
var stringLengthsHandle = GCHandle.Alloc(stringLenList, GCHandleType.Pinned);
|
|
152
155
|
|
|
153
156
|
LuauPlugin.LuauInitializePrintCallback(printCallback_holder);
|
|
154
157
|
LuauPlugin.LuauInitializeComponentCallbacks(componentSetEnabledCallback_holder);
|
|
@@ -165,6 +168,7 @@ public partial class LuauCore : MonoBehaviour {
|
|
|
165
168
|
isObjectDestroyedCallback = isObjectDestroyedCallback_holder,
|
|
166
169
|
getUnityObjectNameCallback = getUnityObjectNameCallback_holder,
|
|
167
170
|
staticList = stringAddresses.AddrOfPinnedObject(),
|
|
171
|
+
staticListStrLen = stringLengthsHandle.AddrOfPinnedObject(),
|
|
168
172
|
staticCount = stringCount,
|
|
169
173
|
isServer = RunCore.IsServer() ? 1 : 0,
|
|
170
174
|
#if UNITY_EDITOR
|
|
@@ -180,6 +184,7 @@ public partial class LuauCore : MonoBehaviour {
|
|
|
180
184
|
LuauState.FromContext(LuauContext.Game);
|
|
181
185
|
|
|
182
186
|
stringAddresses.Free();
|
|
187
|
+
stringLengthsHandle.Free();
|
|
183
188
|
|
|
184
189
|
// Free up the strings:
|
|
185
190
|
foreach (var ptr in stringList) {
|
|
@@ -517,7 +517,7 @@ public partial class LuauCore : MonoBehaviour {
|
|
|
517
517
|
|
|
518
518
|
case PODTYPE.POD_STRING: {
|
|
519
519
|
if (t.IsAssignableFrom(stringType)) {
|
|
520
|
-
|
|
520
|
+
var dataStr = Marshal.PtrToStringUTF8(propertyData, propertyDataSize);
|
|
521
521
|
if (field != null) {
|
|
522
522
|
field.SetValue(objectReference, dataStr);
|
|
523
523
|
} else {
|
|
@@ -20,7 +20,7 @@ namespace Luau {
|
|
|
20
20
|
{ "LayerMask", typeof(LayerMask) },
|
|
21
21
|
{ "AnimationCurve", typeof(AnimationCurve) },
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
|
|
24
24
|
public static string SerializeAirshipProperty(object obj, AirshipComponentPropertyType objectType) {
|
|
25
25
|
switch (objectType) {
|
|
26
26
|
case AirshipComponentPropertyType.AirshipFloat: {
|
|
@@ -68,15 +68,18 @@ namespace Luau {
|
|
|
68
68
|
obj = Activator.CreateInstance(objType, args);
|
|
69
69
|
} else if (objDefaultVal.target == "method") {
|
|
70
70
|
var args = objDefaultVal.arguments.ToArray();
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
{
|
|
71
|
+
|
|
72
|
+
var argTypes = new Type[args.Length];
|
|
73
|
+
for (var i = 0; i < args.Length; i++) {
|
|
74
|
+
if (args[i] is double) {
|
|
75
75
|
args[i] = Convert.ToSingle(args[i]);
|
|
76
76
|
}
|
|
77
|
+
|
|
78
|
+
// Pass the argument types to GetMethod to clear any ambiguity
|
|
79
|
+
argTypes[i] = args[i].GetType();
|
|
77
80
|
}
|
|
78
|
-
|
|
79
|
-
var expectedMethod = objType.GetMethod(objDefaultVal.method);
|
|
81
|
+
|
|
82
|
+
var expectedMethod = objType.GetMethod(objDefaultVal.method, argTypes);
|
|
80
83
|
obj = expectedMethod?.Invoke(null, args);
|
|
81
84
|
}
|
|
82
85
|
|
|
@@ -66,6 +66,7 @@ public static class LuauPlugin {
|
|
|
66
66
|
public GetUnityObjectName getUnityObjectNameCallback;
|
|
67
67
|
|
|
68
68
|
public IntPtr staticList;
|
|
69
|
+
public IntPtr staticListStrLen;
|
|
69
70
|
public int staticCount;
|
|
70
71
|
public int isServer;
|
|
71
72
|
public int useUnityAllocator;
|
|
@@ -256,6 +257,31 @@ public static class LuauPlugin {
|
|
|
256
257
|
Reset(context);
|
|
257
258
|
}
|
|
258
259
|
|
|
260
|
+
#if UNITY_IPHONE
|
|
261
|
+
[DllImport("__Internal")]
|
|
262
|
+
#else
|
|
263
|
+
[DllImport("LuauPlugin", CallingConvention = CallingConvention.Cdecl)]
|
|
264
|
+
#endif
|
|
265
|
+
private static extern ulong GetUniqueInstanceIdCount(LuauContext context);
|
|
266
|
+
|
|
267
|
+
#if UNITY_IPHONE
|
|
268
|
+
[DllImport("__Internal")]
|
|
269
|
+
#else
|
|
270
|
+
[DllImport("LuauPlugin", CallingConvention = CallingConvention.Cdecl)]
|
|
271
|
+
#endif
|
|
272
|
+
private static extern ulong GetUniqueInstanceIds(LuauContext context, IntPtr arr, ulong arrSize);
|
|
273
|
+
public static unsafe ReadOnlySpan<int> LuauGetUniqueInstanceIds(LuauContext context) {
|
|
274
|
+
var count = GetUniqueInstanceIdCount(context);
|
|
275
|
+
var ids = new int[count];
|
|
276
|
+
|
|
277
|
+
ulong countFetched;
|
|
278
|
+
fixed (int* idsPtr = ids) {
|
|
279
|
+
countFetched = GetUniqueInstanceIds(context, new IntPtr(idsPtr), count);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
return new ReadOnlySpan<int>(ids, 0, (int)countFetched);
|
|
283
|
+
}
|
|
284
|
+
|
|
259
285
|
#if UNITY_IPHONE
|
|
260
286
|
[DllImport("__Internal")]
|
|
261
287
|
#else
|
|
@@ -122,6 +122,10 @@ namespace Luau {
|
|
|
122
122
|
public void Reset() {
|
|
123
123
|
Active = false;
|
|
124
124
|
_currentBuffer?.Clear();
|
|
125
|
+
|
|
126
|
+
var uniqueInstanceIds = LuauPlugin.LuauGetUniqueInstanceIds(Context);
|
|
127
|
+
ThreadDataManager.DeleteObjectReferencesList(uniqueInstanceIds);
|
|
128
|
+
|
|
125
129
|
LuauPlugin.LuauReset(Context);
|
|
126
130
|
if (_luauModulesFolder != null) {
|
|
127
131
|
Object.Destroy(_luauModulesFolder);
|
|
@@ -180,6 +180,15 @@ namespace Luau {
|
|
|
180
180
|
s_cleanUpKeys.Add(instanceId);
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
+
public static void DeleteObjectReferencesList(ReadOnlySpan<int> instanceIds) {
|
|
184
|
+
foreach (var instanceId in instanceIds) {
|
|
185
|
+
if (s_objectKeys.TryGetValue(instanceId, out var obj)) {
|
|
186
|
+
s_reverseObjectKeys.Remove(obj);
|
|
187
|
+
}
|
|
188
|
+
s_objectKeys.Remove(instanceId);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
183
192
|
public static Luau.CallbackWrapper RegisterCallback(LuauContext context, IntPtr thread, int handle, string methodName, bool validateContext) {
|
|
184
193
|
ThreadData threadData = GetOrCreateThreadData(context, thread, "RegisterCallback");
|
|
185
194
|
|
|
@@ -114,6 +114,17 @@ public static class Bridge {
|
|
|
114
114
|
return AudioListener.volume;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
public static void SetDefaultAudioSourceValues(AudioSource source) {
|
|
118
|
+
source.volume = 1.0f;
|
|
119
|
+
source.loop = false;
|
|
120
|
+
source.pitch = 1.0f;
|
|
121
|
+
source.panStereo = 0.0f;
|
|
122
|
+
source.minDistance = 1.0f;
|
|
123
|
+
source.maxDistance = 500.0f;
|
|
124
|
+
source.rolloffMode = AudioRolloffMode.Logarithmic;
|
|
125
|
+
source.dopplerLevel = 0.0f;
|
|
126
|
+
}
|
|
127
|
+
|
|
117
128
|
public static void SetFullScreen(bool value) {
|
|
118
129
|
Screen.fullScreen = value;
|
|
119
130
|
}
|
|
@@ -4,7 +4,7 @@ using UnityEngine;
|
|
|
4
4
|
|
|
5
5
|
namespace Code.Network.Simulation
|
|
6
6
|
{
|
|
7
|
-
struct
|
|
7
|
+
struct PositionSnapshot
|
|
8
8
|
{
|
|
9
9
|
public Vector3 position;
|
|
10
10
|
public Quaternion rotation;
|
|
@@ -23,11 +23,12 @@ namespace Code.Network.Simulation
|
|
|
23
23
|
[Range(-1, 1)]
|
|
24
24
|
public float bufferAdjustment = 0;
|
|
25
25
|
|
|
26
|
-
private History<
|
|
26
|
+
private History<PositionSnapshot> history;
|
|
27
|
+
private Rigidbody rb;
|
|
27
28
|
|
|
28
|
-
private void Start()
|
|
29
|
-
|
|
30
|
-
history = new History<
|
|
29
|
+
private void Start() {
|
|
30
|
+
rb = GetComponent<Rigidbody>();
|
|
31
|
+
history = new History<PositionSnapshot>(1);
|
|
31
32
|
AirshipSimulationManager.Instance.OnCaptureSnapshot += this.CaptureSnapshot;
|
|
32
33
|
AirshipSimulationManager.Instance.OnSetSnapshot += this.SetSnapshot;
|
|
33
34
|
AirshipSimulationManager.Instance.OnLagCompensationCheck += this.LagCompensationCheck;
|
|
@@ -51,20 +52,31 @@ namespace Code.Network.Simulation
|
|
|
51
52
|
this.transform.rotation = state.rotation;
|
|
52
53
|
return;
|
|
53
54
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
|
|
56
|
+
var snapshot = rb != null
|
|
57
|
+
? new PositionSnapshot() {
|
|
58
|
+
position = this.rb.position,
|
|
59
|
+
rotation = this.rb.rotation
|
|
60
|
+
}
|
|
61
|
+
: new PositionSnapshot() {
|
|
62
|
+
position = this.transform.position,
|
|
63
|
+
rotation = this.transform.rotation
|
|
64
|
+
};
|
|
65
|
+
this.history.Add(tick, snapshot);
|
|
60
66
|
}
|
|
61
67
|
|
|
62
68
|
private void SetSnapshot(object objTick)
|
|
63
69
|
{
|
|
64
70
|
if (objTick is int tick) {
|
|
65
71
|
var snapshot = this.history.Get(tick);
|
|
66
|
-
this.
|
|
67
|
-
|
|
72
|
+
if (this.rb != null) {
|
|
73
|
+
this.rb.position = snapshot.position;
|
|
74
|
+
this.rb.rotation = snapshot.rotation;
|
|
75
|
+
} else {
|
|
76
|
+
this.transform.position = snapshot.position;
|
|
77
|
+
this.transform.rotation = snapshot.rotation;
|
|
78
|
+
}
|
|
79
|
+
|
|
68
80
|
}
|
|
69
81
|
}
|
|
70
82
|
|
|
@@ -221,7 +221,6 @@ namespace Code.Network.Simulation
|
|
|
221
221
|
processedLagCompensation = true;
|
|
222
222
|
// Debug.LogWarning("Server lag compensation rolling back for client " + entry.Key.connectionId);
|
|
223
223
|
OnLagCompensationCheck?.Invoke(entry.Key.connectionId, tick, time, entry.Key.rtt / 2f, entry.Key.bufferTime);
|
|
224
|
-
Physics.SyncTransforms();
|
|
225
224
|
foreach (var request in entry.Value)
|
|
226
225
|
{
|
|
227
226
|
request.check();
|
|
@@ -239,7 +238,6 @@ namespace Code.Network.Simulation
|
|
|
239
238
|
// Debug.LogWarning("Server completed " + this.lagCompensationRequests.Count + " lag compensation requests. Resetting to current tick (" + time + ") and finalizing.");
|
|
240
239
|
// Reset back to the server view of the world at the current time.
|
|
241
240
|
OnSetSnapshot?.Invoke(tick);
|
|
242
|
-
Physics.SyncTransforms();
|
|
243
241
|
// Invoke all of the callbacks for modifying physics that should be applied in the next tick.
|
|
244
242
|
foreach (var entry in this.lagCompensationRequests)
|
|
245
243
|
{
|
|
@@ -411,7 +409,6 @@ namespace Code.Network.Simulation
|
|
|
411
409
|
{
|
|
412
410
|
OnSetPaused?.Invoke(true);
|
|
413
411
|
OnSetSnapshot?.Invoke(targetTick);
|
|
414
|
-
Physics.SyncTransforms();
|
|
415
412
|
// Advance the tick so that we are re-processing the next tick after the base time provided.
|
|
416
413
|
targetTick++;
|
|
417
414
|
// index of the tick in the previousTicks list, we use this to access the associated time.
|
|
@@ -1022,7 +1022,6 @@ namespace Code.Network.StateSystem
|
|
|
1022
1022
|
// Since we now know where we should be authoritatively, set the current state. Since this isn't a prediction,
|
|
1023
1023
|
// we don't add it to the stateHistory.
|
|
1024
1024
|
this.stateSystem.SetCurrentState(state);
|
|
1025
|
-
Physics.SyncTransforms();
|
|
1026
1025
|
return;
|
|
1027
1026
|
}
|
|
1028
1027
|
|