public static void Serialize(Stream stream, ListFactoriesResponse instance)
 {
     if (instance.Description.Count > 0)
     {
         foreach (GameFactoryDescription description in instance.Description)
         {
             stream.WriteByte(10);
             ProtocolParser.WriteUInt32(stream, description.GetSerializedSize());
             GameFactoryDescription.Serialize(stream, description);
         }
     }
     if (instance.HasTotalResults)
     {
         stream.WriteByte(16);
         ProtocolParser.WriteUInt32(stream, instance.TotalResults);
     }
 }
Example #2
0
        public static void Serialize(Stream stream, FactoryUpdateNotification instance)
        {
            BinaryWriter binaryWriter = new BinaryWriter(stream);

            stream.WriteByte(8);
            ProtocolParser.WriteUInt64(stream, (ulong)instance.Op);
            if (instance.Description == null)
            {
                throw new ArgumentNullException("Description", "Required by proto specification.");
            }
            stream.WriteByte(18);
            ProtocolParser.WriteUInt32(stream, instance.Description.GetSerializedSize());
            GameFactoryDescription.Serialize(stream, instance.Description);
            if (instance.HasProgramId)
            {
                stream.WriteByte(29);
                binaryWriter.Write(instance.ProgramId);
            }
        }
 public static void Serialize(Stream stream, ListFactoriesResponse instance)
 {
     if (instance.Description.get_Count() > 0)
     {
         using (List <GameFactoryDescription> .Enumerator enumerator = instance.Description.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 GameFactoryDescription current = enumerator.get_Current();
                 stream.WriteByte(10);
                 ProtocolParser.WriteUInt32(stream, current.GetSerializedSize());
                 GameFactoryDescription.Serialize(stream, current);
             }
         }
     }
     if (instance.HasTotalResults)
     {
         stream.WriteByte(16);
         ProtocolParser.WriteUInt32(stream, instance.TotalResults);
     }
 }
Example #4
0
 public void Serialize(Stream stream)
 {
     GameFactoryDescription.Serialize(stream, this);
 }