Exemple #1
0
        public void Use(IServer iServer, string commandName, string[] tokens)
        {
            Server server = iServer as Server;
            string message = "";
            //for loop that starts at one so that we do not include "say".
            for (int i = 1; i < tokens.Length; i++)
            {
                message += tokens[i] + " ";
            }

            //Event
            ServerChatEventArgs e = new ServerChatEventArgs(server, message);
            server.PluginManager.CallEvent(Event.ServerChat, e);
            if (e.EventCanceled) return;
            message = e.Message;
            //End Event

            server.Broadcast(message);
        }
Exemple #2
0
 public virtual void OnChat(ServerChatEventArgs e) { }
Exemple #3
0
 private void OnChat(ServerChatEventArgs e)
 {
     foreach (EventListener el in Plugins)
     {
         ServerListener sl = (ServerListener)el.Listener;
         if (el.Event == Event.ServerChat)
             sl.OnChat(e);
     }
 }