-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdiff.txt
More file actions
4003 lines (3948 loc) · 303 KB
/
diff.txt
File metadata and controls
4003 lines (3948 loc) · 303 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
diff --git a/Assembly-CSharp-Editor.csproj b/Assembly-CSharp-Editor.csproj
index 8d51fc38..d3110c91 100644
--- a/Assembly-CSharp-Editor.csproj
+++ b/Assembly-CSharp-Editor.csproj
@@ -60,8 +60,11 @@
<Analyzer Include="D:\projects\unity\gonet-git\Assets\GONet\Code\Plugins\MemoryPack\Runtime\MemoryPack.Generator\MemoryPack.Generator.Roslyn3.dll" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="Assets\GONet\Code\GONet\Editor\UnitTests\GONet\GONetEventBusHolisticTests.cs" />
+ <Compile Include="Assets\GONet\Code\GONet\Editor\UnitTests\GONet\Utils\DualStackConnectionTests.cs" />
<Compile Include="Assets\GONet\Code\GONet\Editor\UnitTests\GONet\MemoryPack\MemoryPackTests.cs" />
<Compile Include="Assets\GONet\Code\GONet\Editor\Generation\BobWad_GeneratedTemplate.cs" />
+ <Compile Include="Assets\GONet\Code\GONet\Editor\UnitTests\GONet\Utils\NetworkUtilsTests.cs" />
<Compile Include="Assets\GONet\Code\GONet\Editor\UnitTests\GONet\Utils\ValueBlendUtilsTests.cs" />
<Compile Include="Assets\GONet\Code\GONet\Editor\Generation\BobWad_GeneratedTemplate_Code.cs" />
<Compile Include="Assets\GONet\Code\GONet\Editor\UnitTests\GONet\GONetEventBusTests.cs" />
@@ -365,6 +368,9 @@
<Reference Include="UnityEditor.LinuxStandalone.Extensions">
<HintPath>C:\Program Files\Unity\Hub\Editor\2022.3.12f1\Editor\Data\PlaybackEngines\LinuxStandaloneSupport\UnityEditor.LinuxStandalone.Extensions.dll</HintPath>
</Reference>
+ <Reference Include="nunit.framework">
+ <HintPath>Library\PackageCache\com.unity.ext.nunit@2.0.3\net40\unity-custom\nunit.framework.dll</HintPath>
+ </Reference>
<Reference Include="Unity.Analytics.Tracker">
<HintPath>Library\PackageCache\com.unity.analytics@3.8.1\Unity.Analytics.Tracker.dll</HintPath>
</Reference>
@@ -404,9 +410,6 @@
<Reference Include="log4netPlastic">
<HintPath>Library\PackageCache\com.unity.collab-proxy@2.2.0\Lib\Editor\PlasticSCM\log4netPlastic.dll</HintPath>
</Reference>
- <Reference Include="nunit.framework">
- <HintPath>Library\PackageCache\com.unity.ext.nunit@1.0.6\net35\unity-custom\nunit.framework.dll</HintPath>
- </Reference>
<Reference Include="UnityEditor.iOS.Extensions.Xcode">
<HintPath>C:\Program Files\Unity\Hub\Editor\2022.3.12f1\Editor\Data\PlaybackEngines\AppleTVSupport\UnityEditor.iOS.Extensions.Xcode.dll</HintPath>
</Reference>
diff --git a/Assembly-CSharp.csproj b/Assembly-CSharp.csproj
index 4b8addbb..ba8d1567 100644
--- a/Assembly-CSharp.csproj
+++ b/Assembly-CSharp.csproj
@@ -459,6 +459,9 @@
<Reference Include="UnityEditor.UnityConnectModule">
<HintPath>C:\Program Files\Unity\Hub\Editor\2022.3.12f1\Editor\Data\Managed\UnityEngine\UnityEditor.UnityConnectModule.dll</HintPath>
</Reference>
+ <Reference Include="nunit.framework">
+ <HintPath>Library\PackageCache\com.unity.ext.nunit@2.0.3\net40\unity-custom\nunit.framework.dll</HintPath>
+ </Reference>
<Reference Include="Unity.Analytics.Tracker">
<HintPath>Library\PackageCache\com.unity.analytics@3.8.1\Unity.Analytics.Tracker.dll</HintPath>
</Reference>
diff --git a/Assets/GONet/Code/GONet/Core/Utils/HighResolutionTimeUtils.cs b/Assets/GONet/Code/GONet/Core/Utils/HighResolutionTimeUtils.cs
index 12890723..7ac91fb8 100644
--- a/Assets/GONet/Code/GONet/Core/Utils/HighResolutionTimeUtils.cs
+++ b/Assets/GONet/Code/GONet/Core/Utils/HighResolutionTimeUtils.cs
@@ -20,109 +20,77 @@ using System.Runtime.CompilerServices;
namespace GONet.Utils
{
/// <summary>
- /// It is known the precision of <see cref="DateTime.Now"/> and <see cref="DateTime.UtcNow"/> is low (@ ~15ms),
- /// which is not acceptable in many cases (especially in games).
- /// Use this class when high precision timing matters.
+ /// Provides high-resolution timing utilities with precision exceeding <see cref="DateTime"/> (~15ms).
/// </summary>
public static class HighResolutionTimeUtils
{
- private static bool hasResyncd = false;
- private static DateTime lastResyncTime;
- private static DateTime lastResyncTimeUtc;
- private static Stopwatch highResolutionStopwatch;
- private static long lastResyncDiffTicks;
+ private static readonly Stopwatch stopwatch = Stopwatch.StartNew();
+ private static DateTime lastResyncTime = DateTime.Now;
+ private static DateTime lastResyncTimeUtc = DateTime.UtcNow;
+ private static long lastResyncDiffTicks = 0;
+ private static TimeSpan autoResyncInterval = TimeSpan.FromSeconds(10);
+ private static readonly object syncLock = new object();
+ private static int resyncCount = 0;
/// <summary>
- /// Since it appears that Stopwatch does get out of sync with the system time (by as much as half a second per hour),
- /// it makes sense to reset the hybrid DateTime class based on the amount of time that passes between calls to check
- /// the time (via a call to <see cref="Resync"/>).
+ /// Gets or sets the interval after which a resync with system time occurs.
/// </summary>
- private static readonly long AUTO_RESYNC_AFTER_TICKS = TimeSpan.FromSeconds(10).Ticks;
- private static readonly float AUTO_RESYNC_AFTER_TICKS_FLOAT = (float)AUTO_RESYNC_AFTER_TICKS;
-
- private static readonly object resync = new object();
- private static volatile int resyncCounter = 0;
-
- static HighResolutionTimeUtils()
+ /// <exception cref="ArgumentException">Thrown if set to a non-positive value.</exception>
+ public static TimeSpan AutoResyncInterval
{
- lastResyncDiffTicks = 0;
- Resync();
+ get => autoResyncInterval;
+ set => autoResyncInterval = value > TimeSpan.Zero ? value : throw new ArgumentException("Interval must be positive.", nameof(value));
}
- public static DateTime UtcNow
- {
- get
- {
- if (highResolutionStopwatch.Elapsed.Ticks > AUTO_RESYNC_AFTER_TICKS)
- {
- Resync();
- }
+ /// <summary>
+ /// Gets the number of resyncs performed since initialization.
+ /// </summary>
+ public static int ResyncCount => resyncCount;
- long addTicks = GetHighResolutionTicksToAddToResyncBaseline();
+ /// <summary>
+ /// Gets the last difference in ticks between resyncs, indicating drift.
+ /// </summary>
+ public static long LastResyncDiffTicks => lastResyncDiffTicks;
- return lastResyncTimeUtc.AddTicks(addTicks);
- }
- }
+ /// <summary>
+ /// Gets the current UTC time with high-resolution adjustments.
+ /// </summary>
+ public static DateTime UtcNow => GetTime(lastResyncTimeUtc);
- public static DateTime Now
- {
- get
- {
- if (highResolutionStopwatch.Elapsed.Ticks > AUTO_RESYNC_AFTER_TICKS)
- {
- Resync();
- }
+ /// <summary>
+ /// Gets the current local time with high-resolution adjustments.
+ /// </summary>
+ public static DateTime Now => GetTime(lastResyncTime);
- long addTicks = GetHighResolutionTicksToAddToResyncBaseline();
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ private static DateTime GetTime(DateTime baseTime)
+ {
+ if (stopwatch.Elapsed > autoResyncInterval)
+ Resync();
- return lastResyncTime.AddTicks(addTicks);
- }
+ long ticksToAdd = AdjustTicks(stopwatch.Elapsed.Ticks);
+ return baseTime.AddTicks(ticksToAdd);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
- private static long GetHighResolutionTicksToAddToResyncBaseline()
+ private static long AdjustTicks(long elapsedTicks)
{
- long addTicks = highResolutionStopwatch.Elapsed.Ticks;
-
- if (lastResyncDiffTicks != 0)
- { // IMPORTANT: This code eases the adjustment (i.e., diff) back to resync time over the entire period between resyncs to avoid a possibly dramatic jump in time just after a resync!
- float inverseLerpBetweenResyncs = addTicks / AUTO_RESYNC_AFTER_TICKS_FLOAT;
- if (inverseLerpBetweenResyncs < 1f) // if 1 or greater there will be nothing to add based on calculations
- {
- addTicks -= (long)(lastResyncDiffTicks * (1f - inverseLerpBetweenResyncs));
- }
- }
-
- return addTicks;
+ if (lastResyncDiffTicks == 0) return elapsedTicks;
+ float progress = elapsedTicks / (float)autoResyncInterval.Ticks;
+ return progress >= 1f ? elapsedTicks : elapsedTicks - (long)(lastResyncDiffTicks * (1f - progress));
}
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
private static void Resync()
{
- int resyncCounter_PRE = resyncCounter;
- lock (resync)
+ lock (syncLock)
{
- if (resyncCounter == resyncCounter_PRE) // this would be false is another thread was also trying to do this at the same time!
- {
- ++resyncCounter;
-
- DateTime now = DateTime.Now;
- long nowTicksBeforeResync = hasResyncd ? lastResyncTime.Ticks + highResolutionStopwatch.Elapsed.Ticks : now.Ticks;
-
- ///////////////////////////////////////////////////////////////////////////////////////
- // RE-Sync:
- lastResyncTime = now;
- lastResyncTimeUtc = DateTime.UtcNow;
- highResolutionStopwatch = Stopwatch.StartNew();
- ///////////////////////////////////////////////////////////////////////////////////////
-
- long nowTicksAfterResync = lastResyncTime.Ticks;
- lastResyncDiffTicks = nowTicksAfterResync - nowTicksBeforeResync;
-
- //GONetLog.Debug("lastResyncDiffTicks (well, as ms): " + TimeSpan.FromTicks(lastResyncDiffTicks).TotalMilliseconds);
-
- hasResyncd = true;
- }
+ DateTime now = DateTime.Now;
+ long ticksBefore = lastResyncTime.Ticks + stopwatch.Elapsed.Ticks;
+ lastResyncTime = now;
+ lastResyncTimeUtc = DateTime.UtcNow;
+ stopwatch.Restart();
+ lastResyncDiffTicks = lastResyncTime.Ticks - ticksBefore;
+ resyncCount++;
}
}
}
diff --git a/Assets/GONet/Code/GONet/Core/Utils/LockFreeRingBuffer.cs b/Assets/GONet/Code/GONet/Core/Utils/LockFreeRingBuffer.cs
index 33352e24..cb971b95 100644
--- a/Assets/GONet/Code/GONet/Core/Utils/LockFreeRingBuffer.cs
+++ b/Assets/GONet/Code/GONet/Core/Utils/LockFreeRingBuffer.cs
@@ -1,79 +1,164 @@
-namespace GONet.Utils
+using System;
+using System.Runtime.CompilerServices; // Required for AggressiveInlining
+using System.Runtime.InteropServices; // Required for StructLayout/FieldOffset
+using System.Threading; // Required for volatile (though implicit via volatile keyword)
+
+namespace GONet.Utils // Assuming the original namespace
{
- public class LockFreeRingBuffer<T>
+ /// <summary>
+ /// A ring buffer optimized for single-producer, single-consumer (SPSC) scenarios.
+ /// It ensures the buffer capacity is a power of two to enable fast bitwise indexing
+ /// and includes padding to mitigate false sharing between read/write indices.
+ ///
+ /// IMPORTANT: This class is NOT thread-safe for multiple producers or multiple consumers
+ /// accessing it concurrently. It relies on volatile reads/writes for memory visibility
+ /// between ONE producer and ONE consumer thread.
+ /// </summary>
+ /// <typeparam name="T">The type of items stored in the buffer.</typeparam>
+ public class RingBuffer<T>
{
- private readonly T[] buffer;
- private int writeIndex = 0;
- private int readIndex = 0;
+ private readonly T[] _buffer;
+ private readonly int _mask; // Used for fast bitwise indexing (Capacity - 1)
- public LockFreeRingBuffer(int size)
+ // Struct to hold the index and padding to ensure cache line separation
+ // Cache lines are typically 64 bytes.
+ [StructLayout(LayoutKind.Explicit, Size = 64)]
+ private struct PaddedIndex
{
- buffer = new T[size];
+ [FieldOffset(0)]
+ public volatile int Value;
}
- public bool TryWrite(T item)
- {
- int nextWriteIndex = (writeIndex + 1) % buffer.Length;
- if (nextWriteIndex == readIndex)
- {
- return false; // Buffer full
- }
- buffer[writeIndex] = item;
- writeIndex = nextWriteIndex;
- return true;
- }
+ // Indices are NOT readonly, allowing their .Value to be modified.
+ // Padding is handled by the struct layout.
+ private PaddedIndex _readIndex;
+ private PaddedIndex _writeIndex;
- public bool TryRead(out T item)
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="RingBuffer{T}"/> class.
+ /// The actual capacity will be the smallest power of two that is greater than or equal to the requested size.
+ /// </summary>
+ /// <param name="requestedSize">The desired minimum capacity of the ring buffer. Must be positive.</param>
+ /// <exception cref="ArgumentException">Thrown if requestedSize is not positive.</exception>
+ public RingBuffer(int requestedSize)
{
- if (writeIndex == readIndex)
+ if (requestedSize <= 0)
{
- item = default;
- return false; // Buffer empty
+ throw new ArgumentException("Requested size must be positive.", nameof(requestedSize));
}
- item = buffer[readIndex];
- readIndex = (readIndex + 1) % buffer.Length;
- return true;
+
+ // Ensure capacity is a power of two for fast bitwise & masking
+ int capacity = CeilingPowerOfTwo(requestedSize);
+
+ _buffer = new T[capacity];
+ _mask = capacity - 1; // Mask for bitwise AND, works only for power-of-two sizes
+
+ // Initialize indices (Value is volatile)
+ _readIndex = new PaddedIndex { Value = 0 };
+ _writeIndex = new PaddedIndex { Value = 0 };
}
- }
- public class SingleProducerRingBuffer<T>
- {
- private readonly T[] buffer;
- private int writeIndex = 0;
- private int readIndex = 0;
+ /// <summary>
+ /// Gets the actual capacity of the ring buffer (which is a power of two).
+ /// </summary>
+ public int Capacity => _buffer.Length;
- public SingleProducerRingBuffer(int size)
+ /// <summary>
+ /// Gets the current number of items in the ring buffer.
+ /// This property involves volatile reads and is suitable for diagnostics or
+ /// scenarios where an approximate count is sufficient when read by the opposing thread.
+ /// </summary>
+ public int Count
{
- buffer = new T[size];
+ get
+ {
+ // Reading volatile fields establishes memory barriers, ensuring we see up-to-date values
+ // relative to other volatile reads/writes on other threads.
+ int writeIdx = _writeIndex.Value;
+ int readIdx = _readIndex.Value;
+
+ // Calculation handles wrap-around
+ return writeIdx >= readIdx ? writeIdx - readIdx : Capacity - readIdx + writeIdx;
+ }
}
+ /// <summary>
+ /// Attempts to write an item to the buffer. To be called only by the producer thread.
+ /// </summary>
+ /// <param name="item">The item to write.</param>
+ /// <returns>True if the item was successfully written, false if the buffer is full.</returns>
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool TryWrite(T item)
{
- int nextWriteIndex = (writeIndex + 1) % buffer.Length;
- if (nextWriteIndex == readIndex)
+ int currentWriteIndex = _writeIndex.Value;
+ // Calculate the next index using bitwise AND (faster than modulo for power-of-two sizes)
+ int nextWriteIndex = (currentWriteIndex + 1) & _mask;
+
+ // Check if buffer is full (next write position would be current read position)
+ // Volatile read of _readIndex ensures we see the latest value from the consumer
+ if (nextWriteIndex == _readIndex.Value)
{
- // Buffer is full
- return false;
+ return false; // Buffer full
}
- // Only the single producer can modify the write index, so no need for locks here
- buffer[writeIndex] = item;
- writeIndex = nextWriteIndex;
+ // Place item in buffer *before* updating the index
+ _buffer[currentWriteIndex] = item;
+
+ // Update write index with a volatile write (ensures visibility to consumer)
+ _writeIndex.Value = nextWriteIndex;
+
return true;
}
+ /// <summary>
+ /// Attempts to read an item from the buffer. To be called only by the consumer thread.
+ /// </summary>
+ /// <param name="item">When this method returns, contains the item read from the buffer,
+ /// or the default value of T if the buffer was empty.</param>
+ /// <returns>True if an item was successfully read, false if the buffer is empty.</returns>
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool TryRead(out T item)
{
- if (writeIndex == readIndex)
+ int currentReadIndex = _readIndex.Value;
+
+ // Check if buffer is empty (read position matches write position)
+ // Volatile read of _writeIndex ensures we see the latest value from the producer
+ if (currentReadIndex == _writeIndex.Value)
{
item = default;
return false; // Buffer empty
}
- item = buffer[readIndex];
- readIndex = (readIndex + 1) % buffer.Length;
+ // Retrieve item *before* updating the index
+ item = _buffer[currentReadIndex];
+
+ // Calculate the next index using bitwise AND
+ int nextReadIndex = (currentReadIndex + 1) & _mask;
+
+ // Update read index with a volatile write (ensures visibility to producer)
+ _readIndex.Value = nextReadIndex;
+
return true;
}
- }
-}
+ /// <summary>
+ /// Calculates the smallest power of two integer that is greater than or equal to v.
+ /// </summary>
+ /// <param name="v">The input integer.</param>
+ /// <returns>The smallest power of two greater than or equal to v.</returns>
+ private static int CeilingPowerOfTwo(int v)
+ {
+ if (v <= 0) return 1; // Handle edge case
+
+ v--;
+ v |= v >> 1;
+ v |= v >> 2;
+ v |= v >> 4;
+ v |= v >> 8;
+ v |= v >> 16;
+ v++;
+ return v;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/GONet/Code/GONet/Core/Utils/NetworkUtils.cs b/Assets/GONet/Code/GONet/Core/Utils/NetworkUtils.cs
index 9dd7b6cc..2f84e20a 100644
--- a/Assets/GONet/Code/GONet/Core/Utils/NetworkUtils.cs
+++ b/Assets/GONet/Code/GONet/Core/Utils/NetworkUtils.cs
@@ -113,5 +113,83 @@ namespace GONet.Utils
$" - Address: {endpoint}";
}
}
+
+ public static bool AreSameAddressFamilyOrMapped(IPAddress a, IPAddress b) =>
+ a.Equals(b) ||
+ (a.AddressFamily != b.AddressFamily &&
+ (a.MapToIPv4().Equals(b) || a.MapToIPv6().Equals(b)));
+
+ /// <summary>
+ /// Returns <c>true</c> when the two <see cref="EndPoint"/>s refer to the same
+ /// IP *and* both ports match, treating IPv4‑mapped IPv6 addresses
+ /// (<c>::ffff:x.x.x.x</c>) as equivalent to their raw‑IPv4 form.
+ /// <para/>
+ /// If either <see cref="EndPoint"/> is not an <see cref="IPEndPoint"/>,
+ /// the method returns <c>false</c>.
+ /// </summary>
+ public static bool AreSameAddressFamilyOrMapped(EndPoint aEP, EndPoint bEP)
+ {
+ // must be IPEndPoint instances
+ if (aEP is not IPEndPoint a || bEP is not IPEndPoint b)
+ return false;
+
+ // ports must match first
+ if (a.Port != b.Port)
+ return false;
+
+ // identical addresses → early‑out
+ if (a.Address.Equals(b.Address))
+ return true;
+
+ // cross‑family: treat v4‑mapped‑v6 as the same host
+ if (a.AddressFamily != b.AddressFamily)
+ {
+ if (a.AddressFamily == AddressFamily.InterNetworkV6 && a.Address.IsIPv4MappedToIPv6 &&
+ a.Address.MapToIPv4().Equals(b.Address))
+ return true;
+
+ if (b.AddressFamily == AddressFamily.InterNetworkV6 && b.Address.IsIPv4MappedToIPv6 &&
+ b.Address.MapToIPv4().Equals(a.Address))
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool DoEndpointsMatch(IPEndPoint listen4, IPEndPoint listen6, IPEndPoint tokenEP)
+ {
+ // 1. Port must match exactly
+ if (tokenEP.Port != listen4.Port && tokenEP.Port != listen6.Port)
+ {
+ return false;
+ }
+
+ // 2. wildcard bind → accept any address
+ if (listen4.Address.Equals(IPAddress.Any) || listen4.Address.Equals(IPAddress.IPv6Any) ||
+ listen6.Address.Equals(IPAddress.Any) || listen6.Address.Equals(IPAddress.IPv6Any))
+ {
+ return true; // port already matched above
+ }
+
+ // 3. Compare addresses with v4‑mapped equivalence
+ bool addrMatches =
+ AreSameAddressFamilyOrMapped(tokenEP.Address, listen4.Address) ||
+ AreSameAddressFamilyOrMapped(tokenEP.Address, listen6.Address);
+
+ return addrMatches;
+ }
+
+ public static bool AreSameIP(IPAddress a, IPAddress b)
+ {
+ if (a.Equals(b)) return true;
+
+ // treat v4‑mapped‑v6 as equal to raw v4
+ if (a.AddressFamily != b.AddressFamily)
+ {
+ if (a.IsIPv4MappedToIPv6 && a.MapToIPv4().Equals(b)) return true;
+ if (b.IsIPv4MappedToIPv6 && b.MapToIPv4().Equals(a)) return true;
+ }
+ return false;
+ }
}
}
diff --git a/Assets/GONet/Code/GONet/Core/Utils/TypeUtils.cs b/Assets/GONet/Code/GONet/Core/Utils/TypeUtils.cs
index 011885c0..c27e4a68 100644
--- a/Assets/GONet/Code/GONet/Core/Utils/TypeUtils.cs
+++ b/Assets/GONet/Code/GONet/Core/Utils/TypeUtils.cs
@@ -20,6 +20,7 @@ using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Threading;
+using UnityEngine;
namespace GONet.Utils
{
@@ -258,11 +259,24 @@ namespace GONet.Utils
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
{
- foreach (var type in assembly.GetTypes())
+ try
{
- if (IsTypeAInstanceOfTypeB(type, typeof(T)) && (!type.IsAbstract || !isConcreteClassRequired))
+ foreach (var type in assembly.GetTypes())
{
- uniqueSyncEventTypes.Add(type);
+ if (IsTypeAInstanceOfTypeB(type, typeof(T)) && (!type.IsAbstract || !isConcreteClassRequired))
+ {
+ uniqueSyncEventTypes.Add(type);
+ }
+ }
+ }
+ catch (ReflectionTypeLoadException ex)
+ {
+ foreach (var type in ex.Types) // ex.Types are the ones that successfully loaded
+ {
+ if (IsTypeAInstanceOfTypeB(type, typeof(T)) && (!type.IsAbstract || !isConcreteClassRequired))
+ {
+ uniqueSyncEventTypes.Add(type);
+ }
}
}
}
diff --git a/Assets/GONet/Code/GONet/Editor/Generation/GONetMostRecentSuccessfulBuild.json b/Assets/GONet/Code/GONet/Editor/Generation/GONetMostRecentSuccessfulBuild.json
index afffa5ea..dc4ea520 100644
--- a/Assets/GONet/Code/GONet/Editor/Generation/GONetMostRecentSuccessfulBuild.json
+++ b/Assets/GONet/Code/GONet/Editor/Generation/GONetMostRecentSuccessfulBuild.json
@@ -1 +1 @@
-{"ScenePathsIncluded":["Assets/GONet/Sample/Projectile/ProjectileTest.unity","Assets/GONet/Sample/JustAnotherScene.unity"],"dateTimeBuildSucceeded":"2024-12-01T16:29:01.2307682-05:00"}
\ No newline at end of file
+{"ScenePathsIncluded":["Assets/GONet/Sample/Projectile/ProjectileTest.unity","Assets/GONet/Sample/JustAnotherScene.unity"],"dateTimeBuildSucceeded":"2025-04-19T16:27:25.4276977-04:00"}
\ No newline at end of file
diff --git a/Assets/GONet/Code/GONet/Editor/Generation/GONetParticipant_AutoMagicalSyncCompanion_Generated_Generator.cs b/Assets/GONet/Code/GONet/Editor/Generation/GONetParticipant_AutoMagicalSyncCompanion_Generated_Generator.cs
index db14fad7..5e3d0190 100644
--- a/Assets/GONet/Code/GONet/Editor/Generation/GONetParticipant_AutoMagicalSyncCompanion_Generated_Generator.cs
+++ b/Assets/GONet/Code/GONet/Editor/Generation/GONetParticipant_AutoMagicalSyncCompanion_Generated_Generator.cs
@@ -18,6 +18,8 @@ using GONet.Editor;
using GONet.PluginAPI;
using GONet.Utils;
using MemoryPack;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Serialization;
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -25,8 +27,6 @@ using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading;
-using Unity.Plastic.Newtonsoft.Json;
-using Unity.Plastic.Newtonsoft.Json.Serialization;
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
diff --git a/Assets/GONet/Code/GONet/Main/GONet.cs b/Assets/GONet/Code/GONet/Main/GONet.cs
index 47294fb1..f0d9f421 100644
--- a/Assets/GONet/Code/GONet/Main/GONet.cs
+++ b/Assets/GONet/Code/GONet/Main/GONet.cs
@@ -439,7 +439,7 @@ namespace GONet
/// <summary>
/// The keys are only added from main unity thread...the value queues are only added to on the other thread (i.e., transfer data from <see cref="events_AwaitingSendToOthersQueue_ByThreadMap"/> once the time is right) but also read from and dequeued from the main unity thread when time to publish the events!
/// </summary>
- static readonly Dictionary<Thread, LockFreeRingBuffer<IGONetEvent>> events_SendToOthersQueue_ByThreadMap = new Dictionary<Thread, LockFreeRingBuffer<IGONetEvent>>(12);
+ static readonly Dictionary<Thread, RingBuffer<IGONetEvent>> events_SendToOthersQueue_ByThreadMap = new Dictionary<Thread, RingBuffer<IGONetEvent>>(12);
/// <summary>
/// The keys are only added from main unity thread...the value queues are only added to on the other thread (i.e., transfer data from <see cref="events_AwaitingSendToOthersQueue_ByThreadMap"/> once the time is right) but also read from and dequeued from the main unity thread when time to publish the events!
@@ -1692,7 +1692,7 @@ namespace GONet
private static void PublishEvents_SentToOthers()
{
- LockFreeRingBuffer<IGONetEvent> eventQueue = events_SendToOthersQueue_ByThreadMap[Thread.CurrentThread];
+ RingBuffer<IGONetEvent> eventQueue = events_SendToOthersQueue_ByThreadMap[Thread.CurrentThread];
IGONetEvent @event;
while (eventQueue.TryRead(out @event))
@@ -3523,7 +3523,7 @@ namespace GONet
thread.IsBackground = true; // do not prevent process from exiting when foreground thread(s) end
events_AwaitingSendToOthersQueue_ByThreadMap[thread] = new Queue<IGONetEvent>(100); // we're on main thread, safe to deal with regular dict here
- events_SendToOthersQueue_ByThreadMap[thread] = new LockFreeRingBuffer<IGONetEvent>(1024); // we're on main thread, safe to deal with regular dict here
+ events_SendToOthersQueue_ByThreadMap[thread] = new RingBuffer<IGONetEvent>(1024); // we're on main thread, safe to deal with regular dict here
isThreadRunning = true;
thread.Start();
@@ -3535,7 +3535,7 @@ namespace GONet
if (!events_AwaitingSendToOthersQueue_ByThreadMap.ContainsKey(Thread.CurrentThread))
{
events_AwaitingSendToOthersQueue_ByThreadMap[Thread.CurrentThread] = new Queue<IGONetEvent>(100); // we're on main thread, safe to deal with regular dict here
- events_SendToOthersQueue_ByThreadMap[Thread.CurrentThread] = new LockFreeRingBuffer<IGONetEvent>(1024); // we're on main thread, safe to deal with regular dict here
+ events_SendToOthersQueue_ByThreadMap[Thread.CurrentThread] = new RingBuffer<IGONetEvent>(1024); // we're on main thread, safe to deal with regular dict here
}
}
@@ -3803,7 +3803,7 @@ namespace GONet
private void PublishEvents_SyncValueChangesSentToOthers_ASAP()
{
Queue<IGONetEvent> queueAwaiting = events_AwaitingSendToOthersQueue_ByThreadMap[Thread.CurrentThread];
- LockFreeRingBuffer<IGONetEvent> queueSend = events_SendToOthersQueue_ByThreadMap[Thread.CurrentThread];
+ RingBuffer<IGONetEvent> queueSend = events_SendToOthersQueue_ByThreadMap[Thread.CurrentThread];
while (queueAwaiting.Count > 0)
{
var @event = queueAwaiting.Dequeue();
diff --git a/Assets/GONet/Code/GONet/Main/GONetClient.cs b/Assets/GONet/Code/GONet/Main/GONetClient.cs
index d962c2f1..dee45f34 100644
--- a/Assets/GONet/Code/GONet/Main/GONetClient.cs
+++ b/Assets/GONet/Code/GONet/Main/GONetClient.cs
@@ -111,9 +111,9 @@ namespace GONet
private readonly Client client;
- public GONetClient(Client client)
+ public GONetClient()
{
- this.client = client;
+ this.client = new();
connectionToServer = new GONetConnection_ClientToServer(client);
diff --git a/Assets/GONet/Code/GONet/Main/GONetConnections.cs b/Assets/GONet/Code/GONet/Main/GONetConnections.cs
index 889f5f4a..3414a9e6 100644
--- a/Assets/GONet/Code/GONet/Main/GONetConnections.cs
+++ b/Assets/GONet/Code/GONet/Main/GONetConnections.cs
@@ -18,7 +18,9 @@ using NetcodeIO.NET;
using ReliableNetcode;
using System;
using System.Collections.Generic;
+using System.Linq;
using System.Net;
+using System.Net.Sockets;
using GONetChannelId = System.Byte;
namespace GONet
@@ -229,7 +231,7 @@ namespace GONet
/// 1) Prior to connection being established, this represents how many seconds the client will attempt to connect to the server before giving up and considering the connected timed out (i.e., <see cref="ClientState.ConnectionRequestTimedOut"/>). NOTE: During this time period, the connection will be attempted 10 times per second.
/// 2) After connection is established, this represents how many seconds have to transpire with no communication for this connection to be considered timed out...then will be auto-disconnected.
/// </param>
- public void Connect(string serverIP, int serverPort, int timeoutSeconds)
+ public async void Connect(string serverIP, int serverPort, int timeoutSeconds)
{
TokenFactory factory = new TokenFactory(GONetMain.noIdeaWhatThisShouldBe_CopiedFromTheirUnitTest, GONetMain._privateKey);
@@ -270,6 +272,12 @@ namespace GONet
// Here, we're creating an array of endpoints that includes both IPv4 and IPv6 loopback addresses if the serverIP is a loopback address.
List<IPEndPoint> endpoints = new List<IPEndPoint>();
+ IPAddress[] all = await Dns.GetHostAddressesAsync(serverIP);
+ endpoints.AddRange(
+ all.OrderBy(a => a.AddressFamily == AddressFamily.InterNetworkV6 ? 0 : 1) // v6 first
+ .Select(ip => new IPEndPoint(ip, serverPort)));
+
+ /*
if (NetworkUtils.IsIPAddressOnLocalMachine(serverIP))
{
// Add both loopback addresses to handle special case where server will compare various addresses for validation
@@ -281,6 +289,7 @@ namespace GONet
// If not a loopback, just add the parsed or resolved address
endpoints.Add(mostRecentConnectInfo);
}
+ */
byte[] connectToken = factory.GenerateConnectToken(
endpoints.ToArray(),
diff --git a/Assets/GONet/Code/GONet/Main/GONetServer.cs b/Assets/GONet/Code/GONet/Main/GONetServer.cs
index a348b48d..5720303f 100644
--- a/Assets/GONet/Code/GONet/Main/GONetServer.cs
+++ b/Assets/GONet/Code/GONet/Main/GONetServer.cs
@@ -51,11 +51,11 @@ namespace GONet
/// </summary>
public event ClientActionDelegate ClientDisconnected;
- public GONetServer(int maxClientCount, string address, int port)
+ public GONetServer(int maxClientCount, int port)
{
MaxClientCount = maxClientCount;
- server = new Server(maxClientCount, address, port, GONetMain.noIdeaWhatThisShouldBe_CopiedFromTheirUnitTest, GONetMain._privateKey);
+ server = new Server(maxClientCount, port, GONetMain.noIdeaWhatThisShouldBe_CopiedFromTheirUnitTest, GONetMain._privateKey);
remoteClients = new List<GONetRemoteClient>(maxClientCount);
@@ -66,16 +66,9 @@ namespace GONet
server.OnClientMessageReceived += OnClientMessageReceived;
server.TickBeginning += Server_TickBeginning_PossibleSeparateThread;
- if (NetworkUtils.IsIPAddressOnLocalMachine(address))
+ if (NetworkUtils.IsLocalPortListening(port))
{
- if (NetworkUtils.IsLocalPortListening(port))
- {
- GONetLog.Warning("Instantiated a server <instance> locally and the port is already occupied!!! Calling the <instance>.Start() method will likely fail and return false.");
- }
- }
- else
- {
- GONetLog.Warning("Instantiated a server <instance> locally and the address is not on this local machine!!! Calling the <instance>.Start() method will likely fail and return false.");
+ GONetLog.Warning("Instantiated a server <instance> locally and the port is already occupied!!! Calling the <instance>.Start() method will likely fail and return false.");
}
}
diff --git a/Assets/GONet/Code/Netcode.IO.NET/Core/EncryptionManager.cs b/Assets/GONet/Code/Netcode.IO.NET/Core/EncryptionManager.cs
index 20e297f5..eed2c96a 100644
--- a/Assets/GONet/Code/Netcode.IO.NET/Core/EncryptionManager.cs
+++ b/Assets/GONet/Code/Netcode.IO.NET/Core/EncryptionManager.cs
@@ -88,7 +88,7 @@ namespace NetcodeIO.NET
{
encryptionMapEntry encryptionMapping = encryptionMappings[i];
if (!encryptionMapping.IsReset
- && MiscUtils.AreEndPointsEqual(encryptionMapping.Address, address)
+ && GONet.Utils.NetworkUtils.AreSameAddressFamilyOrMapped(encryptionMapping.Address, address)
&& (
(encryptionMapping.TimeoutAfterSeconds > 0 && (encryptionMapping.LastAccessedAtSeconds + encryptionMapping.TimeoutAfterSeconds) >= currentSeconds)
|| (encryptionMapping.ExpiresAtSeconds > 0.0 && encryptionMapping.ExpiresAtSeconds < currentSeconds)
@@ -138,7 +138,7 @@ namespace NetcodeIO.NET
for (int i = 0; i < encyrptionMappings_totalCount; i++)
{
- if (!encryptionMappings[i].IsReset && MiscUtils.AreEndPointsEqual(encryptionMappings[i].Address, address))
+ if (!encryptionMappings[i].IsReset && GONet.Utils.NetworkUtils.AreSameAddressFamilyOrMapped(encryptionMappings[i].Address, address))
{
encryptionMappings[i].Reset();
@@ -213,7 +213,7 @@ namespace NetcodeIO.NET
if (index < 0 || index >= encyrptionMappings_usedCount)
throw new IndexOutOfRangeException(nameof(index));
- if (!MiscUtils.AreEndPointsEqual(encryptionMappings[index].Address, address))
+ if (!GONet.Utils.NetworkUtils.AreSameAddressFamilyOrMapped(encryptionMappings[index].Address, address))
return false;
encryptionMappings[index].LastAccessedAtSeconds = currentSeconds;
@@ -235,7 +235,7 @@ namespace NetcodeIO.NET
{
encryptionMapEntry encryptionMapping = encryptionMappings[i];
if (!encryptionMapping.IsReset &&
- MiscUtils.AreEndPointsEqual(encryptionMapping.Address, address) &&
+ GONet.Utils.NetworkUtils.AreSameAddressFamilyOrMapped(encryptionMapping.Address, address) &&
((encryptionMapping.LastAccessedAtSeconds + encryptionMapping.TimeoutAfterSeconds) >= currentSeconds || encryptionMapping.TimeoutAfterSeconds <= 0) &&
(encryptionMapping.ExpiresAtSeconds <= 0.0 || encryptionMapping.ExpiresAtSeconds >= currentSeconds))
{
diff --git a/Assets/GONet/Code/Netcode.IO.NET/Public/Client.cs b/Assets/GONet/Code/Netcode.IO.NET/Public/Client.cs
index a606a14c..c504c2b7 100644
--- a/Assets/GONet/Code/Netcode.IO.NET/Public/Client.cs
+++ b/Assets/GONet/Code/Netcode.IO.NET/Public/Client.cs
@@ -244,7 +244,7 @@ namespace NetcodeIO.NET
/// </summary>
public void Connect(byte[] connectToken)
{
- Connect(connectToken, true);
+ Connect(connectToken, autoTick: true);
}
internal void Connect(byte[] connectToken, bool autoTick)
@@ -446,7 +446,7 @@ namespace NetcodeIO.NET
private void processDatagram(Datagram datagram)
{
- if (!MiscUtils.AreEndPointsEqual(datagram.sender, currentServerEndpoint))
+ if (!GONet.Utils.NetworkUtils.AreSameAddressFamilyOrMapped(datagram.sender, currentServerEndpoint))
return;
using (var reader = ByteArrayReaderWriter.Get(datagram.payload))
diff --git a/Assets/GONet/Code/Netcode.IO.NET/Public/Server.cs b/Assets/GONet/Code/Netcode.IO.NET/Public/Server.cs
index 48a35a97..4b196e32 100644
--- a/Assets/GONet/Code/Netcode.IO.NET/Public/Server.cs
+++ b/Assets/GONet/Code/Netcode.IO.NET/Public/Server.cs
@@ -7,6 +7,7 @@ using System.Linq;
using NetcodeIO.NET.Utils;
using NetcodeIO.NET.Utils.IO;
using NetcodeIO.NET.Internal;
+using GONet.Utils;
namespace NetcodeIO.NET
{
@@ -196,7 +197,7 @@ namespace NetcodeIO.NET
#endregion
- public Server(int maxSlots, string address, int port, ulong protocolID, byte[] privateKey)
+ public Server(int maxSlots, int port, ulong protocolID, byte[] privateKey)
{
this.tickrate = 60;
@@ -208,18 +209,6 @@ namespace NetcodeIO.NET
this.clientSlots = new RemoteClient[maxSlots];
this.encryptionManager = new EncryptionManager(maxSlots);
- IPAddress ipAddress;
- try
- {
- // Try to parse as an IP address
- ipAddress = IPAddress.Parse(address);
- }
- catch (FormatException)
- {
- // If parsing fails, resolve the hostname
- ipAddress = Dns.GetHostAddresses(address).FirstOrDefault() ?? IPAddress.IPv6Any;
- }
-
this.listenEndpoint = new IPEndPoint(IPAddress.Any, port);
// Use IPv6Any to allow binding to both IPv4 and IPv6 if possible
this.listenEndpointV6 = new IPEndPoint(IPAddress.IPv6Any, port);
@@ -273,7 +262,7 @@ namespace NetcodeIO.NET
public void Start(int tickHertz)
{
Tickrate = tickHertz;
- Start(true);
+ Start(autoTick: true);
}
internal void Start(bool autoTick)
@@ -745,32 +734,7 @@ namespace NetcodeIO.NET
// TODO if not development, probably want to remove the loopback/local support for security reasons
ConnectTokenServerEntry[] clientServerList = privateConnectToken.ConnectServers;
bool doesClientServerListIncludeThis = clientServerList.Any(x =>
- // Check if the token's endpoint matches the IPv4 listen endpoint
- (this.listenEndpoint.AddressFamily == AddressFamily.InterNetwork &&
- x.Endpoint.Address.Equals(listenEndpoint.Address)) ||
-
- // Check if the token's endpoint matches the IPv6 listen endpoint
- (this.listenEndpointV6.AddressFamily == AddressFamily.InterNetworkV6 &&
- x.Endpoint.Address.Equals(listenEndpointV6.Address)) ||
-
- // General case for any IP address or hostname
- (x.Endpoint.Address.ToString() == this.listenEndpoint.Address.ToString() ||
- x.Endpoint.Address.ToString() == this.listenEndpointV6.Address.ToString()) ||
-
- // Special case for IPv6 loopback and any IPv4 address
- (this.listenEndpointV6.Address.Equals(IPAddress.IPv6Any) &&
- (x.Endpoint.Address.Equals(IPAddress.IPv6Loopback) ||
- x.Endpoint.AddressFamily == AddressFamily.InterNetwork)) ||
-
- // If the server is bound to IPv4 only, check for any IPv4
- (this.listenEndpoint.Address.Equals(IPAddress.Any) &&
- x.Endpoint.AddressFamily == AddressFamily.InterNetwork) ||
-
- // If the server is bound to IPv6 loopback, check for any IPv4 or IPv6
- (this.listenEndpointV6.Address.Equals(IPAddress.IPv6Loopback) &&
- (x.Endpoint.Address.Equals(IPAddress.IPv6Loopback) ||
- x.Endpoint.AddressFamily == AddressFamily.InterNetwork))
- );
+ NetworkUtils.DoEndpointsMatch(listenEndpoint, listenEndpointV6, x.Endpoint));
if (!doesClientServerListIncludeThis)
{
diff --git a/Assets/GONet/Sample/GONetSampleClientOrServer.cs b/Assets/GONet/Sample/GONetSampleClientOrServer.cs
index a6d88fce..b967aaba 100644
--- a/Assets/GONet/Sample/GONetSampleClientOrServer.cs
+++ b/Assets/GONet/Sample/GONetSampleClientOrServer.cs
@@ -198,12 +198,12 @@ public class GONetSampleClientOrServer : MonoBehaviour
{
if (isServer)
{
- GONetMain.gonetServer = new GONetServer(100, GONetGlobal.ServerIPAddress_Actual, GONetGlobal.ServerPort_Actual);
+ GONetMain.gonetServer = new GONetServer(100, GONetGlobal.ServerPort_Actual);
GONetMain.gonetServer.Start();
}
else
{
- GONetMain.GONetClient = new GONetClient(new Client());
+ GONetMain.GONetClient = new GONetClient();
GONetMain.GONetClient.ConnectToServer(GONetGlobal.ServerIPAddress_Actual, GONetGlobal.ServerPort_Actual, 30);
}
}
diff --git a/Packages/manifest.json b/Packages/manifest.json
index 039dd7fa..60f3788c 100644
--- a/Packages/manifest.json
+++ b/Packages/manifest.json
@@ -10,10 +10,10 @@
"com.unity.ide.visualstudio": "2.0.21",
"com.unity.ide.vscode": "1.2.5",
"com.unity.purchasing": "4.9.3",
- "com.unity.test-framework": "1.1.33",
+ "com.unity.test-framework": "1.4.6",
"com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.7.6",
- "com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.6",
+ "com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.10",
"com.unity.ugui": "1.0.0",
"com.unity.xr.legacyinputhelpers": "2.1.10",
"com.unity.modules.ai": "1.0.0",
diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json
index 4009f867..1201b58e 100644
--- a/Packages/packages-lock.json
+++ b/Packages/packages-lock.json
@@ -38,8 +38,8 @@
"depth": 0,
"source": "registry",
"dependencies": {
- "com.unity.services.analytics": "1.0.4",
- "com.unity.ugui": "1.0.0"
+ "com.unity.ugui": "1.0.0",
+ "com.unity.services.analytics": "1.0.4"
},
"url": "https://packages.unity.com"
},
@@ -57,7 +57,7 @@
"url": "https://packages.unity.com"
},
"com.unity.ext.nunit": {
- "version": "1.0.6",
+ "version": "2.0.3",
"depth": 1,
"source": "registry",
"dependencies": {},
@@ -101,11 +101,11 @@
"source": "registry",
"dependencies": {
"com.unity.ugui": "1.0.0",
- "com.unity.modules.unityanalytics": "1.0.0",
- "com.unity.modules.unitywebrequest": "1.0.0",
- "com.unity.modules.jsonserialize": "1.0.0",
+ "com.unity.services.core": "1.8.1",
"com.unity.modules.androidjni": "1.0.0",
- "com.unity.services.core": "1.8.1"
+ "com.unity.modules.jsonserialize": "1.0.0",
+ "com.unity.modules.unityanalytics": "1.0.0",
+ "com.unity.modules.unitywebrequest": "1.0.0"
},
"url": "https://packages.unity.com"
},
@@ -115,8 +115,8 @@
"source": "registry",
"dependencies": {
"com.unity.ugui": "1.0.0",
- "com.unity.modules.jsonserialize": "1.0.0",
- "com.unity.services.core": "1.10.1"
+ "com.unity.services.core": "1.10.1",
+ "com.unity.modules.jsonserialize": "1.0.0"
},
"url": "https://packages.unity.com"
},
@@ -125,34 +125,34 @@
"depth": 1,
"source": "registry",
"dependencies": {
- "com.unity.modules.unitywebrequest": "1.0.0",
+ "com.unity.modules.androidjni": "1.0.0",
"com.unity.nuget.newtonsoft-json": "3.2.1",
- "com.unity.modules.androidjni": "1.0.0"
+ "com.unity.modules.unitywebrequest": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.sysroot": {
- "version": "2.0.7",
+ "version": "2.0.10",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.sysroot.linux-x86_64": {
- "version": "2.0.6",
+ "version": "2.0.9",
"depth": 1,
"source": "registry",
"dependencies": {
- "com.unity.sysroot": "2.0.7"
+ "com.unity.sysroot": "2.0.10"
},
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
- "version": "1.1.33",
+ "version": "1.4.6",
"depth": 0,
"source": "registry",