diff --git a/ShiftOS.Server/ChatBackend.cs b/ShiftOS.Server/ChatBackend.cs index b4fa4a5..a7b8462 100644 --- a/ShiftOS.Server/ChatBackend.cs +++ b/ShiftOS.Server/ChatBackend.cs @@ -36,6 +36,11 @@ namespace ShiftOS.Server await client.ConnectAsync(); await client.SetGameAsync("ShiftOS"); await client.SetStatusAsync(UserStatus.Online); + //Get the Discord channel for this chat. + var Chan = client.GetChannel(Convert.ToUInt64(chat.DiscordChannelID)) as ISocketMessageChannel; + //Relay the message to Discord. + await Chan.SendMessageAsync("**Hello! Multi-user domain is online.**"); + client.MessageReceived += async (s) => { if (chatKilled == false) @@ -64,7 +69,7 @@ namespace ShiftOS.Server //Get the Discord channel for this chat. var dChan = client.GetChannel(Convert.ToUInt64(chat.DiscordChannelID)) as ISocketMessageChannel; //Relay the message to Discord. - dChan.SendMessageAsync($"**[{msg.Username}@{msg.SystemName}] ` {msg.Message}"); + dChan.SendMessageAsync($"**[{msg.Username}@{msg.SystemName}]** `` {msg.Message}"); } //Relay it back to all MUD clients. diff --git a/ShiftOS.Server/LegionManager.cs b/ShiftOS.Server/LegionManager.cs index 2911da2..452b216 100644 --- a/ShiftOS.Server/LegionManager.cs +++ b/ShiftOS.Server/LegionManager.cs @@ -20,7 +20,7 @@ namespace ShiftOS.Server if (File.Exists("legions.json")) legions = JsonConvert.DeserializeObject>(File.ReadAllText("legions.json")); - var l = JsonConvert.DeserializeObject(contents as string); + var l = JsonConvert.DeserializeObject(JsonConvert.SerializeObject(contents)); bool legionExists = false; foreach (var legion in legions) @@ -52,7 +52,7 @@ namespace ShiftOS.Server } - [MudRequest("legion_getall")] + [MudRequest("legion_get_all")] public static void GetAllLegions(string guid, object contents) { List allLegions = new List(); @@ -72,7 +72,7 @@ namespace ShiftOS.Server [MudRequest("legion_get_users")] public static void GetLegionUsers(string guid, object contents) { - var lgn = JsonConvert.DeserializeObject(contents as string); + var lgn = JsonConvert.DeserializeObject(JsonConvert.SerializeObject(contents)); List userIDs = new List(); @@ -101,7 +101,7 @@ namespace ShiftOS.Server [MudRequest("user_get_legion")] public static void GetUserLegion(string guid, object contents) { - var userSave = JsonConvert.DeserializeObject(contents as string); + var userSave = JsonConvert.DeserializeObject(JsonConvert.SerializeObject(contents)); if (File.Exists("legions.json")) {