/// <summary>
        ///     Serializes the payload of this message to a memory buffer.
        /// </summary>
        /// <param name="serializer">Serializer to read/write payload to.</param>
        protected override void SerializePayload(NetMessageSerializer serializer)
        {
            serializer.SerializeList(ref CandidateManifestIds);

            if (serializer.Version > 100000560)
            {
                serializer.SerializeEnum <ManifestStorageHeuristic>(ref Heuristic);
            }

            if (serializer.Version >= 100000603)
            {
                serializer.SerializeList(ref PrioritizeKeepingTagIds);
                serializer.SerializeList(ref PrioritizeDeletingTagIds);
            }
        }
 /// <summary>
 ///     Serializes the payload of this message to a memory buffer.
 /// </summary>
 /// <param name="serializer">Serializer to read/write payload to.</param>
 protected override void SerializePayload(NetMessageSerializer serializer)
 {
     serializer.Serialize(ref ManifestId);
     serializer.SerializeEnum(ref Result);
 }
Exemplo n.º 3
0
        /// <summary>
        ///     Serializes the payload of this message to a memory buffer.
        /// </summary>
        /// <param name="serializer">Serializer to read/write payload to.</param>
        protected override void SerializePayload(NetMessageSerializer serializer)
        {
            serializer.Serialize(ref BandwidthLimit);

            int Count = ClientStates.Count;

            serializer.Serialize(ref Count);

            for (int i = 0; i < Count; i++)
            {
                if (serializer.IsLoading)
                {
                    ClientStates.Add(new ClientState());
                }

                if (serializer.Version > 100000584)
                {
                    serializer.Serialize(ref ClientStates[i].Username);
                }
                if (serializer.Version >= 100000690)
                {
                    serializer.Serialize(ref ClientStates[i].MachineName);
                }

                serializer.Serialize(ref ClientStates[i].Address);
                serializer.Serialize(ref ClientStates[i].DownloadRate);
                serializer.Serialize(ref ClientStates[i].UploadRate);
                serializer.Serialize(ref ClientStates[i].TotalDownloaded);
                serializer.Serialize(ref ClientStates[i].TotalUploaded);
                serializer.Serialize(ref ClientStates[i].ConnectedPeerCount);
                serializer.Serialize(ref ClientStates[i].DiskUsage);
                serializer.Serialize(ref ClientStates[i].Version);

                if (serializer.Version >= 100000613)
                {
                    serializer.Serialize(ref ClientStates[i].DiskQuota);
                }

                int TagCount = ClientStates[i].TagIds.Count;
                serializer.Serialize(ref TagCount);

                for (int j = 0; j < TagCount; j++)
                {
                    if (serializer.IsLoading)
                    {
                        ClientStates[i].TagIds.Add(new Guid());
                    }

                    Guid id = ClientStates[i].TagIds[j];
                    serializer.Serialize(ref id);
                    ClientStates[i].TagIds[j] = id;
                }
            }

            if (serializer.Version > 100000689)
            {
                Count = InstallStates.Count;
                serializer.Serialize(ref Count);

                for (int i = 0; i < Count; i++)
                {
                    if (serializer.IsLoading)
                    {
                        InstallStates.Add(new RemoteInstallState());
                    }

                    serializer.SerializeEnum(ref InstallStates[i].Type);
                    serializer.Serialize(ref InstallStates[i].Requester);
                    serializer.Serialize(ref InstallStates[i].AssignedTo);
                    serializer.Serialize(ref InstallStates[i].Progress);
                    serializer.Serialize(ref InstallStates[i].ProgressText);
                    serializer.Serialize(ref InstallStates[i].Id);
                }
            }
        }
 /// <summary>
 ///     Serializes the payload of this message to a memory buffer.
 /// </summary>
 /// <param name="serializer">Serializer to read/write payload to.</param>
 protected override void SerializePayload(NetMessageSerializer serializer)
 {
     serializer.Serialize(ref ActionId);
     serializer.SerializeEnum(ref Type);
     serializer.Serialize(ref Settings);
 }
 /// <summary>
 ///     Serializes the payload of this message to a memory buffer.
 /// </summary>
 /// <param name="serializer">Serializer to read/write payload to.</param>
 protected override void SerializePayload(NetMessageSerializer serializer)
 {
     serializer.Serialize(ref GroupName);
     serializer.SerializeEnum(ref PermissionType);
     serializer.Serialize(ref PermissionPath);
 }
Exemplo n.º 6
0
 /// <summary>
 ///     Serializes the payload of this message to a memory buffer.
 /// </summary>
 /// <param name="serializer">Serializer to read/write payload to.</param>
 protected override void SerializePayload(NetMessageSerializer serializer)
 {
     serializer.SerializeEnum(ref ResultType);
 }