diff options
| author | Michael <[email protected]> | 2017-02-02 09:47:23 -0500 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-02-02 09:47:23 -0500 |
| commit | bbe37edb68f9e7535216bff80ba3e6b16cbca398 (patch) | |
| tree | 4382859eda0c253e17966159890f49208a41367f /ShiftOS.Server | |
| parent | d8978b860d950e3ccde3c8beecf8b88bdd4a34a8 (diff) | |
| download | shiftos_thereturn-bbe37edb68f9e7535216bff80ba3e6b16cbca398.tar.gz shiftos_thereturn-bbe37edb68f9e7535216bff80ba3e6b16cbca398.tar.bz2 shiftos_thereturn-bbe37edb68f9e7535216bff80ba3e6b16cbca398.zip | |
Shiftnet, and audio fixes
Diffstat (limited to 'ShiftOS.Server')
| -rw-r--r-- | ShiftOS.Server/Program.cs | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/ShiftOS.Server/Program.cs b/ShiftOS.Server/Program.cs index e6c3a3f..138764f 100644 --- a/ShiftOS.Server/Program.cs +++ b/ShiftOS.Server/Program.cs @@ -654,8 +654,45 @@ Contents: } } - break; + case "shiftnet_get": + string surl = args["url"] as string; + while (surl.EndsWith("/")) + { + surl = surl.Remove(surl.Length - 1, 1); + } + if (File.Exists(surl)) + { + server.DispatchTo(new Guid(msg.GUID), new NetObject("shiftnet_got", new ServerMessage + { + Name = "shiftnet_file", + GUID = "server", + Contents = File.ReadAllText(surl) + })); + } + else if (File.Exists(surl + "/home.rnp")) + { + server.DispatchTo(new Guid(msg.GUID), new NetObject("shiftnet_got", new ServerMessage + { + Name = "shiftnet_file", + GUID = "server", + Contents = File.ReadAllText(surl + "/home.rnp") + })); + + } + 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 "mud_scanvirus": Dictionary<string, string> _virusDB = new Dictionary<string, string>(); |
