public static bool Handle(Mobile from, string text, MessageType type) { if (text.StartsWith(m_Prefix) || type == MessageType.Command) { if (type != MessageType.Command) { text = text.Substring(m_Prefix.Length); } int indexOf = text.IndexOf(' '); string command; string[] args; string argString; if (indexOf >= 0) { argString = text.Substring(indexOf + 1); command = text.Substring(0, indexOf); args = Split(argString); } else { argString = ""; command = text.ToLower(); args = new string[0]; } CommandEntry entry = null; m_Entries.TryGetValue(command, out entry); if (entry != null) { if (from.AccessLevel >= entry.AccessLevel) { if (entry.Handler != null) { CommandEventArgs e = new CommandEventArgs(from, command, argString, args); entry.Handler(e); EventSink.InvokeCommand(e); } } else { if (from.AccessLevel <= m_BadCommandIngoreLevel) { return(false); } from.SendMessage("You do not have access to that command."); } } else { if (from.AccessLevel <= m_BadCommandIngoreLevel) { return(false); } from.SendMessage("That is not a valid command."); } return(true); } return(false); }