File tree 2 files changed +17
-1
lines changed
com.unity.netcode.gameobjects/Runtime
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,10 @@ internal class SessionConfig
8
8
public const uint NoFeatureCompatibility = 0 ;
9
9
public const uint BypassFeatureCompatible = 1 ;
10
10
public const uint ServerDistributionCompatible = 2 ;
11
+ public const uint SessionStateToken = 3 ;
11
12
12
13
// The most current session version (!!!!set this when you increment!!!!!)
13
- public static uint PackageSessionVersion => ServerDistributionCompatible ;
14
+ public static uint PackageSessionVersion => SessionStateToken ;
14
15
15
16
internal uint SessionVersion ;
16
17
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ internal struct ServiceConfig : INetworkSerializable
9
9
public bool IsRestoredSession ;
10
10
public ulong CurrentSessionOwner ;
11
11
public bool ServerRedistribution ;
12
+ public ulong SessionStateToken ;
12
13
13
14
public void NetworkSerialize < T > ( BufferSerializer < T > serializer ) where T : IReaderWriter
14
15
{
@@ -22,6 +23,11 @@ public void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReade
22
23
{
23
24
serializer . SerializeValue ( ref ServerRedistribution ) ;
24
25
}
26
+
27
+ if ( SessionVersion >= SessionConfig . SessionStateToken )
28
+ {
29
+ serializer . SerializeValue ( ref SessionStateToken ) ;
30
+ }
25
31
}
26
32
else
27
33
{
@@ -37,6 +43,15 @@ public void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReade
37
43
{
38
44
ServerRedistribution = false ;
39
45
}
46
+
47
+ if ( SessionVersion >= SessionConfig . SessionStateToken )
48
+ {
49
+ serializer . SerializeValue ( ref SessionStateToken ) ;
50
+ }
51
+ else
52
+ {
53
+ SessionStateToken = 0 ;
54
+ }
40
55
}
41
56
}
42
57
}
You can’t perform that action at this time.
0 commit comments