Пример #1
0
 internal LoginServerMessage(TeraMessageReader reader)
     : base(reader)
 {
     reader.Skip(10);
     RaceGenderClass = new RaceGenderClass(reader.ReadInt32());
     Id = reader.ReadEntityId();
     reader.Skip(268);
     Name = reader.ReadTeraString();
 }
 internal SpawnUserServerMessage(TeraMessageReader reader)
     : base(reader)
 {
     reader.Skip(0x22);
     Id = reader.ReadEntityId();
     reader.Skip(18);
     RaceGenderClass=new RaceGenderClass(reader.ReadInt32());
     reader.Skip(208);
     Name = reader.ReadTeraString();
     GuildName = reader.ReadTeraString();
 }
Пример #3
0
        private ParsedMessage Instantiate(string opCodeName, TeraMessageReader reader)
        {
            Type type;
            if (!OpcodeNameToType.TryGetValue(opCodeName, out type))
                type = typeof(UnknownMessage);

            var constructor = type.GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, null, CallingConventions.Any, new[] { typeof(TeraMessageReader) }, null);
            if (constructor == null)
                throw new Exception("Constructor not found");
            return (ParsedMessage)constructor.Invoke(new object[] { reader });
        }
 internal EachSkillResultServerMessage(TeraMessageReader reader)
     : base(reader)
 {
     reader.Skip(4);
     Source = reader.ReadEntityId();
     Target = reader.ReadEntityId();
     reader.Skip(4);
     SkillId = reader.ReadInt32() & 0x3FFFFFF;
     reader.Skip(16);
     Amount = reader.ReadInt32();
     SkillResultFlags = (SkillResultFlags)reader.ReadInt32();
     IsCritical = (reader.ReadByte() & 1) != 0;
 }
Пример #5
0
 internal UnknownMessage(TeraMessageReader reader)
     : base(reader)
 {
 }
Пример #6
0
 internal ParsedMessage(TeraMessageReader reader)
     : base(reader.Message.Time, reader.Message.Direction, reader.Message.Data)
 {
     OpCodeName = reader.OpCodeName;
 }
 internal SpawnMeServerMessage(TeraMessageReader reader)
     : base(reader)
 {
     Id = reader.ReadEntityId();
 }
Пример #8
0
 public ParsedMessage Create(Message message)
 {
     var reader = new TeraMessageReader(message, _opCodeNamer);
     var opCodeName = _opCodeNamer.GetName(message.OpCode);
     return Instantiate(opCodeName, reader);
 }