-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The dispatchCommand() method is not thread safe, and therefore should be wrapped in a runnable and dispatched from a synchronized task. As well, before, executing a command did not use getCommandSender(), instead parsing the IRC nickname into a CommandSender, which causes problems if your IRC nick is not the same as your ingame nick. I also removed Eclipse specific files and added them to the gitignore, as they aren't required for compilation and only clutter the required code
- Loading branch information
Showing
6 changed files
with
36 additions
and
29 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
*.class | ||
.classpath | ||
.project | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
*.ear | ||
|
||
target/ | ||
.settings/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/com/Jdbye/BukkitIRCd/BukkitCommandExecutorRunnable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.Jdbye.BukkitIRCd; | ||
|
||
import org.bukkit.scheduler.BukkitRunnable; | ||
|
||
public class BukkitCommandExecutorRunnable extends BukkitRunnable{ | ||
|
||
private String command; | ||
private final BukkitIRCdPlugin instance; | ||
public BukkitCommandExecutorRunnable(BukkitIRCdPlugin instance, String command){ | ||
this.command = command; | ||
this.instance = instance; | ||
} | ||
|
||
public void run() { | ||
instance.getServer().dispatchCommand(instance.getServer().getConsoleSender(), command); | ||
|
||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33bc0e2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also fixed issue #13