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(); GUI.Instance.OnArgumentsReceived(desCipher.Decrypt(arguments), startType); }
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"); } }
private void SC_UserValidated(PacketStream stream) { int otpLength = stream.ReadInt32(); string otpHash = desCipher.Decrypt(stream.ReadBytes(otpLength)); GUI.Instance.OnValidationResultReceived(otpHash); }
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); } }
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); } }
private void SC_AuthenticationType(PacketStream stream) { GUI.Instance.OnAuthenticationTypeReceived(stream.ReadInt32()); }
private void SC_ReceiveWait(PacketStream stream) { // ushort packetID (to resend) // int period (to wait) UpdateHandler.Instance.OnWaitReceived(stream.ReadUInt16(), stream.ReadInt32()); }
private void SC_ReceiveUpdatesDisabled(PacketStream stream) { GUI.Instance.OnUpdatesEnabledReceived(stream.ReadInt32()); }
private void SC_ReceiveSendType(PacketStream stream) { UpdateHandler.Instance.OnSendTypeReceived(stream.ReadInt32()); }
private void SC_UserBanned(PacketStream stream) { GUI.Instance.OnUserBannedReceived(stream.ReadInt32()); }