Esempio n. 1
0
        /// <summary>
        /// UpdateIndex entry received
        /// </summary>
        /// <param name="stream"></param>
        private void SC_DataUpdateEntry(PacketStream stream)
        {
            string name     = stream.ReadString();
            string fileHash = stream.ReadString();

            UpdateHandler.Instance.OnDataEntryReceived(name, fileHash);
        }
Esempio n. 2
0
        private void SC_ResourceUpdateEntry(PacketStream stream)
        {
            string name     = stream.ReadString();
            string fileHash = stream.ReadString();
            bool   delete   = stream.ReadBool();

            UpdateHandler.Instance.OnResourceEntryReceived(name, fileHash, delete);
        }
Esempio n. 3
0
        /// <summary>
        /// UpdateIndex entry received
        /// </summary>
        /// <param name="stream"></param>
        private void SC_UpdateIndex(PacketStream stream)
        {
            string name     = stream.ReadString();
            string fileHash = stream.ReadString();
            bool   isLegacy = stream.ReadBool();
            bool   isDelete = stream.ReadBool();

            UpdateHandler.Instance.OnUpdateIndexReceived(name, fileHash, isLegacy);
        }
Esempio n. 4
0
        private void SC_UpdateDateTime(PacketStream stream)
        {
            string   dateString = stream.ReadString();
            DateTime time       = DateTime.Parse(dateString, CultureInfo.InvariantCulture);

            UpdateHandler.Instance.OnUpdateDateTimeReceived(time);
        }
Esempio n. 5
0
        private void SC_ReceiveFileInfo(PacketStream stream)
        {
            string tmpName  = stream.ReadString();
            int    fileSize = stream.ReadInt32();

            if (fileSize > 0)
            {
                tempBuffer = new byte[fileSize];
                GUI.Instance.UpdateProgressMaximum(1, fileSize);
                GUI.Instance.UpdateProgressValue(1, 0);
                UpdateHandler.Instance.OnFileInfoReceived(tmpName);
            }
        }
Esempio n. 6
0
        private void SC_ReceiveEOF(PacketStream stream)
        {
            string fileName = stream.ReadString();
            string filePath = String.Format(@"{0}\Downloads\{1}", Directory.GetCurrentDirectory(), fileName);

            if (File.Exists(filePath))
            {
                File.Delete(filePath);
            }

            GUI.Instance.UpdateProgressValue(1, tempBuffer.Length);

            using (FileStream fs = new FileStream(filePath, FileMode.Create)) { fs.Write(tempBuffer, 0, tempBuffer.Length); }

            UpdateHandler.Instance.OnFileTransfered(fileName);
        }
Esempio n. 7
0
 private void SC_UpdateSelfUpdate(PacketStream stream)
 {
     UpdateHandler.Instance.ExecuteSelfUpdate(stream.ReadString());
 }
Esempio n. 8
0
 private void SC_DesKey(PacketStream stream)
 {
     GUI.Instance.OnDesKeyReceived(stream.ReadString());
 }