From ea430ac9df46cf01c8c4f8502097057a8da42600 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 9 Mar 2017 10:33:44 -0500 Subject: [PATCH] mud diagnostics and user info --- ShiftOS_TheReturn/Scripting.cs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/ShiftOS_TheReturn/Scripting.cs b/ShiftOS_TheReturn/Scripting.cs index b3e5208..bb65dc7 100644 --- a/ShiftOS_TheReturn/Scripting.cs +++ b/ShiftOS_TheReturn/Scripting.cs @@ -354,6 +354,35 @@ end"); } } + [Exposed("mud")] + public class MUDFunctions + { + public void sendDiagnostic(string src, string cat, object val) + { + ServerManager.SendMessage("diag_log", $"[{src}] <{cat}>: {val}"); + } + } + + [Exposed("userinfo")] + public class UserInfoFunctions + { + public string getUsername() + { + return SaveSystem.CurrentSave.Username; + } + + public string getSysname() + { + return SaveSystem.CurrentSave.SystemName; + } + + public string getEmail() + { + return getUsername() + "@" + getSysname(); + } + } + + [Exposed("infobox")] public class InfoboxFunctions {