private void SC_UserValidated(PacketStream stream) { int otpLength = stream.ReadInt32(); string otpHash = desCipher.Decrypt(stream.ReadBytes(otpLength)); GUI.Instance.OnValidationResultReceived(otpHash); }
private void SC_ReceiveArguments(PacketStream stream) { int len = stream.ReadInt32(); byte[] arguments = stream.ReadBytes(len); GUI.Instance.OnArgumentsReceived(DesCipher.Decrypt(arguments)); }
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); }
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); }
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"); } }