Allow forwarding of messages to other clients.

This commit is contained in:
Michael VanOverbeek 2017-05-03 18:10:11 +00:00
parent 24f04e3e12
commit 3665e07361

View file

@ -38,6 +38,37 @@ namespace ShiftOS.Server
{
public static class Core
{
[MudRequest("mud_forward", typeof(ServerMessage))]
public static void ForwardMessage(string guid, ServerMessage message)
{
if (message.GUID == "all")
{
Server.Program.server.DispatchAll(new NetObject("forward", new ServerMessage
{
Name = "forward",
GUID = "Server",
Contents = JsonConvert.SerializeObject(message)
}));
}
else
{
try
{
Server.Program.server.DispatchTo(new Guid(message.GUID), new NetObject("forward", new ServerMessage
{
Name = "forward",
GUID = "Server",
Contents = JsonConvert.SerializeObject(message)
}));
}
catch
{
}
}
}
[MudRequest("getguid_reply", typeof(string))]
public static void GuidBounce(string guid, object contents)
{