From 8e2b00840a6a16a6da1eb4891a8364158884f0a8 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 11 Feb 2017 11:48:26 -0500 Subject: MUD modularization work. --- ShiftOS.Objects/MudAttributes.cs | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 ShiftOS.Objects/MudAttributes.cs (limited to 'ShiftOS.Objects/MudAttributes.cs') diff --git a/ShiftOS.Objects/MudAttributes.cs b/ShiftOS.Objects/MudAttributes.cs new file mode 100644 index 0000000..b3b7380 --- /dev/null +++ b/ShiftOS.Objects/MudAttributes.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using attribute = System.Attribute; + +namespace ShiftOS.Objects +{ + [AttributeUsage(AttributeTargets.Method)] + public class MudRequestAttribute : attribute + { + /// + /// This attribute can be used on a static method to make the multi-user domain server software see this method as a MUD request handler. + /// + /// The header ID of the request this method should handle. + public MudRequestAttribute(string rName) + { + RequestName = rName; + } + + public string RequestName { get; private set; } + } + + [AttributeUsage(AttributeTargets.Method)] + public class MudResponseAttribute : attribute + { + /// + /// Clients will look for static methods marked with this attribute and run them first. If no attribute is found with the given header ID, the client may invoke a delegate with the message information. + /// + /// The header ID of the response that this method will handle. + public MudResponseAttribute(string rName) + { + ResponseName = rName; + } + + public string ResponseName { get; private set; } + } + + +} + -- cgit v1.2.3