public override bool Equals(object obj) { CancelGameEntryRequest cancelGameEntryRequest = obj as CancelGameEntryRequest; if (cancelGameEntryRequest == null) { return(false); } if (!this.RequestId.Equals(cancelGameEntryRequest.RequestId)) { return(false); } if (this.HasFactoryId != cancelGameEntryRequest.HasFactoryId || (this.HasFactoryId && !this.FactoryId.Equals(cancelGameEntryRequest.FactoryId))) { return(false); } if (this.Player.Count != cancelGameEntryRequest.Player.Count) { return(false); } for (int i = 0; i < this.Player.Count; i++) { if (!this.Player[i].Equals(cancelGameEntryRequest.Player[i])) { return(false); } } return(true); }
public static CancelGameEntryRequest DeserializeLengthDelimited(Stream stream, CancelGameEntryRequest instance) { long num = (long)((ulong)ProtocolParser.ReadUInt32(stream)); num += stream.Position; return(CancelGameEntryRequest.Deserialize(stream, instance, num)); }
public static CancelGameEntryRequest DeserializeLengthDelimited(Stream stream) { CancelGameEntryRequest cancelGameEntryRequest = new CancelGameEntryRequest(); CancelGameEntryRequest.DeserializeLengthDelimited(stream, cancelGameEntryRequest); return(cancelGameEntryRequest); }
public static void Serialize(Stream stream, CancelGameEntryRequest instance) { BinaryWriter binaryWriter = new BinaryWriter(stream); stream.WriteByte(9); binaryWriter.Write(instance.RequestId); if (instance.HasFactoryId) { stream.WriteByte(17); binaryWriter.Write(instance.FactoryId); } if (instance.Player.get_Count() > 0) { using (List <Player> .Enumerator enumerator = instance.Player.GetEnumerator()) { while (enumerator.MoveNext()) { Player current = enumerator.get_Current(); stream.WriteByte(26); ProtocolParser.WriteUInt32(stream, current.GetSerializedSize()); bnet.protocol.game_master.Player.Serialize(stream, current); } } } }
public static CancelGameEntryRequest Deserialize(Stream stream, CancelGameEntryRequest instance, long limit) { BinaryReader binaryReader = new BinaryReader(stream); if (instance.Player == null) { instance.Player = new List <Player>(); } while (limit < 0L || stream.get_Position() < limit) { int num = stream.ReadByte(); if (num == -1) { if (limit >= 0L) { throw new EndOfStreamException(); } return(instance); } else { int num2 = num; if (num2 != 9) { if (num2 != 17) { if (num2 != 26) { Key key = ProtocolParser.ReadKey((byte)num, stream); uint field = key.Field; if (field == 0u) { throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream"); } ProtocolParser.SkipKey(stream, key); } else { instance.Player.Add(bnet.protocol.game_master.Player.DeserializeLengthDelimited(stream)); } } else { instance.FactoryId = binaryReader.ReadUInt64(); } } else { instance.RequestId = binaryReader.ReadUInt64(); } } } if (stream.get_Position() == limit) { return(instance); } throw new ProtocolBufferException("Read past max limit"); }
public static void Serialize(Stream stream, CancelGameEntryRequest instance) { BinaryWriter binaryWriter = new BinaryWriter(stream); stream.WriteByte(9); binaryWriter.Write(instance.RequestId); if (instance.HasFactoryId) { stream.WriteByte(17); binaryWriter.Write(instance.FactoryId); } if (instance.Player.Count > 0) { foreach (Player player in instance.Player) { stream.WriteByte(26); ProtocolParser.WriteUInt32(stream, player.GetSerializedSize()); bnet.protocol.game_master.Player.Serialize(stream, player); } } }
public void Serialize(Stream stream) { CancelGameEntryRequest.Serialize(stream, this); }
public static CancelGameEntryRequest Deserialize(Stream stream, CancelGameEntryRequest instance) { return(CancelGameEntryRequest.Deserialize(stream, instance, -1L)); }