diff options
| author | Michael <[email protected]> | 2017-02-02 17:11:14 -0500 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-02-02 17:11:14 -0500 |
| commit | d5ab22629ba39ac9f0fae6768b527e82670f96fc (patch) | |
| tree | 49218d165b993edb47187b64d7ee932f108e442b /ShiftOS.Server/Program.cs | |
| parent | 44c1e66dd09d39773e329f138d11946e516a5308 (diff) | |
| download | shiftos_thereturn-d5ab22629ba39ac9f0fae6768b527e82670f96fc.tar.gz shiftos_thereturn-d5ab22629ba39ac9f0fae6768b527e82670f96fc.tar.bz2 shiftos_thereturn-d5ab22629ba39ac9f0fae6768b527e82670f96fc.zip | |
Implement the Downloader
Diffstat (limited to 'ShiftOS.Server/Program.cs')
| -rw-r--r-- | ShiftOS.Server/Program.cs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ShiftOS.Server/Program.cs b/ShiftOS.Server/Program.cs index 138764f..c0c27ed 100644 --- a/ShiftOS.Server/Program.cs +++ b/ShiftOS.Server/Program.cs @@ -655,6 +655,29 @@ Contents: } break; + case "download_start": + if (File.Exists(msg.Contents)) + { + server.DispatchTo(new Guid(msg.GUID), new NetObject("download", new ServerMessage + { + Name = "download_meta", + GUID = "server", + Contents = JsonConvert.SerializeObject(File.ReadAllBytes(msg.Contents)) + })); + } + else + { + server.DispatchTo(new Guid(msg.GUID), new NetObject("shiftnet_got", new ServerMessage + { + Name = "shiftnet_file", + GUID = "server", + Contents = (File.Exists("notfound.md") == true) ? File.ReadAllText("notfound.md") : @"# Not found. + +The page you requested at was not found on this multi-user domain." + })); + + } + break; case "shiftnet_get": string surl = args["url"] as string; while (surl.EndsWith("/")) |
