/// <summary> /// UpdateIndex entry received /// </summary> /// <param name="stream"></param> private void SC_DataUpdateEntry(PacketStream stream) { string name = stream.ReadString(); string fileHash = stream.ReadString(); UpdateHandler.Instance.OnDataEntryReceived(name, fileHash); }
private void SC_ResourceUpdateEntry(PacketStream stream) { string name = stream.ReadString(); string fileHash = stream.ReadString(); bool delete = stream.ReadBool(); UpdateHandler.Instance.OnResourceEntryReceived(name, fileHash, delete); }
/// <summary> /// UpdateIndex entry received /// </summary> /// <param name="stream"></param> private void SC_UpdateIndex(PacketStream stream) { string name = stream.ReadString(); string fileHash = stream.ReadString(); bool isLegacy = stream.ReadBool(); bool isDelete = stream.ReadBool(); UpdateHandler.Instance.OnUpdateIndexReceived(name, fileHash, isLegacy); }
private void SC_UpdateDateTime(PacketStream stream) { string dateString = stream.ReadString(); DateTime time = DateTime.Parse(dateString, CultureInfo.InvariantCulture); UpdateHandler.Instance.OnUpdateDateTimeReceived(time); }
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_ReceiveEOF(PacketStream stream) { string fileName = stream.ReadString(); string filePath = String.Format(@"{0}\Downloads\{1}", Directory.GetCurrentDirectory(), fileName); if (File.Exists(filePath)) { File.Delete(filePath); } GUI.Instance.UpdateProgressValue(1, tempBuffer.Length); using (FileStream fs = new FileStream(filePath, FileMode.Create)) { fs.Write(tempBuffer, 0, tempBuffer.Length); } UpdateHandler.Instance.OnFileTransfered(fileName); }
private void SC_UpdateSelfUpdate(PacketStream stream) { UpdateHandler.Instance.ExecuteSelfUpdate(stream.ReadString()); }
private void SC_DesKey(PacketStream stream) { GUI.Instance.OnDesKeyReceived(stream.ReadString()); }