Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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"); }
 }
Esempio n. 4
0
        private void SC_UserValidated(PacketStream stream)
        {
            int    otpLength = stream.ReadInt32();
            string otpHash   = desCipher.Decrypt(stream.ReadBytes(otpLength));

            GUI.Instance.OnValidationResultReceived(otpHash);
        }
Esempio n. 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);
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 7
0
 private void SC_AuthenticationType(PacketStream stream)
 {
     GUI.Instance.OnAuthenticationTypeReceived(stream.ReadInt32());
 }
Esempio n. 8
0
 private void SC_ReceiveWait(PacketStream stream)
 {
     // ushort packetID (to resend)
     // int period (to wait)
     UpdateHandler.Instance.OnWaitReceived(stream.ReadUInt16(), stream.ReadInt32());
 }
Esempio n. 9
0
 private void SC_ReceiveUpdatesDisabled(PacketStream stream)
 {
     GUI.Instance.OnUpdatesEnabledReceived(stream.ReadInt32());
 }
Esempio n. 10
0
 private void SC_ReceiveSendType(PacketStream stream)
 {
     UpdateHandler.Instance.OnSendTypeReceived(stream.ReadInt32());
 }
Esempio n. 11
0
 private void SC_UserBanned(PacketStream stream)
 {
     GUI.Instance.OnUserBannedReceived(stream.ReadInt32());
 }