breaking: componentIndex changed to byte in CommandMessage and RpcMessage (#2963)

This commit is contained in:
MrGadget 2021-10-07 07:46:24 -04:00 committed by GitHub
parent 7bc7b31df4
commit e6e910916e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -27,7 +27,7 @@ public enum SceneOperation : byte
public struct CommandMessage : NetworkMessage
{
public uint netId;
public int componentIndex;
public byte componentIndex;
public int functionHash;
// the parameters for the Cmd function
// -> ArraySegment to avoid unnecessary allocations
@ -37,7 +37,7 @@ public struct CommandMessage : NetworkMessage
public struct RpcMessage : NetworkMessage
{
public uint netId;
public int componentIndex;
public byte componentIndex;
public int functionHash;
// the parameters for the Cmd function
// -> ArraySegment to avoid unnecessary allocations

View File

@ -228,7 +228,7 @@ protected void SendCommandInternal(Type invokeClass, string cmdName, NetworkWrit
CommandMessage message = new CommandMessage
{
netId = netId,
componentIndex = ComponentIndex,
componentIndex = (byte)ComponentIndex,
// type+func so Inventory.RpcUse != Equipment.RpcUse
functionHash = RemoteCallHelper.GetMethodHash(invokeClass, cmdName),
// segment to avoid reader allocations
@ -263,7 +263,7 @@ protected void SendRPCInternal(Type invokeClass, string rpcName, NetworkWriter w
RpcMessage message = new RpcMessage
{
netId = netId,
componentIndex = ComponentIndex,
componentIndex = (byte)ComponentIndex,
// type+func so Inventory.RpcUse != Equipment.RpcUse
functionHash = RemoteCallHelper.GetMethodHash(invokeClass, rpcName),
// segment to avoid reader allocations
@ -310,7 +310,7 @@ protected void SendTargetRPCInternal(NetworkConnection conn, Type invokeClass, s
RpcMessage message = new RpcMessage
{
netId = netId,
componentIndex = ComponentIndex,
componentIndex = (byte)ComponentIndex,
// type+func so Inventory.RpcUse != Equipment.RpcUse
functionHash = RemoteCallHelper.GetMethodHash(invokeClass, rpcName),
// segment to avoid reader allocations