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