mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
MessagePacker.GetId<T> reuses GetId(Type)
This commit is contained in:
parent
aba69ca4d0
commit
c947bc03e6
@ -21,14 +21,14 @@ public static class MessagePacker
|
||||
|
||||
public static int GetId<T>() where T : IMessageBase
|
||||
{
|
||||
// paul: 16 bits is enough to avoid collisions
|
||||
// - keeps the message size small because it gets varinted
|
||||
// - in case of collisions, Mirror will display an error
|
||||
return typeof(T).FullName.GetStableHashCode() & 0xFFFF;
|
||||
return GetId(typeof(T));
|
||||
}
|
||||
|
||||
public static int GetId(Type type)
|
||||
{
|
||||
// paul: 16 bits is enough to avoid collisions
|
||||
// - keeps the message size small because it gets varinted
|
||||
// - in case of collisions, Mirror will display an error
|
||||
return type.FullName.GetStableHashCode() & 0xFFFF;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user