Пример #1
0
        private void SC_ReceiveFile(PacketStream stream)
        {
            int chunkSize = stream.ReadInt32();
            int offset    = stream.ReadInt32();

            byte[] chunks = stream.ReadBytes(chunkSize);
            Buffer.BlockCopy(chunks, 0, tempBuffer, offset, chunkSize);
            GUI.Instance.UpdateProgressValue(1, offset);
        }
Пример #2
0
        private void SC_ReceiveArguments(PacketStream stream)
        {
            int len = stream.ReadInt32();

            byte[] arguments = stream.ReadBytes(len);
            int    startType = stream.ReadInt32();

            GUI.Instance.OnArgumentsReceived(desCipher.Decrypt(arguments), startType);
        }
Пример #3
0
 private void SC_ReceiveFile(PacketStream stream)
 {
     try
     {
         int    chunkSize = stream.ReadInt32();
         int    offset    = stream.ReadInt32();
         byte[] chunks    = stream.ReadBytes(chunkSize);
         Buffer.BlockCopy(chunks, 0, tempBuffer, offset, chunkSize);
         GUI.Instance.UpdateProgressValue(1, offset);
     }
     catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.ToString(), "SC_ReceiveFile Exception"); }
 }
Пример #4
0
        private void SC_UserValidated(PacketStream stream)
        {
            int    otpLength = stream.ReadInt32();
            string otpHash   = desCipher.Decrypt(stream.ReadBytes(otpLength));

            GUI.Instance.OnValidationResultReceived(otpHash);
        }
Пример #5
0
        private void SC_ReceiveFileSize(PacketStream stream)
        {
            int fileSize = stream.ReadInt32();

            if (fileSize > 0)
            {
                tempBuffer = new byte[fileSize];
                GUI.Instance.UpdateProgressMaximum(1, fileSize);
                GUI.Instance.UpdateProgressValue(1, 0);
            }
        }
Пример #6
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);
            }
        }
Пример #7
0
 private void SC_AuthenticationType(PacketStream stream)
 {
     GUI.Instance.OnAuthenticationTypeReceived(stream.ReadInt32());
 }
Пример #8
0
 private void SC_ReceiveWait(PacketStream stream)
 {
     // ushort packetID (to resend)
     // int period (to wait)
     UpdateHandler.Instance.OnWaitReceived(stream.ReadUInt16(), stream.ReadInt32());
 }
Пример #9
0
 private void SC_ReceiveUpdatesDisabled(PacketStream stream)
 {
     GUI.Instance.OnUpdatesEnabledReceived(stream.ReadInt32());
 }
Пример #10
0
 private void SC_ReceiveSendType(PacketStream stream)
 {
     UpdateHandler.Instance.OnSendTypeReceived(stream.ReadInt32());
 }
Пример #11
0
 private void SC_UserBanned(PacketStream stream)
 {
     GUI.Instance.OnUserBannedReceived(stream.ReadInt32());
 }