Пример #1
0
 public void OnPluginLoaded(ICommandManager CommandManager, IMinecraftHandler mc)
 {
     //CommandManager.RegisterCommand("teleport", new CommandTeleport(mc));
     CommandManager.RegisterCommand("color", new CommandColor(mc));
     CommandManager.RegisterCommand("group", new CommandGroup(mc));   // make sure the name is no duplicate :)
     CommandManager.RegisterCommand("groups", new CommandGroups(mc)); // make sure the name is no duplicate :)
 }
Пример #2
0
 /// <summary>
 /// this is the execution method which gets executed later
 /// to get more arguments use the internal regArgs variable
 /// </summary>
 /// <param name="arg1">first argument after the command in the string</param>
 /// <param name="arg2">second argument after the command in the string</param>
 /// <param name="arg3">third argument after the command in the string</param>
 /// <param name="arg4">fourth argument after the command in the string</param>
 /// <returns>remember to set the command result in every return case</returns>
 public override CommandResult Execute(String arg1, String arg2, String arg3, String arg4)
 {
     if (!String.IsNullOrEmpty(arg1))
     {
         IMinecraftHandler mc    = MinecraftHandler;
         String            match = EasyGuess.GetMatchedString(mc.Player, arg1);
         if (!String.IsNullOrEmpty(match))
         {
             UserCollectionSingletone userCollection = UserCollectionSingletone.GetInstance();
             User matchedPlayer = userCollection.GetUserByName(match);
             if (matchedPlayer != null)
             {
                 GroupCollectionSingletone groups = GroupCollectionSingletone.GetInstance();
                 Group group = EasyGuess.GetMatchedGroup(groups, arg2);
                 if (group != null)
                 {
                     if (ClientUser.LevelID >= matchedPlayer.LevelID && ClientUser.LevelID >= group.Id) // checks if the triggered user has a higher group level
                     {
                         matchedPlayer.LevelID = group.Id;                                              // sets the rank to the user :)
                         if (matchedPlayer.Generated)
                         {
                             matchedPlayer.Name = match;
                             if (!userCollection.IsInlist(match))
                             {
                                 userCollection.Add(matchedPlayer);
                                 userCollection.Save();
                             }
                         }
                         return(new CommandResult(true, string.Format("player {0} set to group {1}", matchedPlayer.Name, group.Name)));
                     }
                     else
                     {
                         return(new CommandResult(true, string.Format("group level is too low {0} ID:{1}", ClientUser.Level.Name, ClientUser.LevelID)));
                     }
                 }
                 else
                 {
                     return(new CommandResult(true, string.Format("couldn't find group {0}", arg2))); // give as much informations as you can
                 }
             }
             else
             {
                 return(new CommandResult(true, string.Format("couldn't find the user {0}", match))); // give as much informations as you can
             }
         }
         else
         {
             return(new CommandResult(true, string.Format("couldn't find the user {0}", match))); // give as much informations as you can
         }
     }
     else
     {
         return(new CommandResult(true, string.Format("couldn't find player {0}", arg1)));
     }
 }
Пример #3
0
 public void OnPluginLoaded(ICommandManager CommandManager, IMinecraftHandler mc)
 {
     //this.mc = mc;
     //if (Enabled)
     //{
     //    if (readerThread == null && !readerEnabled)
     //    {
     //        readerThread = new Thread(new ThreadStart(ReaderThread));
     //    }
     //    ReadFeed();
     //}
 }
Пример #4
0
        public void OnPluginLoaded(ICommandManager CommandManager, IMinecraftHandler mc)
        {
            MinecraftHandler myMc = mc as MinecraftHandler;

            if (myMc != null)
            {
            }
            CommandManager.RegisterCommand("setcenter", new CommandSetCenter(mc));
            CommandManager.RegisterCommand("distance", new CommandDistance(mc));
            ConfigPlugin.ConfigFolder = Path.GetDirectoryName(startupPath) + Path.DirectorySeparatorChar;
            config = ConfigPlugin.Load();
            config.Save();
            this.mc = mc;
        }
Пример #5
0
        public void OnPluginLoaded(ICommandManager CommandManager, IMinecraftHandler mc)
        {
            ConfigPlugin.ConfigFolder = Path.GetDirectoryName(startupPath) + Path.DirectorySeparatorChar;
            config = ConfigPlugin.Load();

            if (config.ConnectOnStartup)
            {
                Reconnect(config);
            }

            ircClient.OnQueryMessage   -= new IrcEventHandler(ircClient_OnQueryMessage);
            ircClient.OnChannelMessage -= new IrcEventHandler(ircClient_OnChannelMessage);
            ircClient.OnQueryMessage   += new IrcEventHandler(ircClient_OnQueryMessage);
            ircClient.OnChannelMessage += new IrcEventHandler(ircClient_OnChannelMessage);
        }
Пример #6
0
        public void OnPluginLoaded(ICommandManager CommandManager, IMinecraftHandler mc)
        {
            this.mc = mc;
            CommandManager.RegisterCommand("lotto", new CommandLotto(mc));
            CommandManager.RegisterCommand("jackpot", new CommandJackpot(mc));
            ConfigLotto.ConfigFolder = Path.GetDirectoryName(startupPath) + Path.DirectorySeparatorChar;

            LottoUserCollection.Load().Save();
            config = ConfigLotto.Load();
            config.Save();
            users        = UserCollectionSingletone.GetInstance();
            lottoEnabled = true;
            lottoThread  = new Thread(new ThreadStart(LottoThread));
            lottoThread.Start();
        }
Пример #7
0
 public CommandRestart(IMinecraftHandler mc)
     : base(mc,"restart")
 {
     Help = "restart: restarts the server";
 }
Пример #8
0
 public CommandBalance(IMinecraftHandler mc)
     : base(mc, "balance")
 {
 }
Пример #9
0
 public void OnServerLoaded(IMinecraftHandler mc, IServer server)
 {
     this.server = server as ServerSocket;
 }
Пример #10
0
 public CommandWho(IMinecraftHandler mc)
     : base(mc, "who")
 {
 }
Пример #11
0
 public CommandGiveMoney(IMinecraftHandler mc)
     : base(mc, "givemoney")
 {
 }
Пример #12
0
 public CommandWho(IMinecraftHandler mc)
     : base(mc,"who")
 {
 }
Пример #13
0
 public CommandRules(IMinecraftHandler mc)
     : base(mc,"rules")
 {
 }
Пример #14
0
 public CommandJoinChannel(IMinecraftHandler mc)
     : base(mc, "join")
 {
 }
Пример #15
0
 public CommandGive(IMinecraftHandler mc)
     : base(mc, "give")
 {
 }
Пример #16
0
 public CommandInfo(IMinecraftHandler mc)
     : base(mc, "info")
 {
 }
Пример #17
0
 public CommandKick(IMinecraftHandler mc)
     : base(mc,"kick")
 {
 }
Пример #18
0
 public CommandHelp(IMinecraftHandler mc)
     : base(mc,"help")
 {
 }
Пример #19
0
 public Command(IMinecraftHandler mc, String name)
 {
     this.mc = mc as MinecraftHandler;
     this.Name = name;
 }
Пример #20
0
 public CommandZMessage(IMinecraftHandler mc)
     : base(mc,"zmessage")
 {
 }
Пример #21
0
 /// <summary>
 /// the string for the base class is the name of this command
 /// it gets executed with !color then, should be the same like the in the register method
 /// </summary>
 /// <param name="mc">The minecraft handler</param>
 public CommandJackpot(IMinecraftHandler mc)
     : base(mc, "jackpot")
 {
     Help = "Shows the current lottery jackpot";
 }
Пример #22
0
 public CommandMuteGroup(IMinecraftHandler mc)
     : base(mc,"mutegroup")
 {
 }
Пример #23
0
 public CommandZDelete(IMinecraftHandler mc)
     : base(mc, "zdelete")
 {
 }
Пример #24
0
 public CommandGet(IMinecraftHandler mc)
     : base(mc,"get")
 {
 }
Пример #25
0
 public CommandSave(IMinecraftHandler mc)
     : base(mc, "save")
 {
 }
Пример #26
0
 /// <summary>
 /// the string for the base class is the name of this command
 /// it gets executed with !color then, should be the same like the in the register method
 /// </summary>
 /// <param name="mc">The minecraft handler</param>
 public CommandSetCenter(IMinecraftHandler mc)
     : base(mc,"setcenter")
 {
 }
Пример #27
0
 public CommandMuteGroup(IMinecraftHandler mc)
     : base(mc, "mutegroup")
 {
 }
Пример #28
0
 public CommandZOwner(IMinecraftHandler mc)
     : base(mc, "zowner")
 {
 }
Пример #29
0
 public CommandDeOp(IMinecraftHandler mc)
     : base(mc,"deop")
 {
 }
Пример #30
0
 public void OnPluginLoaded(ICommandManager CommandManager,IMinecraftHandler mc)
 {
     //this.mc = mc;
     //if (Enabled)
     //{
     //    if (readerThread == null && !readerEnabled)
     //    {
     //        readerThread = new Thread(new ThreadStart(ReaderThread));
     //    }
     //    ReadFeed();
     //}
 }
Пример #31
0
 public CommandChannelInfo(IMinecraftHandler mc)
     : base(mc,"cinfo")
 {
 }
Пример #32
0
 public void OnServerLoaded(IMinecraftHandler mc, IServer server)
 {
 }
Пример #33
0
 public CommandSay(IMinecraftHandler mc)
     : base(mc, "say")
 {
 }
Пример #34
0
 public CommandZMessage(IMinecraftHandler mc)
     : base(mc, "zmessage")
 {
 }
Пример #35
0
 public CommandGiveMoney(IMinecraftHandler mc)
     : base(mc,"givemoney")
 {
 }
Пример #36
0
 public CommandTell(IMinecraftHandler mc)
     : base(mc, "tell")
 {
 }
Пример #37
0
 public CommandOp(IMinecraftHandler mc)
     : base(mc,"op")
 {
 }
Пример #38
0
 public void OnServerLoaded(IMinecraftHandler mc, IServer server)
 {
     this.mc = mc; // get the minecraft handler
     ThreadPool.QueueUserWorkItem(PluginThread, null);
 }
Пример #39
0
 public CommandSteal(IMinecraftHandler mc)
     : base(mc,"steal")
 {
 }
Пример #40
0
 public void OnPluginLoaded(ICommandManager CommandManager, IMinecraftHandler mc)
 {
 }
Пример #41
0
 public void OnPlayerLeft(IMinecraftHandler mc, string username)
 {
 }
Пример #42
0
 public CommandPosition(IMinecraftHandler mc)
     : base(mc, "position")
 {
 }
Пример #43
0
 /// <summary>
 /// the string for the base class is the name of this command
 /// it gets executed with !color then, should be the same like the in the register method
 /// </summary>
 /// <param name="mc">The minecraft handler</param>
 public CommandGroup(IMinecraftHandler mc)
     : base(mc,"group")
 {
     Help = "Sets a player to a group";
 }
Пример #44
0
 public CommandBan(IMinecraftHandler mc)
     : base(mc,"ban")
 {
 }
Пример #45
0
 public CommandAddNPC(IMinecraftHandler mc)
     : base(mc, "addnpc")
 {
 }
Пример #46
0
 public void OnPluginLoaded(ICommandManager CommandManager, IMinecraftHandler mc)
 {
 }
Пример #47
0
 /// <summary>
 /// the string for the base class is the name of this command
 /// it gets executed with !color then, should be the same like the in the register method
 /// </summary>
 /// <param name="mc">The minecraft handler</param>
 public CommandTeleport(IMinecraftHandler mc)
     : base(mc,"teleport")
 {
 }
Пример #48
0
 public void OnServerLoaded(IMinecraftHandler mc, IServer server)
 {
     this.mc = mc; // get the minecraft handler
     ThreadPool.QueueUserWorkItem(PluginThread, null);
 }
Пример #49
0
 public CommandTime(IMinecraftHandler mc)
     : base(mc,"time")
 {
 }
Пример #50
0
 public CommandZones(IMinecraftHandler mc)
     : base(mc, "zones")
 {
 }
Пример #51
0
 public CommandClearAccounts(IMinecraftHandler mc)
     : base(mc, "clearaccounts")
 {
 }
Пример #52
0
 public void OnPlayerLeft(IMinecraftHandler mc, string username)
 {
 }
Пример #53
0
 public Command(IMinecraftHandler mc, String name)
 {
     this.mc   = mc as MinecraftHandler;
     this.Name = name;
 }
Пример #54
0
        public void OnPluginLoaded(ICommandManager CommandManager,IMinecraftHandler mc)
        {
            ConfigPlugin.ConfigFolder = Path.GetDirectoryName(startupPath) + Path.DirectorySeparatorChar;
            config = ConfigPlugin.Load();

            if (config.ConnectOnStartup)
            {
                Reconnect(config);
            }

            ircClient.OnQueryMessage -= new IrcEventHandler(ircClient_OnQueryMessage);
            ircClient.OnChannelMessage -= new IrcEventHandler(ircClient_OnChannelMessage);
            ircClient.OnQueryMessage += new IrcEventHandler(ircClient_OnQueryMessage);
            ircClient.OnChannelMessage += new IrcEventHandler(ircClient_OnChannelMessage);
        }
Пример #55
0
 public CommandKits(IMinecraftHandler mc)
     : base(mc, "kits")
 {
 }
Пример #56
0
 public void OnServerLoaded(IMinecraftHandler mc, IServer server)
 {
     this.server = server;
     this.mc = mc;
 }
Пример #57
0
 /// <summary>
 /// the string for the base class is the name of this command
 /// it gets executed with !color then, should be the same like the in the register method
 /// </summary>
 /// <param name="mc">The minecraft handler</param>
 public CommandTeleport(IMinecraftHandler mc)
     : base(mc, "teleport")
 {
 }
Пример #58
0
 public CommandPay(IMinecraftHandler mc)
     : base(mc,"pay")
 {
 }
Пример #59
0
 /// <summary>
 /// the string for the base class is the name of this command
 /// it gets executed with !color then, should be the same like the in the register method
 /// </summary>
 /// <param name="mc">The minecraft handler</param>
 public CommandColor(IMinecraftHandler mc)
     : base(mc, "color")
 {
     Help = "Prints a coloured text";
 }
Пример #60
0
 public CommandKick(IMinecraftHandler mc)
     : base(mc, "kick")
 {
 }