Exemplo n.º 1
0
        public void Read(ProtocolBufferReader reader)
        {
            EntityId = reader.ReadULong();

            switch (Subtype)
            {
            case CallMethodMessageSubtype.MethodId:
            case CallMethodMessageSubtype.UnkPlusMethodId:
                MethodId = (GameOpcode)reader.ReadUInt();
                break;

            case CallMethodMessageSubtype.MethodName:
            case CallMethodMessageSubtype.UnkPlusMethodName:
                MethodName = reader.ReadString();
                break;

            default:
                throw new Exception($"Invalid subtype ({Subtype}) for CallMethodMessage!");
            }

            reader.ReadArray(); // No need to properly implement this, it won't be called anyways, the Read function is only here for clarity

            if (Subtype == CallMethodMessageSubtype.UnkPlusMethodId || Subtype == CallMethodMessageSubtype.UnkPlusMethodName)
            {
                UnknownValue = reader.ReadUInt();
            }
        }
Exemplo n.º 2
0
        public void Read(ProtocolBufferReader reader)
        {
            switch (Subtype)
            {
            case CallServerMethodSubtype.UserMethodById:
            case CallServerMethodSubtype.SysUserMethodById:
            case CallServerMethodSubtype.ActorMethodById:
            case CallServerMethodSubtype.ChatMsgById:
            case CallServerMethodSubtype.WorldMsgById:
                MethodId = (GameOpcode)reader.ReadUInt();
                break;

            case CallServerMethodSubtype.UserMethodByName:
            case CallServerMethodSubtype.SysUSerMethodByName:
            case CallServerMethodSubtype.ActorMethodByName:
            case CallServerMethodSubtype.ChatMsgByName:
            case CallServerMethodSubtype.WorldMsgByName:
                MethodName = reader.ReadString();

                Debugger.Break();     // This isn't supported yet
                break;
            }

            _payload = reader.ReadArray();
        }
Exemplo n.º 3
0
        public void Read(ProtocolBufferReader reader)
        {
            switch (Subtype)
            {
            case CallServerMethodSubtype.UserMethodById:
            case CallServerMethodSubtype.SysUserMethodById:
            case CallServerMethodSubtype.ActorMethodById:
            case CallServerMethodSubtype.ChatMsgById:
            case CallServerMethodSubtype.WorldMsgById:
                MethodId = reader.ReadUInt();
                break;

            case CallServerMethodSubtype.UserMethodByName:
            case CallServerMethodSubtype.SysUSerMethodByName:
            case CallServerMethodSubtype.ActorMethodByName:
            case CallServerMethodSubtype.ChatMsgByName:
            case CallServerMethodSubtype.WorldMsgByName:
                MethodName = reader.ReadString();
                break;
            }

            Payload = reader.ReadArray();
        }