示例#1
0
        public static void InvokeCommand(ref string query, ref CommandSender sender, ref bool allow)
        {
            if (RemoteAdminCommandEvent == null)
            {
                return;
            }

            RACommandEvent ev = new RACommandEvent()
            {
                Allow   = allow,
                Command = query,
                Sender  = sender
            };

            RemoteAdminCommandEvent.Invoke(ref ev);

            query  = ev.Command;
            sender = ev.Sender;
            allow  = ev.Allow;

            lock (lockObject)
            {
                File.AppendAllText(PluginManager.LogsPath, $"[{DateTime.Now}] {sender.Nickname} ({sender.SenderId}) ran command: {query}. Command Permitted: {allow}" + Environment.NewLine);
            }
        }
示例#2
0
        internal void InvokeRemoteAdminCommandEvent(CommandSender sender, string command, ref bool allow)
        {
            var ev = new RemoteAdminCommandEventArgs {
                Allow = allow, Command = command, Sender = sender
            };

            RemoteAdminCommandEvent?.Invoke(ev);

            allow = ev.Allow;
        }