public override void ToStream(Stream output) { output.Write(TLUtils.SignatureToBytes(Signature)); output.Write(Flags.ToBytes()); output.Write(RandomId.ToBytes()); output.Write(TTL.ToBytes()); output.Write(Message.ToBytes()); ToStream(output, Media, Flags, (int)MessageFlags.Media); ToStream(output, Entities, Flags, (int)MessageFlags.Entities); ToStream(output, ViaBotName, Flags, (int)MessageFlags.ViaBotId); ToStream(output, ReplyToRandomMsgId, Flags, (int)MessageFlags.ReplyToMsgId); ChatId.NullableToStream(output); InputFile.NullableToStream(output); FromId.NullableToStream(output); Out.NullableToStream(output); Unread.NullableToStream(output); Date.NullableToStream(output); DeleteDate.NullableToStream(output); Qts.NullableToStream(output); var status = new TLInt((int)Status); output.Write(status.ToBytes()); InSeqNo.NullableToStream(output); OutSeqNo.NullableToStream(output); CustomFlags.NullableToStream(output); if (IsSet(CustomFlags, (int)MessageCustomFlags.BotInlineResult)) { _inlineBotResult.ToStream(output); } }
public override void ToStream(Stream output) { output.Write(TLUtils.SignatureToBytes(Signature)); output.Write(RandomId.ToBytes()); output.Write(TTL.ToBytes()); //output.Write(RandomBytes.ToBytes()); output.Write(Message.ToBytes()); Media.ToStream(output); ChatId.NullableToStream(output); InputFile.NullableToStream(output); FromId.NullableToStream(output); Out.NullableToStream(output); Unread.NullableToStream(output); Date.NullableToStream(output); DeleteDate.NullableToStream(output); Qts.NullableToStream(output); var status = new TLInt((int)Status); output.Write(status.ToBytes()); InSeqNo.NullableToStream(output); OutSeqNo.NullableToStream(output); CustomFlags.NullableToStream(output); }
public override void Save(BinaryWriter writer) { writer.Write(Index); writer.Write(Name); writer.Write(Level); writer.Write((byte)Class); writer.Write((byte)Gender); writer.Write(Hair); writer.Write(CreationDate.ToBinary()); writer.Write(Deleted); writer.Write(DeleteDate.ToBinary()); writer.Write(HP); writer.Write(MP); writer.Write(Experience); writer.Write(Inventory.Length); for (int i = 0; i < Inventory.Length; i++) { writer.Write(Inventory[i] != null); if (Inventory[i] == null) { continue; } Inventory[i].Save(writer); } writer.Write(Equipment.Length); for (int i = 0; i < Equipment.Length; i++) { writer.Write(Equipment[i] != null); if (Equipment[i] == null) { continue; } Equipment[i].Save(writer); } writer.Write(Magics.Count); for (int i = 0; i < Magics.Count; i++) { Magics[i].Save(writer); } writer.Write(AutoPot); writer.Write(Grade); writer.Write(HPItemIndex); writer.Write(MPItemIndex); writer.Write(AutoHPPercent); writer.Write(AutoMPPercent); writer.Write(SealCount); }
public override void ToStream(Stream output) { output.Write(TLUtils.SignatureToBytes(Signature)); output.Write(RandomId.ToBytes()); output.Write(RandomBytes.ToBytes()); output.Write(Action.ToBytes()); ChatId.NullableToStream(output); FromId.NullableToStream(output); Out.NullableToStream(output); Unread.NullableToStream(output); Date.NullableToStream(output); DeleteDate.NullableToStream(output); Qts.NullableToStream(output); var status = new TLInt((int)Status); output.Write(status.ToBytes()); }