예제 #1
0
        internal void ConsumeData(NetMessage msg)
        {
            byte header;

            if (!msg.ReadByte(out header))
            {
                return;
            }
            MsgType         msgType;
            BroadcastMode   broadcast;
            ReliabilityMode reliability;
            SubMsgType      sub;

            RpcUtils.ReadHeader(header, out reliability, out broadcast, out msgType, out sub);

            switch (msgType)
            {
            case MsgType.Internal:
                ProcessInternal(msg);
                break;

            case MsgType.Static:
                ProcessStatic(broadcast, reliability, msg);
                break;

            default:
                Debug.LogWarning($"Unsupported {msg.LengthBytes - 1} byte message of type {msgType} from {this}");
                break;
            }
        }
예제 #2
0
        internal void ConsumeData(NetMessage msg)
        {
            if (!msg.ReadByte(out var header))
            {
                return;
            }
            RpcUtils.ReadHeader(header, out var reliability, out var broadcast, out var msgType, out var sub);

            switch (msgType)
            {
            case MsgType.Internal:
                ProcessInternal(broadcast, reliability, msg);
                break;

            case MsgType.Static:
                ProcessStatic(broadcast, reliability, msg);
                break;

            case MsgType.Netview:
                var info = new NetMessageInfo(broadcast, this)
                {
                    Reliability = reliability
                };
                Room.NetworkManager.CallRpc(msg, info, sub);
                break;

            case MsgType.Stream:
                Room.NetworkManager.Stream(msg, this);
                break;

            default:
                Debug.LogWarning($"Unsupported {msg.LengthBytes - 1} byte message of type {msgType} from {this}");
                break;
            }
        }
예제 #3
0
        internal void ConsumeData(NetMessage msg)
        {
            if (Status != ConnectionStatus.Connected)
            {
                return;
            }
            if (!msg.ReadByte(out var header))
            {
                return;
            }
            RpcUtils.ReadHeader(header, out var reliability, out var broadcast, out var msgType, out var sub);

            switch (msgType)
            {
            case MsgType.Internal:
                ProcessInternal(broadcast, reliability, msg);
                break;

            case MsgType.Static:
                var info = new PlayerMessageInfo(broadcast)
                {
                    Reliability = reliability
                };
                ProcessStatic(msg, info);
                break;

            default:
                Debug.LogWarning($"Unsupported {msg.LengthBytes - 1} byte message of type {msgType} from {this}");
                break;
            }
        }
예제 #4
0
        internal void ConsumeData(NetMessage msg)
        {
            if (!msg.ReadByte(out var header))
            {
                return;
            }
            RpcUtils.ReadHeader(header, out var reliability, out var broadcast, out var msgType, out var sub);

            switch (msgType)
            {
            case MsgType.Internal:
                ProcessInternal(msg);
                break;

            case MsgType.Static:
                ProcessStatic(broadcast, reliability, msg);
                break;

            default:
                Debug.LogWarning($"Unsupported {msg.LengthBytes - 1} byte message of type {msgType} from {this}");
                break;
            }
        }