using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Threading; using System.Threading.Tasks; using RageCoop.Core; using Lidgren.Network; namespace RageCoop.Server.Scripting { public abstract class ServerScript { } [AttributeUsage(AttributeTargets.Method, Inherited = false)] public class TriggerEvent : Attribute { public string EventName { get; set; } public TriggerEvent(string eventName) { EventName = eventName; } } public class EventContext { /// /// Gets the client which executed the command /// public Client Client { get; internal set; } /// /// Arguments (all standard but no string!) /// public object[] Args { get; internal set; } } [AttributeUsage(AttributeTargets.Method, Inherited = false)] public class Command : Attribute { /// /// Sets name of the command /// public string Name { get; set; } /// /// Set the Usage (Example: "Please use "/help"". ArgsLength required!) /// public string Usage { get; set; } /// /// Set the length of arguments (Example: 2 for "/message USERNAME MESSAGE". Usage required!) /// public short ArgsLength { get; set; } public Command(string name) { Name = name; } } public class CommandContext { /// /// Gets the client which executed the command /// public Client Client { get; internal set; } /// /// Gets the arguments (Example: "/message USERNAME MESSAGE", Args[0] for USERNAME) /// public string[] Args { get; internal set; } } }