diff options
Diffstat (limited to 'ShiftOS.Objects')
| -rw-r--r-- | ShiftOS.Objects/MudAttributes.cs | 43 | ||||
| -rw-r--r-- | ShiftOS.Objects/ShiftOS.Objects.csproj | 1 |
2 files changed, 44 insertions, 0 deletions
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 + { + /// <summary> + /// 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. + /// </summary> + /// <param name="rName">The header ID of the request this method should handle.</param> + public MudRequestAttribute(string rName) + { + RequestName = rName; + } + + public string RequestName { get; private set; } + } + + [AttributeUsage(AttributeTargets.Method)] + public class MudResponseAttribute : attribute + { + /// <summary> + /// 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. + /// </summary> + /// <param name="rName">The header ID of the response that this method will handle.</param> + public MudResponseAttribute(string rName) + { + ResponseName = rName; + } + + public string ResponseName { get; private set; } + } + + +} + diff --git a/ShiftOS.Objects/ShiftOS.Objects.csproj b/ShiftOS.Objects/ShiftOS.Objects.csproj index b82a40a..867c540 100644 --- a/ShiftOS.Objects/ShiftOS.Objects.csproj +++ b/ShiftOS.Objects/ShiftOS.Objects.csproj @@ -47,6 +47,7 @@ <Compile Include="ClientSave.cs" /> <Compile Include="Job.cs" /> <Compile Include="Legion.cs" /> + <Compile Include="MudAttributes.cs" /> <Compile Include="Objects.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Save.cs" /> |
