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 :) }
/// <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))); } }
public void OnPluginLoaded(ICommandManager CommandManager, IMinecraftHandler mc) { //this.mc = mc; //if (Enabled) //{ // if (readerThread == null && !readerEnabled) // { // readerThread = new Thread(new ThreadStart(ReaderThread)); // } // ReadFeed(); //} }
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; }
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); }
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") { }
public void OnServerLoaded(IMinecraftHandler mc, IServer server) { this.server = server as ServerSocket; }
public CommandWho(IMinecraftHandler mc) : base(mc, "who") { }
public CommandGiveMoney(IMinecraftHandler mc) : base(mc, "givemoney") { }
public CommandWho(IMinecraftHandler mc) : base(mc,"who") { }
public CommandRules(IMinecraftHandler mc) : base(mc,"rules") { }
public CommandJoinChannel(IMinecraftHandler mc) : base(mc, "join") { }
public CommandGive(IMinecraftHandler mc) : base(mc, "give") { }
public CommandInfo(IMinecraftHandler mc) : base(mc, "info") { }
public CommandKick(IMinecraftHandler mc) : base(mc,"kick") { }
public CommandHelp(IMinecraftHandler mc) : base(mc,"help") { }
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") { }
public CommandGet(IMinecraftHandler mc) : base(mc,"get") { }
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") { }
public CommandDeOp(IMinecraftHandler mc) : base(mc,"deop") { }
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") { }
public void OnServerLoaded(IMinecraftHandler mc, IServer server) { }
public CommandSay(IMinecraftHandler mc) : base(mc, "say") { }
public CommandZMessage(IMinecraftHandler mc) : base(mc, "zmessage") { }
public CommandGiveMoney(IMinecraftHandler mc) : base(mc,"givemoney") { }
public CommandTell(IMinecraftHandler mc) : base(mc, "tell") { }
public CommandOp(IMinecraftHandler mc) : base(mc,"op") { }
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") { }
public void OnPluginLoaded(ICommandManager CommandManager, IMinecraftHandler mc) { }
public void OnPlayerLeft(IMinecraftHandler mc, string username) { }
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"; }
public CommandBan(IMinecraftHandler mc) : base(mc,"ban") { }
public CommandAddNPC(IMinecraftHandler mc) : base(mc, "addnpc") { }
/// <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") { }
public CommandTime(IMinecraftHandler mc) : base(mc,"time") { }
public CommandZones(IMinecraftHandler mc) : base(mc, "zones") { }
public CommandClearAccounts(IMinecraftHandler mc) : base(mc, "clearaccounts") { }
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); }
public CommandKits(IMinecraftHandler mc) : base(mc, "kits") { }
public void OnServerLoaded(IMinecraftHandler mc, IServer server) { this.server = server; this.mc = 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") { }
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"; }
public CommandKick(IMinecraftHandler mc) : base(mc, "kick") { }