diff options
Diffstat (limited to 'juick-commands/src/main/java/com/juick/command/Ping.java')
-rw-r--r-- | juick-commands/src/main/java/com/juick/command/Ping.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/juick-commands/src/main/java/com/juick/command/Ping.java b/juick-commands/src/main/java/com/juick/command/Ping.java new file mode 100644 index 00000000..7d081b41 --- /dev/null +++ b/juick-commands/src/main/java/com/juick/command/Ping.java @@ -0,0 +1,26 @@ +package com.juick.command; + +import com.juick.User; +import com.juick.server.protocol.ProtocolListener; +import org.springframework.stereotype.Component; + +import java.util.regex.Pattern; + +/** + * @author ma1uta + */ +@Component +public class Ping implements Command { + + private static final Pattern PATTERN = Pattern.compile("^ping$", Pattern.CASE_INSENSITIVE); + + @Override + public Pattern pattern() { + return PATTERN; + } + + @Override + public String execute(User sender, ProtocolListener protocolListener, String command) { + return "PONG"; + } +} |