Esempio n. 1
0
 public static void Serialize(Stream stream, ClientRequest instance)
 {
     if (instance.Attribute.Count > 0)
     {
         foreach (bnet.protocol.attribute.Attribute attribute in instance.Attribute)
         {
             stream.WriteByte(10);
             ProtocolParser.WriteUInt32(stream, attribute.GetSerializedSize());
             bnet.protocol.attribute.Attribute.Serialize(stream, attribute);
         }
     }
     if (instance.HasHost)
     {
         stream.WriteByte(18);
         ProtocolParser.WriteUInt32(stream, instance.Host.GetSerializedSize());
         ProcessId.Serialize(stream, instance.Host);
     }
     if (instance.HasBnetAccountId)
     {
         stream.WriteByte(26);
         ProtocolParser.WriteUInt32(stream, instance.BnetAccountId.GetSerializedSize());
         EntityId.Serialize(stream, instance.BnetAccountId);
     }
     if (instance.HasGameAccountId)
     {
         stream.WriteByte(34);
         ProtocolParser.WriteUInt32(stream, instance.GameAccountId.GetSerializedSize());
         EntityId.Serialize(stream, instance.GameAccountId);
     }
 }
 public static void Serialize(Stream stream, PresenceChannelCreatedRequest instance)
 {
     if (instance.Id == null)
     {
         throw new ArgumentNullException("Id", "Required by proto specification.");
     }
     stream.WriteByte(10);
     ProtocolParser.WriteUInt32(stream, instance.Id.GetSerializedSize());
     EntityId.Serialize(stream, instance.Id);
     if (instance.HasGameAccountId)
     {
         stream.WriteByte(26);
         ProtocolParser.WriteUInt32(stream, instance.GameAccountId.GetSerializedSize());
         EntityId.Serialize(stream, instance.GameAccountId);
     }
     if (instance.HasBnetAccountId)
     {
         stream.WriteByte(34);
         ProtocolParser.WriteUInt32(stream, instance.BnetAccountId.GetSerializedSize());
         EntityId.Serialize(stream, instance.BnetAccountId);
     }
     if (instance.HasHost)
     {
         stream.WriteByte(42);
         ProtocolParser.WriteUInt32(stream, instance.Host.GetSerializedSize());
         ProcessId.Serialize(stream, instance.Host);
     }
 }
        public static void Serialize(Stream stream, ServerRequest instance)
        {
            BinaryWriter binaryWriter = new BinaryWriter(stream);

            if (instance.Attribute.get_Count() > 0)
            {
                using (List <Attribute> .Enumerator enumerator = instance.Attribute.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        Attribute current = enumerator.get_Current();
                        stream.WriteByte(10);
                        ProtocolParser.WriteUInt32(stream, current.GetSerializedSize());
                        bnet.protocol.attribute.Attribute.Serialize(stream, current);
                    }
                }
            }
            stream.WriteByte(21);
            binaryWriter.Write(instance.Program);
            if (instance.HasHost)
            {
                stream.WriteByte(26);
                ProtocolParser.WriteUInt32(stream, instance.Host.GetSerializedSize());
                ProcessId.Serialize(stream, instance.Host);
            }
        }
 public static void Serialize(Stream stream, ClientRequest instance)
 {
     if (instance.Attribute.get_Count() > 0)
     {
         using (List <Attribute> .Enumerator enumerator = instance.Attribute.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 Attribute current = enumerator.get_Current();
                 stream.WriteByte(10);
                 ProtocolParser.WriteUInt32(stream, current.GetSerializedSize());
                 bnet.protocol.attribute.Attribute.Serialize(stream, current);
             }
         }
     }
     if (instance.HasHost)
     {
         stream.WriteByte(18);
         ProtocolParser.WriteUInt32(stream, instance.Host.GetSerializedSize());
         ProcessId.Serialize(stream, instance.Host);
     }
     if (instance.HasBnetAccountId)
     {
         stream.WriteByte(26);
         ProtocolParser.WriteUInt32(stream, instance.BnetAccountId.GetSerializedSize());
         EntityId.Serialize(stream, instance.BnetAccountId);
     }
     if (instance.HasGameAccountId)
     {
         stream.WriteByte(34);
         ProtocolParser.WriteUInt32(stream, instance.GameAccountId.GetSerializedSize());
         EntityId.Serialize(stream, instance.GameAccountId);
     }
 }
Esempio n. 5
0
 public static void Serialize(Stream stream, FindClientResponse instance)
 {
     stream.WriteByte(8);
     ProtocolParser.WriteUInt32(stream, instance.Label);
     if (instance.HasClientProcessId)
     {
         stream.WriteByte(18);
         ProtocolParser.WriteUInt32(stream, instance.ClientProcessId.GetSerializedSize());
         ProcessId.Serialize(stream, instance.ClientProcessId);
     }
 }
Esempio n. 6
0
        public static void Serialize(Stream stream, SendChallengeToUserRequest instance)
        {
            BinaryWriter binaryWriter = new BinaryWriter(stream);

            if (instance.HasPeerId)
            {
                stream.WriteByte(10);
                ProtocolParser.WriteUInt32(stream, instance.PeerId.GetSerializedSize());
                ProcessId.Serialize(stream, instance.PeerId);
            }
            if (instance.HasGameAccountId)
            {
                stream.WriteByte(18);
                ProtocolParser.WriteUInt32(stream, instance.GameAccountId.GetSerializedSize());
                EntityId.Serialize(stream, instance.GameAccountId);
            }
            if (instance.Challenges.get_Count() > 0)
            {
                using (List <Challenge> .Enumerator enumerator = instance.Challenges.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        Challenge current = enumerator.get_Current();
                        stream.WriteByte(26);
                        ProtocolParser.WriteUInt32(stream, current.GetSerializedSize());
                        Challenge.Serialize(stream, current);
                    }
                }
            }
            stream.WriteByte(37);
            binaryWriter.Write(instance.Context);
            if (instance.HasTimeout)
            {
                stream.WriteByte(40);
                ProtocolParser.WriteUInt64(stream, instance.Timeout);
            }
            if (instance.Attributes.get_Count() > 0)
            {
                using (List <Attribute> .Enumerator enumerator2 = instance.Attributes.GetEnumerator())
                {
                    while (enumerator2.MoveNext())
                    {
                        Attribute current2 = enumerator2.get_Current();
                        stream.WriteByte(50);
                        ProtocolParser.WriteUInt32(stream, current2.GetSerializedSize());
                        Attribute.Serialize(stream, current2);
                    }
                }
            }
        }
Esempio n. 7
0
 public static void Serialize(Stream stream, ConnectRequest instance)
 {
     if (instance.HasClientId)
     {
         stream.WriteByte(10);
         ProtocolParser.WriteUInt32(stream, instance.ClientId.GetSerializedSize());
         ProcessId.Serialize(stream, instance.ClientId);
     }
     if (instance.HasBindRequest)
     {
         stream.WriteByte(18);
         ProtocolParser.WriteUInt32(stream, instance.BindRequest.GetSerializedSize());
         BindRequest.Serialize(stream, instance.BindRequest);
     }
 }
Esempio n. 8
0
 public static void Serialize(Stream stream, GameAccountOfflineNotification instance)
 {
     if (instance.GameAccountId == null)
     {
         throw new ArgumentNullException("GameAccountId", "Required by proto specification.");
     }
     stream.WriteByte(10);
     ProtocolParser.WriteUInt32(stream, instance.GameAccountId.GetSerializedSize());
     EntityId.Serialize(stream, instance.GameAccountId);
     if (instance.HasHost)
     {
         stream.WriteByte(18);
         ProtocolParser.WriteUInt32(stream, instance.Host.GetSerializedSize());
         ProcessId.Serialize(stream, instance.Host);
     }
 }
 public static void Serialize(Stream stream, GetPlayerVariablesRequest instance)
 {
     if (instance.PlayerVariables.Count > 0)
     {
         foreach (PlayerVariables playerVariables in instance.PlayerVariables)
         {
             stream.WriteByte(10);
             ProtocolParser.WriteUInt32(stream, playerVariables.GetSerializedSize());
             bnet.protocol.game_utilities.PlayerVariables.Serialize(stream, playerVariables);
         }
     }
     if (instance.HasHost)
     {
         stream.WriteByte(18);
         ProtocolParser.WriteUInt32(stream, instance.Host.GetSerializedSize());
         ProcessId.Serialize(stream, instance.Host);
     }
 }
Esempio n. 10
0
        public static void Serialize(Stream stream, SendChallengeToUserRequest instance)
        {
            BinaryWriter binaryWriter = new BinaryWriter(stream);

            if (instance.HasPeerId)
            {
                stream.WriteByte(10);
                ProtocolParser.WriteUInt32(stream, instance.PeerId.GetSerializedSize());
                ProcessId.Serialize(stream, instance.PeerId);
            }
            if (instance.HasGameAccountId)
            {
                stream.WriteByte(18);
                ProtocolParser.WriteUInt32(stream, instance.GameAccountId.GetSerializedSize());
                EntityId.Serialize(stream, instance.GameAccountId);
            }
            if (instance.Challenges.Count > 0)
            {
                foreach (Challenge challenge in instance.Challenges)
                {
                    stream.WriteByte(26);
                    ProtocolParser.WriteUInt32(stream, challenge.GetSerializedSize());
                    Challenge.Serialize(stream, challenge);
                }
            }
            stream.WriteByte(37);
            binaryWriter.Write(instance.Context);
            if (instance.HasTimeout)
            {
                stream.WriteByte(40);
                ProtocolParser.WriteUInt64(stream, instance.Timeout);
            }
            if (instance.Attributes.Count > 0)
            {
                foreach (bnet.protocol.attribute.Attribute attribute in instance.Attributes)
                {
                    stream.WriteByte(50);
                    ProtocolParser.WriteUInt32(stream, attribute.GetSerializedSize());
                    bnet.protocol.attribute.Attribute.Serialize(stream, attribute);
                }
            }
        }
        public static void Serialize(Stream stream, ServerInfo instance)
        {
            BinaryWriter binaryWriter = new BinaryWriter(stream);

            if (instance.Host == null)
            {
                throw new ArgumentNullException("Host", "Required by proto specification.");
            }
            stream.WriteByte(10);
            ProtocolParser.WriteUInt32(stream, instance.Host.GetSerializedSize());
            ProcessId.Serialize(stream, instance.Host);
            if (instance.HasReplace)
            {
                stream.WriteByte(16);
                ProtocolParser.WriteBool(stream, instance.Replace);
            }
            if (instance.HasState)
            {
                stream.WriteByte(26);
                ProtocolParser.WriteUInt32(stream, instance.State.GetSerializedSize());
                ServerState.Serialize(stream, instance.State);
            }
            if (instance.Attribute.get_Count() > 0)
            {
                using (List <Attribute> .Enumerator enumerator = instance.Attribute.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        Attribute current = enumerator.get_Current();
                        stream.WriteByte(34);
                        ProtocolParser.WriteUInt32(stream, current.GetSerializedSize());
                        bnet.protocol.attribute.Attribute.Serialize(stream, current);
                    }
                }
            }
            if (instance.HasProgramId)
            {
                stream.WriteByte(45);
                binaryWriter.Write(instance.ProgramId);
            }
        }
Esempio n. 12
0
        public static void Serialize(Stream stream, ServerRequest instance)
        {
            BinaryWriter binaryWriter = new BinaryWriter(stream);

            if (instance.Attribute.Count > 0)
            {
                foreach (bnet.protocol.attribute.Attribute attribute in instance.Attribute)
                {
                    stream.WriteByte(10);
                    ProtocolParser.WriteUInt32(stream, attribute.GetSerializedSize());
                    bnet.protocol.attribute.Attribute.Serialize(stream, attribute);
                }
            }
            stream.WriteByte(21);
            binaryWriter.Write(instance.Program);
            if (instance.HasHost)
            {
                stream.WriteByte(26);
                ProtocolParser.WriteUInt32(stream, instance.Host.GetSerializedSize());
                ProcessId.Serialize(stream, instance.Host);
            }
        }
 public static void Serialize(Stream stream, GetPlayerVariablesRequest instance)
 {
     if (instance.PlayerVariables.get_Count() > 0)
     {
         using (List <PlayerVariables> .Enumerator enumerator = instance.PlayerVariables.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 PlayerVariables current = enumerator.get_Current();
                 stream.WriteByte(10);
                 ProtocolParser.WriteUInt32(stream, current.GetSerializedSize());
                 bnet.protocol.game_utilities.PlayerVariables.Serialize(stream, current);
             }
         }
     }
     if (instance.HasHost)
     {
         stream.WriteByte(18);
         ProtocolParser.WriteUInt32(stream, instance.Host.GetSerializedSize());
         ProcessId.Serialize(stream, instance.Host);
     }
 }
Esempio n. 14
0
 public static void Serialize(Stream stream, ConnectResponse instance)
 {
     if (instance.ServerId == null)
     {
         throw new ArgumentNullException("ServerId", "Required by proto specification.");
     }
     stream.WriteByte(10);
     ProtocolParser.WriteUInt32(stream, instance.ServerId.GetSerializedSize());
     ProcessId.Serialize(stream, instance.ServerId);
     if (instance.HasClientId)
     {
         stream.WriteByte(18);
         ProtocolParser.WriteUInt32(stream, instance.ClientId.GetSerializedSize());
         ProcessId.Serialize(stream, instance.ClientId);
     }
     if (instance.HasBindResult)
     {
         stream.WriteByte(24);
         ProtocolParser.WriteUInt32(stream, instance.BindResult);
     }
     if (instance.HasBindResponse)
     {
         stream.WriteByte(34);
         ProtocolParser.WriteUInt32(stream, instance.BindResponse.GetSerializedSize());
         bnet.protocol.connection.BindResponse.Serialize(stream, instance.BindResponse);
     }
     if (instance.HasContentHandleArray)
     {
         stream.WriteByte(42);
         ProtocolParser.WriteUInt32(stream, instance.ContentHandleArray.GetSerializedSize());
         ConnectionMeteringContentHandles.Serialize(stream, instance.ContentHandleArray);
     }
     if (instance.HasServerTime)
     {
         stream.WriteByte(48);
         ProtocolParser.WriteUInt64(stream, instance.ServerTime);
     }
 }
Esempio n. 15
0
        public static void Serialize(Stream stream, ServerInfo instance)
        {
            BinaryWriter binaryWriter = new BinaryWriter(stream);

            if (instance.Host == null)
            {
                throw new ArgumentNullException("Host", "Required by proto specification.");
            }
            stream.WriteByte(10);
            ProtocolParser.WriteUInt32(stream, instance.Host.GetSerializedSize());
            ProcessId.Serialize(stream, instance.Host);
            if (instance.HasReplace)
            {
                stream.WriteByte(16);
                ProtocolParser.WriteBool(stream, instance.Replace);
            }
            if (instance.HasState)
            {
                stream.WriteByte(26);
                ProtocolParser.WriteUInt32(stream, instance.State.GetSerializedSize());
                ServerState.Serialize(stream, instance.State);
            }
            if (instance.Attribute.Count > 0)
            {
                foreach (bnet.protocol.attribute.Attribute attribute in instance.Attribute)
                {
                    stream.WriteByte(34);
                    ProtocolParser.WriteUInt32(stream, attribute.GetSerializedSize());
                    bnet.protocol.attribute.Attribute.Serialize(stream, attribute);
                }
            }
            if (instance.HasProgramId)
            {
                stream.WriteByte(45);
                binaryWriter.Write(instance.ProgramId);
            }
        }