File tree Expand file tree Collapse file tree
com.unity.netcode.gameobjects/Runtime/Core Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- // Stands in for a second package occupying Unity.Netcode.NetworkTime and
2- // Unity.Netcode.NetworkTimeSystem, which is what Netcode for Entities does once the casing of its
3- // Unity.NetCode namespace is corrected .
1+ // Stands in for a second package occupying Unity.Netcode.NetworkTimeSystem, which is what Netcode
2+ // for Entities does as of 6.7.0: its casing correction moved 204 files into Unity.Netcode, and it
3+ // sub-namespaced NetworkTime into Unity.Netcode.NetcodeTime but left NetworkTimeSystem behind .
44//
5- // Only those two names collide. NetworkTickSystem deliberately is not declared here, so a
6- // --collision-stub run asserts both halves of the finding in one pass: the updater migrates
7- // NetworkTickSystem, and it cannot migrate the two whose old names still resolve .
5+ // Only that one name collides. NetworkTime and NetworkTickSystem deliberately are not declared here,
6+ // so a --collision-stub run asserts both halves of the finding in one pass: those two migrate, and
7+ // the one whose old name still resolves cannot .
88//
99// Inert until run_upgrade_test.py --collision-stub copies this folder into place. Unity does not
1010// import a directory whose name ends in '~'.
1111namespace Unity . Netcode
1212{
13- public struct NetworkTime
14- {
15- public int ServerTick ;
16- }
17-
1813 public class NetworkTimeSystem
1914 {
2015 public uint EffectiveInputLatencyTicks ;
Original file line number Diff line number Diff line change 88reference under Assets/Editor and Assets/Runtime was rewritten and that no stale reference
99survived. The 2.x sources are restored on exit so the test can be re-run.
1010
11- With --collision-stub, a stub assembly is added that occupies Unity.Netcode.NetworkTime and
12- Unity.Netcode.NetworkTimeSystem, standing in for a second package that has taken those names. The
13- expectation then inverts for exactly those two : the updater is driven by resolution failure, so a
11+ With --collision-stub, a stub assembly is added that occupies Unity.Netcode.NetworkTimeSystem,
12+ standing in for Netcode for Entities, which still declares that name in the shared root namespace.
13+ The expectation then inverts for exactly that one : the updater is driven by resolution failure, so a
1414name another assembly still resolves never reaches the MovedFrom data and cannot be migrated.
15- NetworkTickSystem is deliberately absent from the stub and must still migrate, which is what makes
16- the run prove both halves rather than merely fail.
15+ NetworkTime and NetworkTickSystem are deliberately absent from the stub and must still migrate, which
16+ is what makes the run prove both halves rather than merely fail.
1717
1818Note that this script can be run from anywhere; paths are resolved relative to the script itself.
1919"""
7070
7171# The names the --collision-stub assembly occupies; under it these must NOT be rewritten.
7272# Keep in sync with Assets/CollisionStub~/N4ECollisionStub.cs.
73- STUB_OCCUPIED = ['Unity.Netcode.NetworkTime' , 'Unity.Netcode. NetworkTimeSystem' ]
73+ STUB_OCCUPIED = ['Unity.Netcode.NetworkTimeSystem' ]
7474
7575
7676def expected_pairs ():
Original file line number Diff line number Diff line change 2424using PackageInfo = UnityEditor . PackageManager . PackageInfo ;
2525#endif
2626using UnityEngine . SceneManagement ;
27+ // Netcode for Entities also declares Unity.Netcode.NetworkTimeSystem. The enclosing namespace is
28+ // searched before any using directive, so inside Unity.Netcode the bare name binds to theirs and the
29+ // import above is never consulted. An alias is the only spelling that reaches ours from here, since
30+ // IDE0001 rules out qualifying the name and an alias sharing it is silently ignored.
31+ using GameObjectsNetworkTimeSystem = Unity . Netcode . GameObjects . Timing . NetworkTimeSystem ;
2732
2833
2934
@@ -1017,7 +1022,7 @@ public NetworkPrefabHandler PrefabHandler
10171022 /// Accessor property for the <see cref="NetworkTimeSystem"/> of the NetworkManager.
10181023 /// Prefer the use of the LocalTime and ServerTime properties
10191024 /// </summary>
1020- public NetworkTimeSystem NetworkTimeSystem { get ; private set ; }
1025+ public GameObjectsNetworkTimeSystem NetworkTimeSystem { get ; private set ; }
10211026
10221027 /// <summary>
10231028 /// Accessor property for the <see cref="NetworkTickSystem"/> of the NetworkManager.
@@ -1310,7 +1315,7 @@ internal void Initialize(bool server)
13101315 ConnectionManager . Initialize ( this ) ;
13111316
13121317 // The remaining systems can then be initialized
1313- NetworkTimeSystem = server ? NetworkTimeSystem . ServerTimeSystem ( ) : new NetworkTimeSystem ( 1.0 / NetworkConfig . TickRate ) ;
1318+ NetworkTimeSystem = server ? GameObjectsNetworkTimeSystem . ServerTimeSystem ( ) : new GameObjectsNetworkTimeSystem ( 1.0 / NetworkConfig . TickRate ) ;
13141319 NetworkTickSystem = NetworkTimeSystem . Initialize ( this ) ;
13151320 AnticipationSystem = new AnticipationSystem ( this ) ;
13161321
You can’t perform that action at this time.
0 commit comments