File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
com.unity.netcode.gameobjects/Runtime Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,10 @@ internal class SessionConfig
88 public const uint NoFeatureCompatibility = 0 ;
99 public const uint BypassFeatureCompatible = 1 ;
1010 public const uint ServerDistributionCompatible = 2 ;
11+ public const uint SessionStateToken = 3 ;
1112
1213 // The most current session version (!!!!set this when you increment!!!!!)
13- public static uint PackageSessionVersion => ServerDistributionCompatible ;
14+ public static uint PackageSessionVersion => SessionStateToken ;
1415
1516 internal uint SessionVersion ;
1617
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ internal struct ServiceConfig : INetworkSerializable
99 public bool IsRestoredSession ;
1010 public ulong CurrentSessionOwner ;
1111 public bool ServerRedistribution ;
12+ public ulong SessionStateToken ;
1213
1314 public void NetworkSerialize < T > ( BufferSerializer < T > serializer ) where T : IReaderWriter
1415 {
@@ -22,6 +23,11 @@ public void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReade
2223 {
2324 serializer . SerializeValue ( ref ServerRedistribution ) ;
2425 }
26+
27+ if ( SessionVersion >= SessionConfig . SessionStateToken )
28+ {
29+ serializer . SerializeValue ( ref SessionStateToken ) ;
30+ }
2531 }
2632 else
2733 {
@@ -37,6 +43,15 @@ public void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReade
3743 {
3844 ServerRedistribution = false ;
3945 }
46+
47+ if ( SessionVersion >= SessionConfig . SessionStateToken )
48+ {
49+ serializer . SerializeValue ( ref SessionStateToken ) ;
50+ }
51+ else
52+ {
53+ SessionStateToken = 0 ;
54+ }
4055 }
4156 }
4257 }
You can’t perform that action at this time.
0 commit comments