mirror of
https://git.alee14.me/shiftos-archive/ShiftOS_TheReturn.git
synced 2025-02-02 06:17:34 +00:00
server-side fixes for legions
This commit is contained in:
parent
7c486bbe0b
commit
09aaca5d88
2 changed files with 10 additions and 5 deletions
|
@ -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}] `<mud/{msg.Channel}> {msg.Message}");
|
||||
dChan.SendMessageAsync($"**[{msg.Username}@{msg.SystemName}]** `<mud/{msg.Channel}>` {msg.Message}");
|
||||
|
||||
}
|
||||
//Relay it back to all MUD clients.
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace ShiftOS.Server
|
|||
if (File.Exists("legions.json"))
|
||||
legions = JsonConvert.DeserializeObject<List<Legion>>(File.ReadAllText("legions.json"));
|
||||
|
||||
var l = JsonConvert.DeserializeObject<Legion>(contents as string);
|
||||
var l = JsonConvert.DeserializeObject<Legion>(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<Legion> allLegions = new List<Legion>();
|
||||
|
@ -72,7 +72,7 @@ namespace ShiftOS.Server
|
|||
[MudRequest("legion_get_users")]
|
||||
public static void GetLegionUsers(string guid, object contents)
|
||||
{
|
||||
var lgn = JsonConvert.DeserializeObject<Legion>(contents as string);
|
||||
var lgn = JsonConvert.DeserializeObject<Legion>(JsonConvert.SerializeObject(contents));
|
||||
|
||||
List<string> userIDs = new List<string>();
|
||||
|
||||
|
@ -101,7 +101,7 @@ namespace ShiftOS.Server
|
|||
[MudRequest("user_get_legion")]
|
||||
public static void GetUserLegion(string guid, object contents)
|
||||
{
|
||||
var userSave = JsonConvert.DeserializeObject<Save>(contents as string);
|
||||
var userSave = JsonConvert.DeserializeObject<Save>(JsonConvert.SerializeObject(contents));
|
||||
|
||||
if (File.Exists("legions.json"))
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue