Skip to content
This repository has been archived by the owner on Jul 27, 2019. It is now read-only.

Commit

Permalink
Add bot file name to listbots command output.
Browse files Browse the repository at this point in the history
  • Loading branch information
cnaude committed Feb 28, 2014
1 parent 460f5a5 commit 5b1a69b
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 9 deletions.
6 changes: 3 additions & 3 deletions dependency-reduced-pom.xml
Expand Up @@ -4,7 +4,7 @@
<groupId>com.cnaude</groupId>
<artifactId>PurpleIRC</artifactId>
<name>PurpleIRC</name>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.9</version>
<description>A CraftBukkit plugin for bridging game chat with IRC. Connect to any number of IRC servers and channels simultaneously.</description>
<url>http://dev.bukkit.org/server-mods/purpleirc/</url>
<build>
Expand Down Expand Up @@ -147,8 +147,8 @@
<dependency>
<groupId>net.ess3</groupId>
<artifactId>essentials</artifactId>
<version>2.12.1</version>
<scope>provided</scope>
<version>2.13.121</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.milkbowl.vault</groupId>
Expand Down
5 changes: 2 additions & 3 deletions pom.xml
Expand Up @@ -5,7 +5,7 @@

<groupId>com.cnaude</groupId>
<artifactId>PurpleIRC</artifactId>
<version>2.1.9-SNAPSHOT</version>
<version>2.1.9</version>
<name>PurpleIRC</name>
<description>A CraftBukkit plugin for bridging game chat with IRC. Connect to any number of IRC servers and channels simultaneously.</description>
<url>http://dev.bukkit.org/server-mods/purpleirc/</url>
Expand Down Expand Up @@ -91,9 +91,8 @@
<dependency>
<groupId>net.ess3</groupId>
<artifactId>essentials</artifactId>
<version>2.12.1</version>
<version>2.13.121</version>
<type>jar</type>
<scope>provided</scope>
</dependency>

<!-- Use Vault Economy API interface -->
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/cnaude/purpleirc/Commands/ListBots.java
Expand Up @@ -39,7 +39,8 @@ public void dispatch(CommandSender sender, String[] args) {
sender.sendMessage(ChatColor.DARK_PURPLE + "-----[ " + ChatColor.WHITE + "IRC Bots"
+ ChatColor.DARK_PURPLE + " ]-----");
for (PurpleBot ircBot : plugin.ircBots.values()) {
sender.sendMessage(ChatColor.DARK_PURPLE + "* " + ChatColor.WHITE + ircBot.botNick);
sender.sendMessage(ChatColor.DARK_PURPLE + "* " + ChatColor.WHITE + ircBot.botNick
+ ChatColor.DARK_PURPLE + " [" + ChatColor.GRAY + ircBot.getFileName() + ChatColor.DARK_PURPLE + "]");
if (ircBot.isConnected()) {
for (Channel channel : ircBot.getChannels()) {
sender.sendMessage(ChatColor.DARK_PURPLE + " - " + ChatColor.WHITE + channel.getName());
Expand Down
Expand Up @@ -6,7 +6,7 @@

import com.cnaude.purpleirc.PurpleBot;
import com.cnaude.purpleirc.PurpleIRC;
import com.earth2me.essentials.User;
import net.ess3.api.IUser;
import net.ess3.api.events.AfkStatusChangeEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
Expand All @@ -33,7 +33,7 @@ public EssentialsListener(PurpleIRC plugin) {
*/
@EventHandler
public void onAfkStatusChangeEvent(AfkStatusChangeEvent event) {
User user = event.getAffected();
IUser user = event.getAffected();
plugin.logDebug("AFK: " + user.getName() + ":" + user.isAfk());
for (PurpleBot ircBot : plugin.ircBots.values()) {
if (ircBot.isConnected()) {
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/com/cnaude/purpleirc/PurpleBot.java
Expand Up @@ -109,13 +109,15 @@ public final class PurpleBot {
public List<String> channelCmdNotifyRecipients;
private final ArrayList<ListenerAdapter> ircListeners;
public IRCMessageQueueWatcher messageQueue;
private final String fileName;

/**
*
* @param file
* @param plugin
*/
public PurpleBot(File file, PurpleIRC plugin) {
fileName = file.getName();
this.connected = false;
this.botChannels = new ArrayList<String>();
this.ircListeners = new ArrayList<ListenerAdapter>();
Expand Down Expand Up @@ -2145,4 +2147,8 @@ public PircBotX getBot() {
public void setConnected(boolean connected) {
this.connected = connected;
}

public String getFileName() {
return fileName;
}
}
9 changes: 9 additions & 0 deletions src/main/java/com/cnaude/purpleirc/PurpleIRC.java
Expand Up @@ -3,6 +3,7 @@
import com.cnaude.purpleirc.GameListeners.CleverNotchListener;
import com.cnaude.purpleirc.GameListeners.DeathMessagesListener;
import com.cnaude.purpleirc.GameListeners.DynmapListener;
import com.cnaude.purpleirc.GameListeners.EssentialsListener;
import com.cnaude.purpleirc.GameListeners.GamePlayerChatListener;
import com.cnaude.purpleirc.GameListeners.GamePlayerCommandPreprocessingListener;
import com.cnaude.purpleirc.GameListeners.GamePlayerDeathListener;
Expand Down Expand Up @@ -250,6 +251,14 @@ public void onEnable() {
} else {
logInfo("ReportRTS not detected.");
}
/*
if (isPluginEnabled("Essentials")) {
logInfo("Enabling Essentials support.");
getServer().getPluginManager().registerEvents(new EssentialsListener(this), this);
} else {
logInfo("Essentials not detected.");
}
*/
commandHandlers = new CommandHandlers(this);
getCommand("irc").setExecutor(commandHandlers);
regexGlobber = new RegexGlobber();
Expand Down

0 comments on commit 5b1a69b

Please sign in to comment.