mirror of
https://git.alee14.me/shiftos-archive/ShiftOS_TheReturn.git
synced 2025-01-22 18:02:16 +00:00
Allow forwarding of messages to other clients.
This commit is contained in:
parent
24f04e3e12
commit
3665e07361
1 changed files with 31 additions and 0 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue