public static ISerializableField ReadField(ref PacketInStream Stream) { long FieldData = Stream.ReadEncoded7Bit(); if (FieldData < 0) { return(null); } int FieldType; int FieldIndex; if (!PacketInStream.Decode2Parameters(FieldData, out FieldType, out FieldIndex)) { return(null); } return(ReadField(ref Stream, FieldIndex, FieldType)); }
public override void Deserialize(ref PacketInStream Data) { long ListData = Data.ReadEncoded7Bit(); int ListType; int ListCount; PacketInStream.Decode2Parameters(ListData, out ListType, out ListCount); List <ISerializableField> Fields = new List <ISerializableField>(); Log.Success("Packet", "------> List : " + ListType + "(" + ListCount + ")"); for (int i = 0; i < ListCount; ++i) { ISerializableField Field = PacketProcessor.GetFieldType((EPacketFieldType)ListType); if (Field != null) { Field.Deserialize(ref Data); Fields.Add(Field); } } val = Fields; }