Commit 2f60f0c8 authored by Adam Gausmann's avatar Adam Gausmann

Update release to 1.1, add stuff to UserMask, add color support to commands

parent 0475fcbd
Pipeline #5064726 passed with stages
in 23 seconds
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>samurai</artifactId> <artifactId>samurai</artifactId>
<groupId>ninja.nonemu</groupId> <groupId>ninja.nonemu</groupId>
<version>1.0.2</version> <version>1.1</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<dependency> <dependency>
<groupId>ninja.nonemu</groupId> <groupId>ninja.nonemu</groupId>
<artifactId>ircninja</artifactId> <artifactId>ircninja</artifactId>
<version>1.0</version> <version>1.1</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
......
...@@ -7,6 +7,10 @@ public class UserMask implements Comparable<UserMask> { ...@@ -7,6 +7,10 @@ public class UserMask implements Comparable<UserMask> {
this.mask = mask; this.mask = mask;
} }
public UserMask(String nickname, String username, String hostname) {
this(nickname + "!" + username + "@" + hostname);
}
public String getNickname() { public String getNickname() {
if (mask.contains("!")) { if (mask.contains("!")) {
return mask.substring(0, mask.indexOf("!")); return mask.substring(0, mask.indexOf("!"));
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<groupId>ninja.nonemu</groupId> <groupId>ninja.nonemu</groupId>
<artifactId>samurai</artifactId> <artifactId>samurai</artifactId>
<version>1.0.2</version> <version>1.1</version>
<modules> <modules>
<module>api</module> <module>api</module>
<module>runtime</module> <module>runtime</module>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>samurai</artifactId> <artifactId>samurai</artifactId>
<groupId>ninja.nonemu</groupId> <groupId>ninja.nonemu</groupId>
<version>1.0.2</version> <version>1.1</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -12,6 +12,7 @@ import java.util.Queue; ...@@ -12,6 +12,7 @@ import java.util.Queue;
import java.util.Set; import java.util.Set;
import java.util.TreeMap; import java.util.TreeMap;
import java.util.TreeSet; import java.util.TreeSet;
import ninja.nonemu.irc.Color;
import ninja.nonemu.samurai.BotImpl; import ninja.nonemu.samurai.BotImpl;
import ninja.nonemu.samurai.connection.ChatEvent; import ninja.nonemu.samurai.connection.ChatEvent;
import ninja.nonemu.samurai.connection.User; import ninja.nonemu.samurai.connection.User;
...@@ -201,7 +202,8 @@ public class CommandSystemImpl implements CommandSystem { ...@@ -201,7 +202,8 @@ public class CommandSystemImpl implements CommandSystem {
@EventHandler(priority = Priority.MONITOR, acceptSubclass = false) @EventHandler(priority = Priority.MONITOR, acceptSubclass = false)
public void handleChatEvent(ChatEvent event) { public void handleChatEvent(ChatEvent event) {
if (!event.getText().startsWith(commandPrefix)) { String text = Color.stripColors(event.getText());
if (!text.startsWith(commandPrefix)) {
return; return;
} }
...@@ -209,7 +211,7 @@ public class CommandSystemImpl implements CommandSystem { ...@@ -209,7 +211,7 @@ public class CommandSystemImpl implements CommandSystem {
return; return;
} }
String[] words = event.getText().split("\\s"); String[] words = text.split("\\s");
String label = words[0].substring(commandPrefix.length()); String label = words[0].substring(commandPrefix.length());
String[] args = new String[words.length - 1]; String[] args = new String[words.length - 1];
System.arraycopy(words, 1, args, 0, args.length); System.arraycopy(words, 1, args, 0, args.length);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment