예제 #1
0
        private void SC_UserValidated(PacketStream stream)
        {
            int    otpLength = stream.ReadInt32();
            string otpHash   = desCipher.Decrypt(stream.ReadBytes(otpLength));

            GUI.Instance.OnValidationResultReceived(otpHash);
        }
예제 #2
0
        private void SC_ReceiveArguments(PacketStream stream)
        {
            int len = stream.ReadInt32();

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

            GUI.Instance.OnArgumentsReceived(DesCipher.Decrypt(arguments));
        }
예제 #3
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);
        }
예제 #4
0
        private void SC_ReceiveArguments(PacketStream stream)
        {
            int len = stream.ReadInt32();

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

            GUI.Instance.OnArgumentsReceived(desCipher.Decrypt(arguments), startType, isMaintenance);
        }
예제 #5
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"); }
 }