private TcpPacket HandleReturnFileList(TcpPacket tcpPacket, FileServerState state) { using (var reader = tcpPacket.GetPayloadBufferReader()) { var json = reader.ReadString(); var files = JsonConvert.DeserializeObject <List <FileDetails> >(json); this.settings.FileServerMetaStorage.StoreFileList(state.ID, files); } return(null); }
private TcpPacket HandleReturnDownloadEndPoint(TcpPacket tcpPacket, FileServerState state) { using (var reader = tcpPacket.GetPayloadBufferReader()) { var ip = reader.ReadString(); var port = reader.ReadInt32(); this.settings.FileServerMetaStorage.StorageDownloadEndPoint(state.ID, ip, port); } return(null); }
private TcpPacket HandleReturnFileList(TcpPacket tcpPacket, MasterServerState state) { using (var reader = tcpPacket.GetPayloadBufferReader()) { var json = reader.ReadString(); var fileList = JsonConvert.DeserializeObject <List <FileDetailsWithDownloadEndPoint> >(json); this.FileListReceived?.Invoke(this, new FileListReceivedArgs() { FileList = fileList }); } return(null); }