Skip to content

Commit f8d2f12

Browse files
committed
Added UsePrefabSync to NetworkConfig checks
1 parent 89139b1 commit f8d2f12

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

MLAPI/Data/NetworkConfig.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,6 @@ public class NetworkConfig
129129
/// </summary>
130130
public HashSize RpcHashSize = HashSize.VarIntTwoBytes;
131131
/// <summary>
132-
/// Decides how many bytes to use for Prefab names. Leave this to 2 bytes unless you are facing hash collisions
133-
/// </summary>
134-
public HashSize PrefabHashSize = HashSize.VarIntTwoBytes;
135-
/// <summary>
136132
/// Wheter or not to enable encryption
137133
/// The amount of seconds to wait on all clients to load requested scene before the SwitchSceneProgress onComplete callback, that waits for all clients to complete loading, is called anyway.
138134
/// </summary>
@@ -230,6 +226,8 @@ public string ToBase64()
230226
writer.WriteInt32Packed(config.LoadSceneTimeOut);
231227
writer.WriteBool(config.EnableTimeResync);
232228
writer.WriteBits((byte)config.RpcHashSize, 3);
229+
writer.WriteBool(ForceSamePrefabs);
230+
writer.WriteBool(UsePrefabSync);
233231
stream.PadStream();
234232

235233
return Convert.ToBase64String(stream.ToArray());
@@ -288,6 +286,8 @@ public void FromBase64(string base64)
288286
config.LoadSceneTimeOut = reader.ReadInt32Packed();
289287
config.EnableTimeResync = reader.ReadBool();
290288
config.RpcHashSize = (HashSize)reader.ReadBits(3);
289+
config.ForceSamePrefabs = reader.ReadBool();
290+
config.UsePrefabSync = reader.ReadBool();
291291
}
292292
}
293293
}
@@ -334,10 +334,10 @@ public ulong GetConfig(bool cache = true)
334334
}
335335

336336
writer.WriteBool(ForceSamePrefabs);
337+
writer.WriteBool(UsePrefabSync);
337338
writer.WriteBool(EnableEncryption);
338339
writer.WriteBool(SignKeyExchange);
339340
writer.WriteBits((byte)RpcHashSize, 3);
340-
writer.WriteBits((byte)PrefabHashSize, 3);
341341
stream.PadStream();
342342

343343
if (cache)

MLAPI/NetworkingManagerComponents/Core/SpawnManager.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -109,20 +109,6 @@ internal static ulong GetNetworkObjectId()
109109
}
110110
}
111111

112-
internal static ulong GetPrefabHash(string prefabName)
113-
{
114-
HashSize mode = NetworkingManager.Singleton.NetworkConfig.PrefabHashSize;
115-
116-
if (mode == HashSize.VarIntTwoBytes)
117-
return prefabName.GetStableHash16();
118-
if (mode == HashSize.VarIntFourBytes)
119-
return prefabName.GetStableHash32();
120-
if (mode == HashSize.VarIntEightBytes)
121-
return prefabName.GetStableHash64();
122-
123-
return 0;
124-
}
125-
126112
/// <summary>
127113
/// Gets the prefab index of a given prefab hash
128114
/// </summary>

0 commit comments

Comments
 (0)