Exemple #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 :)
 }
Exemple #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)));
     }
 }
Exemple #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();
     //}
 }
Exemple #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;
        }
Exemple #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);
        }
Exemple #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();
        }
 public CommandRestart(IMinecraftHandler mc)
     : base(mc,"restart")
 {
     Help = "restart: restarts the server";
 }
 public CommandBalance(IMinecraftHandler mc)
     : base(mc, "balance")
 {
 }
Exemple #9
0
 public void OnServerLoaded(IMinecraftHandler mc, IServer server)
 {
     this.server = server as ServerSocket;
 }
Exemple #10
0
 public CommandWho(IMinecraftHandler mc)
     : base(mc, "who")
 {
 }
 public CommandGiveMoney(IMinecraftHandler mc)
     : base(mc, "givemoney")
 {
 }
Exemple #12
0
 public CommandWho(IMinecraftHandler mc)
     : base(mc,"who")
 {
 }
 public CommandRules(IMinecraftHandler mc)
     : base(mc,"rules")
 {
 }
 public CommandJoinChannel(IMinecraftHandler mc)
     : base(mc, "join")
 {
 }
Exemple #15
0
 public CommandGive(IMinecraftHandler mc)
     : base(mc, "give")
 {
 }
Exemple #16
0
 public CommandInfo(IMinecraftHandler mc)
     : base(mc, "info")
 {
 }
Exemple #17
0
 public CommandKick(IMinecraftHandler mc)
     : base(mc,"kick")
 {
 }
 public CommandHelp(IMinecraftHandler mc)
     : base(mc,"help")
 {
 }
Exemple #19
0
 public Command(IMinecraftHandler mc, String name)
 {
     this.mc = mc as MinecraftHandler;
     this.Name = name;
 }
 public CommandZMessage(IMinecraftHandler mc)
     : base(mc,"zmessage")
 {
 }
 /// <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";
 }
 public CommandMuteGroup(IMinecraftHandler mc)
     : base(mc,"mutegroup")
 {
 }
 public CommandZDelete(IMinecraftHandler mc)
     : base(mc, "zdelete")
 {
 }
Exemple #24
0
 public CommandGet(IMinecraftHandler mc)
     : base(mc,"get")
 {
 }
Exemple #25
0
 public CommandSave(IMinecraftHandler mc)
     : base(mc, "save")
 {
 }
 /// <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")
 {
 }
 public CommandMuteGroup(IMinecraftHandler mc)
     : base(mc, "mutegroup")
 {
 }
 public CommandZOwner(IMinecraftHandler mc)
     : base(mc, "zowner")
 {
 }
Exemple #29
0
 public CommandDeOp(IMinecraftHandler mc)
     : base(mc,"deop")
 {
 }
Exemple #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();
     //}
 }
 public CommandChannelInfo(IMinecraftHandler mc)
     : base(mc,"cinfo")
 {
 }
Exemple #32
0
 public void OnServerLoaded(IMinecraftHandler mc, IServer server)
 {
 }
Exemple #33
0
 public CommandSay(IMinecraftHandler mc)
     : base(mc, "say")
 {
 }
 public CommandZMessage(IMinecraftHandler mc)
     : base(mc, "zmessage")
 {
 }
 public CommandGiveMoney(IMinecraftHandler mc)
     : base(mc,"givemoney")
 {
 }
Exemple #36
0
 public CommandTell(IMinecraftHandler mc)
     : base(mc, "tell")
 {
 }
Exemple #37
0
 public CommandOp(IMinecraftHandler mc)
     : base(mc,"op")
 {
 }
Exemple #38
0
 public void OnServerLoaded(IMinecraftHandler mc, IServer server)
 {
     this.mc = mc; // get the minecraft handler
     ThreadPool.QueueUserWorkItem(PluginThread, null);
 }
 public CommandSteal(IMinecraftHandler mc)
     : base(mc,"steal")
 {
 }
Exemple #40
0
 public void OnPluginLoaded(ICommandManager CommandManager, IMinecraftHandler mc)
 {
 }
Exemple #41
0
 public void OnPlayerLeft(IMinecraftHandler mc, string username)
 {
 }
Exemple #42
0
 public CommandPosition(IMinecraftHandler mc)
     : base(mc, "position")
 {
 }
 /// <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";
 }
Exemple #44
0
 public CommandBan(IMinecraftHandler mc)
     : base(mc,"ban")
 {
 }
Exemple #45
0
 public CommandAddNPC(IMinecraftHandler mc)
     : base(mc, "addnpc")
 {
 }
Exemple #46
0
 public void OnPluginLoaded(ICommandManager CommandManager, IMinecraftHandler mc)
 {
 }
 /// <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")
 {
 }
Exemple #48
0
 public void OnServerLoaded(IMinecraftHandler mc, IServer server)
 {
     this.mc = mc; // get the minecraft handler
     ThreadPool.QueueUserWorkItem(PluginThread, null);
 }
Exemple #49
0
 public CommandTime(IMinecraftHandler mc)
     : base(mc,"time")
 {
 }
 public CommandZones(IMinecraftHandler mc)
     : base(mc, "zones")
 {
 }
Exemple #51
0
 public CommandClearAccounts(IMinecraftHandler mc)
     : base(mc, "clearaccounts")
 {
 }
Exemple #52
0
 public void OnPlayerLeft(IMinecraftHandler mc, string username)
 {
 }
Exemple #53
0
 public Command(IMinecraftHandler mc, String name)
 {
     this.mc   = mc as MinecraftHandler;
     this.Name = name;
 }
Exemple #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);
        }
Exemple #55
0
 public CommandKits(IMinecraftHandler mc)
     : base(mc, "kits")
 {
 }
Exemple #56
0
 public void OnServerLoaded(IMinecraftHandler mc, IServer server)
 {
     this.server = server;
     this.mc = mc;
 }
Exemple #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")
 {
 }
Exemple #58
0
 public CommandPay(IMinecraftHandler mc)
     : base(mc,"pay")
 {
 }
 /// <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";
 }
Exemple #60
0
 public CommandKick(IMinecraftHandler mc)
     : base(mc, "kick")
 {
 }