LunaChat v3-k2 : Messaging implementation. (WIP)
このコミットが含まれているのは:
1 親
f5910411f4
コミット
1513dd8197
42ファイル変更
+924
-1120
検索条件に一致するファイルはありません
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc3.command;
|
||||
|
||||
import com.github.ucchyocean.lc3.Messages;
|
||||
import com.github.ucchyocean.lc3.channel.Channel;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
|
||||
@@ -12,16 +13,15 @@ import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
* acceptコマンドの実行クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class AcceptCommand extends SubCommandAbst {
|
||||
public class AcceptCommand extends LunaChatSubCommand {
|
||||
|
||||
private static final String COMMAND_NAME = "accept";
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
private static final String USAGE_KEY = "usageAccept";
|
||||
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandName()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -31,7 +31,7 @@ public class AcceptCommand extends SubCommandAbst {
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getPermissionNode()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
@@ -41,7 +41,7 @@ public class AcceptCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandType()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
@@ -52,12 +52,12 @@ public class AcceptCommand extends SubCommandAbst {
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#sendUsageMessage()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
ChannelMember sender, String label) {
|
||||
sendResourceMessage(sender, "", USAGE_KEY, label);
|
||||
sender.sendMessage(Messages.usageAccept(label));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,14 +66,14 @@ public class AcceptCommand extends SubCommandAbst {
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#runCommand(java.lang.String[])
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(ChannelMember sender, String label, String[] args) {
|
||||
|
||||
// 招待を受けていないプレイヤーなら、エラーを表示して終了する
|
||||
if (!DataMaps.inviteMap.containsKey(sender.getName())) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgNotInvited");
|
||||
sender.sendMessage(Messages.errmsgNotInvited());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -85,23 +85,23 @@ public class AcceptCommand extends SubCommandAbst {
|
||||
|
||||
// 取得できなかったらエラー終了する
|
||||
if (channel == null) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgNotfoundChannel");
|
||||
sender.sendMessage(Messages.errmsgNotfoundChannel());
|
||||
return true;
|
||||
}
|
||||
|
||||
// 既に参加しているなら、エラーを表示して終了する
|
||||
if (channel.getMembers().contains(sender)) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgInvitedAlreadyJoin");
|
||||
sender.sendMessage(Messages.errmsgInvitedAlreadyJoin());
|
||||
return true;
|
||||
}
|
||||
|
||||
// 参加する
|
||||
channel.addMember(sender);
|
||||
sendResourceMessage(sender, PREINFO, "cmdmsgJoin", channel.getName());
|
||||
sender.sendMessage(Messages.cmdmsgJoin(channel.getName()));
|
||||
|
||||
// デフォルトの発言先に設定する
|
||||
api.setDefaultChannel(sender.getName(), channelName);
|
||||
sendResourceMessage(sender, PREINFO, "cmdmsgSet", channelName);
|
||||
sender.sendMessage(Messages.cmdmsgSet(channel.getName()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,172 +1,171 @@
|
||||
/*
|
||||
* @author ucchy
|
||||
* @license LGPLv3
|
||||
* @copyright Copyright ucchy 2020
|
||||
*/
|
||||
package com.github.ucchyocean.lc3.command;
|
||||
|
||||
import com.github.ucchyocean.lc3.channel.Channel;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
|
||||
/**
|
||||
* banコマンドの実行クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class BanCommand extends SubCommandAbst {
|
||||
|
||||
private static final String COMMAND_NAME = "ban";
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
private static final String USAGE_KEY1 = "usageBan";
|
||||
private static final String USAGE_KEY2 = "usageBan2";
|
||||
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return COMMAND_NAME;
|
||||
}
|
||||
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
return PERMISSION_NODE;
|
||||
}
|
||||
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
return CommandType.MODERATOR;
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
ChannelMember sender, String label) {
|
||||
sendResourceMessage(sender, "", USAGE_KEY1, label);
|
||||
sendResourceMessage(sender, "", USAGE_KEY2, label);
|
||||
}
|
||||
|
||||
/**
|
||||
* コマンドを実行します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(
|
||||
ChannelMember sender, String label, String[] args) {
|
||||
|
||||
// 実行引数から、BANするユーザーを取得する
|
||||
String kickedName = "";
|
||||
if (args.length >= 2) {
|
||||
kickedName = args[1];
|
||||
} else {
|
||||
sendResourceMessage(sender, PREERR, "errmsgCommand");
|
||||
return true;
|
||||
}
|
||||
|
||||
// 対象チャンネルを取得、取得できない場合はエラー表示して終了する
|
||||
Channel channel = null;
|
||||
boolean isSpecifiedChannel = false;
|
||||
if (args.length >= 3) {
|
||||
channel = api.getChannel(args[2]);
|
||||
isSpecifiedChannel = true;
|
||||
} else {
|
||||
channel = api.getDefaultChannel(sender.getName());
|
||||
}
|
||||
if (channel == null) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgNoJoin");
|
||||
return true;
|
||||
}
|
||||
|
||||
// モデレーターかどうか確認する
|
||||
if ( !channel.hasModeratorPermission(sender) ) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgNotModerator");
|
||||
return true;
|
||||
}
|
||||
|
||||
// グローバルチャンネルならBANできない
|
||||
if ( channel.isGlobalChannel() ) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgCannotBANGlobal", channel.getName());
|
||||
return true;
|
||||
}
|
||||
|
||||
// BANされるプレイヤーがメンバーかどうかチェックする
|
||||
ChannelMember kicked = ChannelMember.getChannelMember(kickedName);
|
||||
if (!channel.getMembers().contains(kicked)) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgNomemberOther");
|
||||
return true;
|
||||
}
|
||||
|
||||
// 既にBANされているかどうかチェックする
|
||||
if (channel.getBanned().contains(kicked)) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgAlreadyBanned");
|
||||
return true;
|
||||
}
|
||||
|
||||
// 期限付きBANの場合、期限の指定が正しいかどうかをチェックする
|
||||
int expireMinutes = -1;
|
||||
if (args.length >= 3 && !isSpecifiedChannel) {
|
||||
if ( !args[2].matches("[0-9]+") ) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgInvalidBanExpireParameter");
|
||||
return true;
|
||||
}
|
||||
expireMinutes = Integer.parseInt(args[2]);
|
||||
if ( expireMinutes < 1 || 43200 < expireMinutes ) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgInvalidBanExpireParameter");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// BAN実行
|
||||
channel.getBanned().add(kicked);
|
||||
if ( expireMinutes != -1 ) {
|
||||
long expire = System.currentTimeMillis() + expireMinutes * 60 * 1000;
|
||||
channel.getBanExpires().put(kicked, expire);
|
||||
}
|
||||
channel.removeMember(kicked);
|
||||
|
||||
// senderに通知メッセージを出す
|
||||
if ( expireMinutes != -1 ) {
|
||||
sendResourceMessage(sender, PREINFO,
|
||||
"cmdmsgBanWithExpire", kickedName, channel.getName(), expireMinutes);
|
||||
} else {
|
||||
sendResourceMessage(sender, PREINFO,
|
||||
"cmdmsgBan", kickedName, channel.getName());
|
||||
}
|
||||
|
||||
// チャンネルに通知メッセージを出す
|
||||
if ( expireMinutes != -1 ) {
|
||||
sendResourceMessageWithKeyword(channel,
|
||||
"banWithExpireMessage", kicked, expireMinutes);
|
||||
} else {
|
||||
sendResourceMessageWithKeyword(channel, "banMessage", kicked);
|
||||
}
|
||||
|
||||
// BANされた人に通知メッセージを出す
|
||||
if ( kicked != null && kicked.isOnline() ) {
|
||||
sendResourceMessage(kicked, PREINFO,
|
||||
"cmdmsgBanned", channel.getName());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* @author ucchy
|
||||
* @license LGPLv3
|
||||
* @copyright Copyright ucchy 2020
|
||||
*/
|
||||
package com.github.ucchyocean.lc3.command;
|
||||
|
||||
import com.github.ucchyocean.lc3.Messages;
|
||||
import com.github.ucchyocean.lc3.channel.Channel;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
|
||||
/**
|
||||
* banコマンドの実行クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class BanCommand extends LunaChatSubCommand {
|
||||
|
||||
private static final String COMMAND_NAME = "ban";
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return COMMAND_NAME;
|
||||
}
|
||||
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
return PERMISSION_NODE;
|
||||
}
|
||||
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
return CommandType.MODERATOR;
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
ChannelMember sender, String label) {
|
||||
sender.sendMessage(Messages.usageBan(label));
|
||||
sender.sendMessage(Messages.usageBan2(label));
|
||||
}
|
||||
|
||||
/**
|
||||
* コマンドを実行します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(
|
||||
ChannelMember sender, String label, String[] args) {
|
||||
|
||||
// 実行引数から、BANするユーザーを取得する
|
||||
String kickedName = "";
|
||||
if (args.length >= 2) {
|
||||
kickedName = args[1];
|
||||
} else {
|
||||
sender.sendMessage(Messages.errmsgCommand());
|
||||
return true;
|
||||
}
|
||||
|
||||
// 対象チャンネルを取得、取得できない場合はエラー表示して終了する
|
||||
Channel channel = null;
|
||||
boolean isSpecifiedChannel = false;
|
||||
if (args.length >= 3) {
|
||||
channel = api.getChannel(args[2]);
|
||||
isSpecifiedChannel = true;
|
||||
} else {
|
||||
channel = api.getDefaultChannel(sender.getName());
|
||||
}
|
||||
if (channel == null) {
|
||||
sender.sendMessage(Messages.errmsgNoJoin());
|
||||
return true;
|
||||
}
|
||||
|
||||
// モデレーターかどうか確認する
|
||||
if ( !channel.hasModeratorPermission(sender) ) {
|
||||
sender.sendMessage(Messages.errmsgNotModerator());
|
||||
return true;
|
||||
}
|
||||
|
||||
// グローバルチャンネルならBANできない
|
||||
if ( channel.isGlobalChannel() ) {
|
||||
sender.sendMessage(Messages.errmsgCannotBANGlobal(channel.getName()));
|
||||
return true;
|
||||
}
|
||||
|
||||
// BANされるプレイヤーがメンバーかどうかチェックする
|
||||
ChannelMember kicked = ChannelMember.getChannelMember(kickedName);
|
||||
if (!channel.getMembers().contains(kicked)) {
|
||||
sender.sendMessage(Messages.errmsgNomemberOther());
|
||||
return true;
|
||||
}
|
||||
|
||||
// 既にBANされているかどうかチェックする
|
||||
if (channel.getBanned().contains(kicked)) {
|
||||
sender.sendMessage(Messages.errmsgAlreadyBanned());
|
||||
return true;
|
||||
}
|
||||
|
||||
// 期限付きBANの場合、期限の指定が正しいかどうかをチェックする
|
||||
int expireMinutes = -1;
|
||||
if (args.length >= 3 && !isSpecifiedChannel) {
|
||||
if ( !args[2].matches("[0-9]+") ) {
|
||||
sender.sendMessage(Messages.errmsgInvalidBanExpireParameter());
|
||||
return true;
|
||||
}
|
||||
expireMinutes = Integer.parseInt(args[2]);
|
||||
if ( expireMinutes < 1 || 43200 < expireMinutes ) {
|
||||
sender.sendMessage(Messages.errmsgInvalidBanExpireParameter());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// BAN実行
|
||||
channel.getBanned().add(kicked);
|
||||
if ( expireMinutes != -1 ) {
|
||||
long expire = System.currentTimeMillis() + expireMinutes * 60 * 1000;
|
||||
channel.getBanExpires().put(kicked, expire);
|
||||
}
|
||||
channel.removeMember(kicked);
|
||||
|
||||
// senderに通知メッセージを出す
|
||||
if ( expireMinutes != -1 ) {
|
||||
sender.sendMessage(Messages.cmdmsgBanWithExpire(
|
||||
kickedName, channel.getName(), expireMinutes));
|
||||
} else {
|
||||
sender.sendMessage(Messages.cmdmsgBan(
|
||||
kickedName, channel.getName()));
|
||||
}
|
||||
|
||||
// チャンネルに通知メッセージを出す
|
||||
if ( expireMinutes != -1 ) {
|
||||
sender.sendMessage(Messages.banWithExpireMessage(
|
||||
channel.getColorCode(), channel.getName(), kicked.getName(), expireMinutes));
|
||||
} else {
|
||||
sender.sendMessage(Messages.banMessage(
|
||||
channel.getColorCode(), channel.getName(), kicked.getName()));
|
||||
}
|
||||
|
||||
// BANされた人に通知メッセージを出す
|
||||
if ( kicked != null && kicked.isOnline() ) {
|
||||
sender.sendMessage(Messages.cmdmsgBanned(channel.getName()));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc3.command;
|
||||
|
||||
import com.github.ucchyocean.lc3.Messages;
|
||||
import com.github.ucchyocean.lc3.channel.Channel;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
|
||||
@@ -12,16 +13,15 @@ import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
* createコマンドの実行クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class CreateCommand extends SubCommandAbst {
|
||||
public class CreateCommand extends LunaChatSubCommand {
|
||||
|
||||
private static final String COMMAND_NAME = "create";
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
private static final String USAGE_KEY = "usageCreate";
|
||||
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandName()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -31,7 +31,7 @@ public class CreateCommand extends SubCommandAbst {
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getPermissionNode()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
@@ -41,7 +41,7 @@ public class CreateCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandType()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
@@ -52,12 +52,12 @@ public class CreateCommand extends SubCommandAbst {
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#sendUsageMessage()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
ChannelMember sender, String label) {
|
||||
sendResourceMessage(sender, "", USAGE_KEY, label);
|
||||
sender.sendMessage(Messages.usageCreate(label));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,7 +66,7 @@ public class CreateCommand extends SubCommandAbst {
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#runCommand(java.lang.String[])
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(
|
||||
|
||||
@@ -5,22 +5,22 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc3.command;
|
||||
|
||||
import com.github.ucchyocean.lc3.Messages;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
|
||||
/**
|
||||
* denyコマンドの実行クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class DenyCommand extends SubCommandAbst {
|
||||
public class DenyCommand extends LunaChatSubCommand {
|
||||
|
||||
private static final String COMMAND_NAME = "deny";
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
private static final String USAGE_KEY = "usageDeny";
|
||||
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandName()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -30,7 +30,7 @@ public class DenyCommand extends SubCommandAbst {
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getPermissionNode()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
@@ -40,7 +40,7 @@ public class DenyCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandType()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
@@ -51,12 +51,12 @@ public class DenyCommand extends SubCommandAbst {
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#sendUsageMessage()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
ChannelMember sender, String label) {
|
||||
sendResourceMessage(sender, "", USAGE_KEY, label);
|
||||
sender.sendMessage(Messages.usageDeny(label));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -65,7 +65,7 @@ public class DenyCommand extends SubCommandAbst {
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#runCommand(java.lang.String[])
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(ChannelMember sender, String label, String[] args) {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc3.command;
|
||||
|
||||
import com.github.ucchyocean.lc3.Messages;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
|
||||
/**
|
||||
@@ -19,7 +20,7 @@ public class DicCommand extends DictionaryCommand {
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandName()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -30,11 +31,11 @@ public class DicCommand extends DictionaryCommand {
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#sendUsageMessage()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
ChannelMember sender, String label) {
|
||||
sendResourceMessage(sender, "", USAGE_KEY, label);
|
||||
sender.sendMessage(Messages.usageDic(label));
|
||||
}
|
||||
}
|
||||
@@ -8,22 +8,22 @@ package com.github.ucchyocean.lc3.command;
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.github.ucchyocean.lc3.ChatColor;
|
||||
import com.github.ucchyocean.lc3.Messages;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
|
||||
/**
|
||||
* dictionaryコマンドの実行クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class DictionaryCommand extends SubCommandAbst {
|
||||
public class DictionaryCommand extends LunaChatSubCommand {
|
||||
|
||||
private static final String COMMAND_NAME = "dictionary";
|
||||
private static final String PERMISSION_NODE = "lunachat-admin." + COMMAND_NAME;
|
||||
private static final String USAGE_KEY = "usageDictionary";
|
||||
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandName()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -33,7 +33,7 @@ public class DictionaryCommand extends SubCommandAbst {
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getPermissionNode()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
@@ -43,7 +43,7 @@ public class DictionaryCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandType()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
@@ -54,12 +54,12 @@ public class DictionaryCommand extends SubCommandAbst {
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#sendUsageMessage()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
ChannelMember sender, String label) {
|
||||
sendResourceMessage(sender, "", USAGE_KEY, label);
|
||||
sender.sendMessage(Messages.usageDictionary(label));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,7 +68,7 @@ public class DictionaryCommand extends SubCommandAbst {
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#runCommand(java.lang.String[])
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(ChannelMember sender, String label, String[] args) {
|
||||
|
||||
@@ -7,6 +7,7 @@ package com.github.ucchyocean.lc3.command;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.github.ucchyocean.lc3.Messages;
|
||||
import com.github.ucchyocean.lc3.channel.Channel;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
|
||||
@@ -14,16 +15,15 @@ import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
* formatコマンドの実行クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class FormatCommand extends SubCommandAbst {
|
||||
public class FormatCommand extends LunaChatSubCommand {
|
||||
|
||||
private static final String COMMAND_NAME = "format";
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
private static final String USAGE_KEY = "usageFormat";
|
||||
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandName()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -33,7 +33,7 @@ public class FormatCommand extends SubCommandAbst {
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getPermissionNode()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
@@ -43,7 +43,7 @@ public class FormatCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandType()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
@@ -54,12 +54,12 @@ public class FormatCommand extends SubCommandAbst {
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#sendUsageMessage()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
ChannelMember sender, String label) {
|
||||
sendResourceMessage(sender, "", USAGE_KEY, label);
|
||||
sender.sendMessage(Messages.usageFormat(label));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,7 +68,7 @@ public class FormatCommand extends SubCommandAbst {
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#runCommand(java.lang.String[])
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(
|
||||
|
||||
@@ -7,35 +7,35 @@ package com.github.ucchyocean.lc3.command;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.github.ucchyocean.lc3.Messages;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
|
||||
/**
|
||||
* helpコマンドの実行クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class HelpCommand extends SubCommandAbst {
|
||||
public class HelpCommand extends LunaChatSubCommand {
|
||||
|
||||
private static final String COMMAND_NAME = "help";
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
private static final String USAGE_KEY = "usageHelp";
|
||||
|
||||
// 1ページに表示するコマンドヘルプの項目数
|
||||
private static final int PAGE_ITEM_NUM = 6;
|
||||
|
||||
private ArrayList<SubCommandAbst> commands;
|
||||
private ArrayList<LunaChatSubCommand> commands;
|
||||
|
||||
/**
|
||||
* コンストラクタ
|
||||
* @param commands
|
||||
*/
|
||||
public HelpCommand(ArrayList<SubCommandAbst> commands) {
|
||||
public HelpCommand(ArrayList<LunaChatSubCommand> commands) {
|
||||
this.commands = commands;
|
||||
}
|
||||
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandName()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -45,7 +45,7 @@ public class HelpCommand extends SubCommandAbst {
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getPermissionNode()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
@@ -55,7 +55,7 @@ public class HelpCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandType()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
@@ -66,12 +66,12 @@ public class HelpCommand extends SubCommandAbst {
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#sendUsageMessage()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
ChannelMember sender, String label) {
|
||||
sendResourceMessage(sender, "", USAGE_KEY, label);
|
||||
sender.sendMessage(Messages.usageHelp(label));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,7 +80,7 @@ public class HelpCommand extends SubCommandAbst {
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#runCommand(java.lang.String[])
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(ChannelMember sender, String label, String[] args) {
|
||||
@@ -133,8 +133,8 @@ public class HelpCommand extends SubCommandAbst {
|
||||
}
|
||||
|
||||
// 種別に該当するコマンドを取得
|
||||
ArrayList<SubCommandAbst> com = new ArrayList<SubCommandAbst>();
|
||||
for ( SubCommandAbst c : commands ) {
|
||||
ArrayList<LunaChatSubCommand> com = new ArrayList<LunaChatSubCommand>();
|
||||
for ( LunaChatSubCommand c : commands ) {
|
||||
if ( c.getCommandType() == type
|
||||
&& sender.hasPermission(c.getPermissionNode()) ) {
|
||||
com.add(c);
|
||||
|
||||
@@ -16,24 +16,15 @@ import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
* hideコマンドの実行クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class HideCommand extends SubCommandAbst {
|
||||
public class HideCommand extends LunaChatSubCommand {
|
||||
|
||||
private static final String COMMAND_NAME = "hide";
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
private static final String USAGE_KEY1 = "usageHide";
|
||||
private static final String USAGE_KEY2 = "usageHidePlayer";
|
||||
|
||||
private static final String HIDE_CHANNEL_FIRSTLINE =
|
||||
Messages.get("hideChannelFirstLine");
|
||||
private static final String HIDE_PLAYER_FIRSTLINE =
|
||||
Messages.get("hidePlayerFirstLine");
|
||||
private static final String LIST_ENDLINE = Messages.get("listEndLine");
|
||||
private static final String LIST_PREFIX = Messages.get("listPlainPrefix");
|
||||
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandName()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -43,7 +34,7 @@ public class HideCommand extends SubCommandAbst {
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getPermissionNode()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
@@ -53,7 +44,7 @@ public class HideCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandType()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
@@ -64,13 +55,13 @@ public class HideCommand extends SubCommandAbst {
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#sendUsageMessage()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
ChannelMember sender, String label) {
|
||||
sendResourceMessage(sender, "", USAGE_KEY1, label);
|
||||
sendResourceMessage(sender, "", USAGE_KEY2, label);
|
||||
sender.sendMessage(Messages.usageHide(label));
|
||||
sender.sendMessage(Messages.usageHidePlayer(label));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -79,7 +70,7 @@ public class HideCommand extends SubCommandAbst {
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#runCommand(java.lang.String[])
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(
|
||||
@@ -184,15 +175,15 @@ public class HideCommand extends SubCommandAbst {
|
||||
private ArrayList<String> getHideInfoList(ChannelMember player) {
|
||||
|
||||
ArrayList<String> items = new ArrayList<String>();
|
||||
items.add(HIDE_CHANNEL_FIRSTLINE);
|
||||
items.add(Messages.hideChannelFirstLine());
|
||||
for ( String channel : getHideChannelNameList(player) ) {
|
||||
items.add(LIST_PREFIX + channel);
|
||||
items.add(Messages.listPlainPrefix() + channel);
|
||||
}
|
||||
items.add(HIDE_PLAYER_FIRSTLINE);
|
||||
items.add(Messages.hidePlayerFirstLine());
|
||||
for ( ChannelMember p : api.getHideinfo(player) ) {
|
||||
items.add(LIST_PREFIX + p.getDisplayName());
|
||||
items.add(Messages.listPlainPrefix() + p.getDisplayName());
|
||||
}
|
||||
items.add(LIST_ENDLINE);
|
||||
items.add(Messages.listEndLine());
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ package com.github.ucchyocean.lc3.command;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.github.ucchyocean.lc3.Messages;
|
||||
import com.github.ucchyocean.lc3.channel.Channel;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
|
||||
@@ -14,16 +15,15 @@ import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
* infoコマンドの実行クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class InfoCommand extends SubCommandAbst {
|
||||
public class InfoCommand extends LunaChatSubCommand {
|
||||
|
||||
private static final String COMMAND_NAME = "info";
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
private static final String USAGE_KEY = "usageInfo";
|
||||
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandName()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -33,7 +33,7 @@ public class InfoCommand extends SubCommandAbst {
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getPermissionNode()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
@@ -43,7 +43,7 @@ public class InfoCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandType()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
@@ -54,12 +54,12 @@ public class InfoCommand extends SubCommandAbst {
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#sendUsageMessage()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
ChannelMember sender, String label) {
|
||||
sendResourceMessage(sender, "", USAGE_KEY, label);
|
||||
sender.sendMessage(Messages.usageInfo(label));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,7 +68,7 @@ public class InfoCommand extends SubCommandAbst {
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#runCommand(java.lang.String[])
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc3.command;
|
||||
|
||||
import com.github.ucchyocean.lc3.Messages;
|
||||
import com.github.ucchyocean.lc3.channel.Channel;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
|
||||
@@ -12,11 +13,10 @@ import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
* inviteコマンドの実行クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class InviteCommand extends SubCommandAbst {
|
||||
public class InviteCommand extends LunaChatSubCommand {
|
||||
|
||||
private static final String COMMAND_NAME = "invite";
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
private static final String USAGE_KEY = "usageInvite";
|
||||
|
||||
private static final String PERMISSION_NODE_FORCE_INVITE
|
||||
= "lunachat-admin.force-invite";
|
||||
@@ -24,7 +24,7 @@ public class InviteCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandName()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -34,7 +34,7 @@ public class InviteCommand extends SubCommandAbst {
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getPermissionNode()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
@@ -44,7 +44,7 @@ public class InviteCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandType()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
@@ -55,12 +55,12 @@ public class InviteCommand extends SubCommandAbst {
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#sendUsageMessage()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
ChannelMember sender, String label) {
|
||||
sendResourceMessage(sender, "", USAGE_KEY, label);
|
||||
sender.sendMessage(Messages.usageInvite(label));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,7 +69,7 @@ public class InviteCommand extends SubCommandAbst {
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#runCommand(java.lang.String[])
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(ChannelMember sender, String label, String[] args) {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc3.command;
|
||||
|
||||
import com.github.ucchyocean.lc3.Messages;
|
||||
import com.github.ucchyocean.lc3.channel.Channel;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
|
||||
@@ -12,17 +13,16 @@ import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
* joinコマンドの実行クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class JoinCommand extends SubCommandAbst {
|
||||
public class JoinCommand extends LunaChatSubCommand {
|
||||
|
||||
private static final String COMMAND_NAME = "join";
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
private static final String PERMISSION_SPEAK_PREFIX = "lunachat.speak";
|
||||
private static final String USAGE_KEY = "usageJoin";
|
||||
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandName()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -32,7 +32,7 @@ public class JoinCommand extends SubCommandAbst {
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getPermissionNode()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
@@ -42,7 +42,7 @@ public class JoinCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandType()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
@@ -53,12 +53,12 @@ public class JoinCommand extends SubCommandAbst {
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#sendUsageMessage()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
ChannelMember sender, String label) {
|
||||
sendResourceMessage(sender, "", USAGE_KEY, label);
|
||||
sender.sendMessage(Messages.usageJoin(label));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,7 +67,7 @@ public class JoinCommand extends SubCommandAbst {
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#runCommand(java.lang.String[])
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc3.command;
|
||||
|
||||
import com.github.ucchyocean.lc3.Messages;
|
||||
import com.github.ucchyocean.lc3.channel.Channel;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
|
||||
@@ -12,16 +13,15 @@ import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
* kickコマンドの実行クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class KickCommand extends SubCommandAbst {
|
||||
public class KickCommand extends LunaChatSubCommand {
|
||||
|
||||
private static final String COMMAND_NAME = "kick";
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
private static final String USAGE_KEY = "usageKick";
|
||||
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandName()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -31,7 +31,7 @@ public class KickCommand extends SubCommandAbst {
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getPermissionNode()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
@@ -41,7 +41,7 @@ public class KickCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandType()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
@@ -52,12 +52,12 @@ public class KickCommand extends SubCommandAbst {
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#sendUsageMessage()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
ChannelMember sender, String label) {
|
||||
sendResourceMessage(sender, "", USAGE_KEY, label);
|
||||
sender.sendMessage(Messages.usageKick(label));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,7 +66,7 @@ public class KickCommand extends SubCommandAbst {
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#runCommand(java.lang.String[])
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc3.command;
|
||||
|
||||
import com.github.ucchyocean.lc3.Messages;
|
||||
import com.github.ucchyocean.lc3.channel.Channel;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
|
||||
@@ -12,16 +13,15 @@ import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
* leaveコマンドの実行クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class LeaveCommand extends SubCommandAbst {
|
||||
public class LeaveCommand extends LunaChatSubCommand {
|
||||
|
||||
private static final String COMMAND_NAME = "leave";
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
private static final String USAGE_KEY = "usageLeave";
|
||||
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandName()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -31,7 +31,7 @@ public class LeaveCommand extends SubCommandAbst {
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getPermissionNode()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
@@ -41,7 +41,7 @@ public class LeaveCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandType()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
@@ -52,12 +52,12 @@ public class LeaveCommand extends SubCommandAbst {
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#sendUsageMessage()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
ChannelMember sender, String label) {
|
||||
sendResourceMessage(sender, "", USAGE_KEY, label);
|
||||
sender.sendMessage(Messages.usageLeave(label));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,7 +66,7 @@ public class LeaveCommand extends SubCommandAbst {
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#runCommand(java.lang.String[])
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(
|
||||
|
||||
@@ -18,7 +18,7 @@ import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
* listコマンドの実行クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class ListCommand extends SubCommandAbst {
|
||||
public class ListCommand extends LunaChatSubCommand {
|
||||
|
||||
private static final String LIST_FIRSTLINE = Messages.get("listFirstLine");
|
||||
private static final String LIST_FIRSTLINE_PAGING = Messages.get("listFirstLinePaging");
|
||||
@@ -27,14 +27,13 @@ public class ListCommand extends SubCommandAbst {
|
||||
|
||||
private static final String COMMAND_NAME = "list";
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
private static final String USAGE_KEY = "usageList";
|
||||
|
||||
private static final int PAGE_SIZE = 8;
|
||||
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandName()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -44,7 +43,7 @@ public class ListCommand extends SubCommandAbst {
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getPermissionNode()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
@@ -54,7 +53,7 @@ public class ListCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandType()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
@@ -65,12 +64,12 @@ public class ListCommand extends SubCommandAbst {
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#sendUsageMessage()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
ChannelMember sender, String label) {
|
||||
sendResourceMessage(sender, "", USAGE_KEY, label);
|
||||
sender.sendMessage(Messages.usageList(label));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -79,7 +78,7 @@ public class ListCommand extends SubCommandAbst {
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#runCommand(java.lang.String[])
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(
|
||||
|
||||
@@ -17,20 +17,15 @@ import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
* logコマンドの実行クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class LogCommand extends SubCommandAbst {
|
||||
|
||||
private static final String LOGDISPLAY_FIRSTLINE = Messages.get("logDisplayFirstLine");
|
||||
private static final String LOGDISPLAY_ENDLINE = Messages.get("logDisplayEndLine");
|
||||
private static final String LOGDISPLAY_FORMAT = Messages.get("logDisplayFormat");
|
||||
public class LogCommand extends LunaChatSubCommand {
|
||||
|
||||
private static final String COMMAND_NAME = "log";
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
private static final String USAGE_KEY = "usageLog";
|
||||
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandName()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -40,7 +35,7 @@ public class LogCommand extends SubCommandAbst {
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getPermissionNode()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
@@ -50,7 +45,7 @@ public class LogCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandType()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
@@ -61,12 +56,12 @@ public class LogCommand extends SubCommandAbst {
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#sendUsageMessage()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
ChannelMember sender, String label) {
|
||||
sendResourceMessage(sender, "", USAGE_KEY, label);
|
||||
sender.sendMessage(Messages.usageLog(label));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -75,7 +70,7 @@ public class LogCommand extends SubCommandAbst {
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#runCommand(java.lang.String[])
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(ChannelMember sender, String label, String[] args) {
|
||||
@@ -116,8 +111,7 @@ public class LogCommand extends SubCommandAbst {
|
||||
// 参照権限を確認する
|
||||
String node = PERMISSION_NODE + "." + cname;
|
||||
if (sender.isPermissionSet(node) && !sender.hasPermission(node)) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgPermission",
|
||||
PERMISSION_NODE + "." + cname);
|
||||
sender.sendMessage(Messages.errmsgPermission(node));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -139,19 +133,19 @@ public class LogCommand extends SubCommandAbst {
|
||||
// チャンネルが存在するかどうか確認する
|
||||
Channel channel = api.getChannel(cname);
|
||||
if ( channel == null ) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgNotExist");
|
||||
sender.sendMessage(Messages.errmsgNotExist());
|
||||
return true;
|
||||
}
|
||||
|
||||
// BANされていないかどうか確認する
|
||||
if ( sender != null && channel.getBanned().contains(sender) ) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgBanned");
|
||||
sender.sendMessage(Messages.errmsgBanned());
|
||||
return true;
|
||||
}
|
||||
|
||||
// チャンネルのメンバーかどうかを確認する
|
||||
if (!channel.getMembers().contains(sender)) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgNomember");
|
||||
sender.sendMessage(Messages.errmsgNomember());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -159,7 +153,7 @@ public class LogCommand extends SubCommandAbst {
|
||||
}
|
||||
|
||||
// 整形と表示
|
||||
sender.sendMessage(String.format(LOGDISPLAY_FIRSTLINE, cname));
|
||||
sender.sendMessage(Messages.logDisplayFirstLine(cname));
|
||||
|
||||
for ( String log : logs ) {
|
||||
|
||||
@@ -170,11 +164,10 @@ public class LogCommand extends SubCommandAbst {
|
||||
if ( temp.length >= 3 ) {
|
||||
playerName = temp[2];
|
||||
}
|
||||
sender.sendMessage(String.format(
|
||||
LOGDISPLAY_FORMAT, date, playerName, message));
|
||||
sender.sendMessage(Messages.logDisplayFormat(date, playerName, message));
|
||||
}
|
||||
|
||||
sender.sendMessage(LOGDISPLAY_ENDLINE);
|
||||
sender.sendMessage(Messages.logDisplayEndLine());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,10 +19,8 @@ import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
*/
|
||||
public abstract class LunaChatCommand {
|
||||
|
||||
private static final String PREERR = Messages.get("errorPrefix");
|
||||
|
||||
private ArrayList<SubCommandAbst> commands;
|
||||
private ArrayList<SubCommandAbst> commonCommands;
|
||||
private ArrayList<LunaChatSubCommand> commands;
|
||||
private ArrayList<LunaChatSubCommand> commonCommands;
|
||||
private JoinCommand joinCommand;
|
||||
private HelpCommand helpCommand;
|
||||
|
||||
@@ -31,7 +29,7 @@ public abstract class LunaChatCommand {
|
||||
*/
|
||||
public LunaChatCommand() {
|
||||
|
||||
commands = new ArrayList<SubCommandAbst>();
|
||||
commands = new ArrayList<LunaChatSubCommand>();
|
||||
joinCommand = new JoinCommand();
|
||||
commands.add(joinCommand);
|
||||
commands.add(new LeaveCommand());
|
||||
@@ -57,7 +55,7 @@ public abstract class LunaChatCommand {
|
||||
helpCommand = new HelpCommand(commands);
|
||||
commands.add(helpCommand);
|
||||
|
||||
commonCommands = new ArrayList<SubCommandAbst>();
|
||||
commonCommands = new ArrayList<LunaChatSubCommand>();
|
||||
commonCommands.add(new HideCommand());
|
||||
commonCommands.add(new UnhideCommand());
|
||||
commonCommands.add(new DictionaryCommand());
|
||||
@@ -77,13 +75,13 @@ public abstract class LunaChatCommand {
|
||||
// チャンネルチャットが無効でも利用できるコマンドはここで処理する
|
||||
// (hide, unhide, dic, dictionary, reload)
|
||||
if ( args.length >= 1 ) {
|
||||
for ( SubCommandAbst c : commonCommands ) {
|
||||
for ( LunaChatSubCommand c : commonCommands ) {
|
||||
if ( c.getCommandName().equalsIgnoreCase(args[0]) ) {
|
||||
|
||||
// パーミッションの確認
|
||||
String node = c.getPermissionNode();
|
||||
if ( !sender.hasPermission(node) ) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgPermission", node);
|
||||
sender.sendMessage(Messages.errmsgPermission(node));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -96,7 +94,7 @@ public abstract class LunaChatCommand {
|
||||
// チャンネルチャット機能が無効になっている場合は、メッセージを表示して終了
|
||||
if ( !LunaChat.getConfig().isEnableChannelChat()
|
||||
&& !sender.hasPermission("lunachat-admin") ) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgChannelChatDisabled");
|
||||
sender.sendMessage(Messages.errmsgChannelChatDisabled());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -107,13 +105,13 @@ public abstract class LunaChatCommand {
|
||||
}
|
||||
|
||||
// 第1引数に指定されたコマンドを実行する
|
||||
for ( SubCommandAbst c : commands ) {
|
||||
for ( LunaChatSubCommand c : commands ) {
|
||||
if ( c.getCommandName().equalsIgnoreCase(args[0]) ) {
|
||||
|
||||
// パーミッションの確認
|
||||
String node = c.getPermissionNode();
|
||||
if ( !sender.hasPermission(node) ) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgPermission", node);
|
||||
sender.sendMessage(Messages.errmsgPermission(node));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -125,7 +123,7 @@ public abstract class LunaChatCommand {
|
||||
// 第1引数がコマンドでないなら、joinが指定されたとみなす
|
||||
String node = joinCommand.getPermissionNode();
|
||||
if ( !sender.hasPermission(node) ) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgPermission", node);
|
||||
sender.sendMessage(Messages.errmsgPermission(node));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -144,13 +142,13 @@ public abstract class LunaChatCommand {
|
||||
// コマンド名で補完する
|
||||
String arg = args[0].toLowerCase();
|
||||
ArrayList<String> coms = new ArrayList<String>();
|
||||
for ( SubCommandAbst c : commands ) {
|
||||
for ( LunaChatSubCommand c : commands ) {
|
||||
if ( c.getCommandName().startsWith(arg) &&
|
||||
sender.hasPermission(c.getPermissionNode()) ) {
|
||||
coms.add(c.getCommandName());
|
||||
}
|
||||
}
|
||||
for ( SubCommandAbst c : commonCommands ) {
|
||||
for ( LunaChatSubCommand c : commonCommands ) {
|
||||
if ( c.getCommandName().startsWith(arg) &&
|
||||
sender.hasPermission(c.getPermissionNode()) ) {
|
||||
coms.add(c.getCommandName());
|
||||
@@ -306,25 +304,6 @@ public abstract class LunaChatCommand {
|
||||
return new ArrayList<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* メッセージリソースのメッセージを、カラーコード置き換えしつつ、senderに送信する
|
||||
*
|
||||
* @param sender メッセージの送り先
|
||||
* @param pre プレフィックス
|
||||
* @param key リソースキー
|
||||
* @param args リソース内の置き換え対象キーワード
|
||||
*/
|
||||
private void sendResourceMessage(ChannelMember sender, String pre,
|
||||
String key, Object... args) {
|
||||
|
||||
String org = Messages.get(key);
|
||||
if ( org == null || org.equals("") ) {
|
||||
return;
|
||||
}
|
||||
String msg = String.format(pre + org, args);
|
||||
sender.sendMessage(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* TAB補完用の参加可能チャンネルリストを返す
|
||||
* @param sender コマンド実行者
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
* @author ucchy
|
||||
* @license LGPLv3
|
||||
* @copyright Copyright ucchy 2020
|
||||
*/
|
||||
package com.github.ucchyocean.lc3.command;
|
||||
|
||||
import com.github.ucchyocean.lc3.LunaChat;
|
||||
import com.github.ucchyocean.lc3.LunaChatAPI;
|
||||
import com.github.ucchyocean.lc3.LunaChatConfig;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
|
||||
/**
|
||||
* サブコマンドの抽象クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public abstract class LunaChatSubCommand {
|
||||
|
||||
/**
|
||||
* コマンドの種別
|
||||
* @author ucchy
|
||||
*/
|
||||
protected enum CommandType {
|
||||
|
||||
/** 一般ユーザー向けコマンド */
|
||||
USER,
|
||||
|
||||
/** チャンネルモデレーター向けコマンド */
|
||||
MODERATOR,
|
||||
|
||||
/** サーバー管理者向けコマンド */
|
||||
ADMIN
|
||||
}
|
||||
|
||||
protected LunaChatAPI api;
|
||||
protected LunaChatConfig config;
|
||||
|
||||
/**
|
||||
* コンストラクタ
|
||||
*/
|
||||
public LunaChatSubCommand() {
|
||||
api = LunaChat.getPlugin().getLunaChatAPI();
|
||||
config = LunaChat.getPlugin().getLunaChatConfig();
|
||||
}
|
||||
|
||||
// /**
|
||||
// * メッセージリソースのメッセージを、カラーコード置き換えしつつ、Channelに送信する
|
||||
// * @param channel メッセージの送り先
|
||||
// * @param pre プレフィックス
|
||||
// * @param key リソースキー
|
||||
// * @param player キーワード置き換えに使用するプレイヤー
|
||||
// */
|
||||
// protected void sendResourceMessageWithKeyword(
|
||||
// Channel channel, String key, ChannelMember player) {
|
||||
//
|
||||
// String msg = Messages.get(key);
|
||||
// if ( msg == null || msg.equals("") ) {
|
||||
// return;
|
||||
// }
|
||||
// msg = msg.replace("%ch", channel.getName());
|
||||
// msg = msg.replace("%color", channel.getColorCode());
|
||||
// if ( player != null ) {
|
||||
// msg = msg.replace("%username", player.getDisplayName());
|
||||
// msg = msg.replace("%player", player.getName());
|
||||
// } else {
|
||||
// msg = msg.replace("%username", "");
|
||||
// msg = msg.replace("%player", "");
|
||||
// }
|
||||
// msg = Utility.replaceColorCode(msg);
|
||||
// channel.sendMessage(null, msg, null, true, "system");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * メッセージリソースのメッセージを、カラーコード置き換えしつつ、Channelに送信する
|
||||
// * @param channel メッセージの送り先
|
||||
// * @param pre プレフィックス
|
||||
// * @param key リソースキー
|
||||
// * @param player キーワード置き換えに使用するプレイヤー
|
||||
// * @param minutes キーワード置き換えに使用する数値
|
||||
// */
|
||||
// protected void sendResourceMessageWithKeyword(
|
||||
// Channel channel, String key, ChannelMember player, int minutes) {
|
||||
//
|
||||
// String msg = Messages.get(key);
|
||||
// if ( msg == null || msg.equals("") ) {
|
||||
// return;
|
||||
// }
|
||||
// msg = msg.replace("%ch", channel.getName());
|
||||
// msg = msg.replace("%color", channel.getColorCode());
|
||||
// msg = msg.replace("%d", String.valueOf(minutes));
|
||||
// if ( player != null ) {
|
||||
// msg = msg.replace("%username", player.getDisplayName());
|
||||
// msg = msg.replace("%player", player.getName());
|
||||
// } else {
|
||||
// msg = msg.replace("%username", "");
|
||||
// msg = msg.replace("%player", "");
|
||||
// }
|
||||
// msg = Utility.replaceColorCode(msg);
|
||||
// channel.sendMessage(null, msg, null, true, "system");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * メッセージリソースのメッセージを、カラーコード置き換えしつつ、ChannelMemberに送信する
|
||||
// * @param sender メッセージの送り先
|
||||
// * @param pre プレフィックス
|
||||
// * @param key リソースキー
|
||||
// * @param args リソース内の置き換え対象キーワード
|
||||
// */
|
||||
// protected void sendResourceMessage(
|
||||
// ChannelMember cp, String pre, String key, Object... args) {
|
||||
//
|
||||
// String org = Messages.get(key);
|
||||
// if ( org == null || org.equals("") ) {
|
||||
// return;
|
||||
// }
|
||||
// String msg = String.format(pre + org, args);
|
||||
// cp.sendMessage(msg);
|
||||
// }
|
||||
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
*/
|
||||
public abstract String getCommandName();
|
||||
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
*/
|
||||
public abstract String getPermissionNode();
|
||||
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
*/
|
||||
public abstract CommandType getCommandType();
|
||||
|
||||
/**
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
*/
|
||||
public abstract void sendUsageMessage(
|
||||
ChannelMember sender, String label);
|
||||
|
||||
/**
|
||||
* コマンドを実行します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
*/
|
||||
public abstract boolean runCommand(
|
||||
ChannelMember sender, String label, String[] args);
|
||||
}
|
||||
@@ -19,7 +19,7 @@ public class ModCommand extends ModeratorCommand {
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandName()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -30,7 +30,7 @@ public class ModCommand extends ModeratorCommand {
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者O
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#sendUsageMessage()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
* moderatorコマンドの実行クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class ModeratorCommand extends SubCommandAbst {
|
||||
public class ModeratorCommand extends LunaChatSubCommand {
|
||||
|
||||
private static final String COMMAND_NAME = "moderator";
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
@@ -23,7 +23,7 @@ public class ModeratorCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandName()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -33,7 +33,7 @@ public class ModeratorCommand extends SubCommandAbst {
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getPermissionNode()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
@@ -43,7 +43,7 @@ public class ModeratorCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandType()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
@@ -54,7 +54,7 @@ public class ModeratorCommand extends SubCommandAbst {
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#sendUsageMessage()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
@@ -68,7 +68,7 @@ public class ModeratorCommand extends SubCommandAbst {
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#runCommand(java.lang.String[])
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(
|
||||
|
||||
@@ -12,7 +12,7 @@ import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
* muteコマンドの実行クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class MuteCommand extends SubCommandAbst {
|
||||
public class MuteCommand extends LunaChatSubCommand {
|
||||
|
||||
private static final String COMMAND_NAME = "mute";
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
@@ -22,7 +22,7 @@ public class MuteCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandName()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -32,7 +32,7 @@ public class MuteCommand extends SubCommandAbst {
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getPermissionNode()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
@@ -42,7 +42,7 @@ public class MuteCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandType()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
@@ -53,7 +53,7 @@ public class MuteCommand extends SubCommandAbst {
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#sendUsageMessage()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
@@ -68,7 +68,7 @@ public class MuteCommand extends SubCommandAbst {
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#runCommand(java.lang.String[])
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(
|
||||
|
||||
@@ -17,7 +17,7 @@ import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
* optionコマンドの実行クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class OptionCommand extends SubCommandAbst {
|
||||
public class OptionCommand extends LunaChatSubCommand {
|
||||
|
||||
private static final int MAX_LENGTH_DESCRIPTION = 30;
|
||||
private static final int MAX_LENGTH_ALIAS = 15;
|
||||
@@ -30,7 +30,7 @@ public class OptionCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandName()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -40,7 +40,7 @@ public class OptionCommand extends SubCommandAbst {
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getPermissionNode()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
@@ -50,7 +50,7 @@ public class OptionCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandType()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
@@ -61,7 +61,7 @@ public class OptionCommand extends SubCommandAbst {
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#sendUsageMessage()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
@@ -75,7 +75,7 @@ public class OptionCommand extends SubCommandAbst {
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#runCommand(java.lang.String[])
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(
|
||||
|
||||
@@ -12,7 +12,7 @@ import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
* pardonコマンドの実行クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class PardonCommand extends SubCommandAbst {
|
||||
public class PardonCommand extends LunaChatSubCommand {
|
||||
|
||||
private static final String COMMAND_NAME = "pardon";
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
@@ -21,7 +21,7 @@ public class PardonCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandName()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -31,7 +31,7 @@ public class PardonCommand extends SubCommandAbst {
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getPermissionNode()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
@@ -41,7 +41,7 @@ public class PardonCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandType()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
@@ -52,7 +52,7 @@ public class PardonCommand extends SubCommandAbst {
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#sendUsageMessage()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
@@ -66,7 +66,7 @@ public class PardonCommand extends SubCommandAbst {
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#runCommand(java.lang.String[])
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(
|
||||
|
||||
@@ -12,7 +12,7 @@ import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
* reloadコマンドの実行クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class ReloadCommand extends SubCommandAbst {
|
||||
public class ReloadCommand extends LunaChatSubCommand {
|
||||
|
||||
private static final String COMMAND_NAME = "reload";
|
||||
private static final String PERMISSION_NODE = "lunachat-admin." + COMMAND_NAME;
|
||||
@@ -21,7 +21,7 @@ public class ReloadCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandName()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -31,7 +31,7 @@ public class ReloadCommand extends SubCommandAbst {
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getPermissionNode()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
@@ -41,7 +41,7 @@ public class ReloadCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandType()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
@@ -52,7 +52,7 @@ public class ReloadCommand extends SubCommandAbst {
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#sendUsageMessage()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
@@ -66,7 +66,7 @@ public class ReloadCommand extends SubCommandAbst {
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#runCommand(java.lang.String[])
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(
|
||||
|
||||
@@ -12,7 +12,7 @@ import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
* removeコマンドの実行クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class RemoveCommand extends SubCommandAbst {
|
||||
public class RemoveCommand extends LunaChatSubCommand {
|
||||
|
||||
private static final String COMMAND_NAME = "remove";
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
@@ -21,7 +21,7 @@ public class RemoveCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandName()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -31,7 +31,7 @@ public class RemoveCommand extends SubCommandAbst {
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getPermissionNode()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
@@ -41,7 +41,7 @@ public class RemoveCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandType()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
@@ -52,7 +52,7 @@ public class RemoveCommand extends SubCommandAbst {
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#sendUsageMessage()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
@@ -66,7 +66,7 @@ public class RemoveCommand extends SubCommandAbst {
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#runCommand(java.lang.String[])
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.github.ucchyocean.lc3.command;
|
||||
import com.github.ucchyocean.lc3.channel.Channel;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
|
||||
public class SetCommand extends SubCommandAbst {
|
||||
public class SetCommand extends LunaChatSubCommand {
|
||||
|
||||
private static final String COMMAND_NAME = "set";
|
||||
private static final String PERMISSION_NODE = "lunachat-admin." + COMMAND_NAME;
|
||||
@@ -12,7 +12,7 @@ public class SetCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandName()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -22,7 +22,7 @@ public class SetCommand extends SubCommandAbst {
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getPermissionNode()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
@@ -32,7 +32,7 @@ public class SetCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandType()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
@@ -43,7 +43,7 @@ public class SetCommand extends SubCommandAbst {
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#sendUsageMessage()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(ChannelMember sender, String label) {
|
||||
@@ -56,7 +56,7 @@ public class SetCommand extends SubCommandAbst {
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#runCommand(java.lang.String[])
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(ChannelMember sender, String label, String[] args) {
|
||||
|
||||
@@ -1,161 +0,0 @@
|
||||
/*
|
||||
* @author ucchy
|
||||
* @license LGPLv3
|
||||
* @copyright Copyright ucchy 2020
|
||||
*/
|
||||
package com.github.ucchyocean.lc3.command;
|
||||
|
||||
import com.github.ucchyocean.lc3.LunaChat;
|
||||
import com.github.ucchyocean.lc3.LunaChatAPI;
|
||||
import com.github.ucchyocean.lc3.LunaChatConfig;
|
||||
import com.github.ucchyocean.lc3.Messages;
|
||||
import com.github.ucchyocean.lc3.Utility;
|
||||
import com.github.ucchyocean.lc3.channel.Channel;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
|
||||
/**
|
||||
* サブコマンドの抽象クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public abstract class SubCommandAbst {
|
||||
|
||||
/**
|
||||
* コマンドの種別
|
||||
* @author ucchy
|
||||
*/
|
||||
protected enum CommandType {
|
||||
|
||||
/** 一般ユーザー向けコマンド */
|
||||
USER,
|
||||
|
||||
/** チャンネルモデレーター向けコマンド */
|
||||
MODERATOR,
|
||||
|
||||
/** サーバー管理者向けコマンド */
|
||||
ADMIN
|
||||
}
|
||||
|
||||
protected static final String PREINFO = Messages.get("infoPrefix");
|
||||
protected static final String PREERR = Messages.get("errorPrefix");
|
||||
|
||||
protected LunaChatAPI api;
|
||||
protected LunaChatConfig config;
|
||||
|
||||
/**
|
||||
* コンストラクタ
|
||||
*/
|
||||
public SubCommandAbst() {
|
||||
api = LunaChat.getPlugin().getLunaChatAPI();
|
||||
config = LunaChat.getPlugin().getLunaChatConfig();
|
||||
}
|
||||
|
||||
/**
|
||||
* メッセージリソースのメッセージを、カラーコード置き換えしつつ、Channelに送信する
|
||||
* @param channel メッセージの送り先
|
||||
* @param pre プレフィックス
|
||||
* @param key リソースキー
|
||||
* @param player キーワード置き換えに使用するプレイヤー
|
||||
*/
|
||||
protected void sendResourceMessageWithKeyword(
|
||||
Channel channel, String key, ChannelMember player) {
|
||||
|
||||
String msg = Messages.get(key);
|
||||
if ( msg == null || msg.equals("") ) {
|
||||
return;
|
||||
}
|
||||
msg = msg.replace("%ch", channel.getName());
|
||||
msg = msg.replace("%color", channel.getColorCode());
|
||||
if ( player != null ) {
|
||||
msg = msg.replace("%username", player.getDisplayName());
|
||||
msg = msg.replace("%player", player.getName());
|
||||
} else {
|
||||
msg = msg.replace("%username", "");
|
||||
msg = msg.replace("%player", "");
|
||||
}
|
||||
msg = Utility.replaceColorCode(msg);
|
||||
channel.sendMessage(null, msg, null, true, "system");
|
||||
}
|
||||
|
||||
/**
|
||||
* メッセージリソースのメッセージを、カラーコード置き換えしつつ、Channelに送信する
|
||||
* @param channel メッセージの送り先
|
||||
* @param pre プレフィックス
|
||||
* @param key リソースキー
|
||||
* @param player キーワード置き換えに使用するプレイヤー
|
||||
* @param minutes キーワード置き換えに使用する数値
|
||||
*/
|
||||
protected void sendResourceMessageWithKeyword(
|
||||
Channel channel, String key, ChannelMember player, int minutes) {
|
||||
|
||||
String msg = Messages.get(key);
|
||||
if ( msg == null || msg.equals("") ) {
|
||||
return;
|
||||
}
|
||||
msg = msg.replace("%ch", channel.getName());
|
||||
msg = msg.replace("%color", channel.getColorCode());
|
||||
msg = msg.replace("%d", String.valueOf(minutes));
|
||||
if ( player != null ) {
|
||||
msg = msg.replace("%username", player.getDisplayName());
|
||||
msg = msg.replace("%player", player.getName());
|
||||
} else {
|
||||
msg = msg.replace("%username", "");
|
||||
msg = msg.replace("%player", "");
|
||||
}
|
||||
msg = Utility.replaceColorCode(msg);
|
||||
channel.sendMessage(null, msg, null, true, "system");
|
||||
}
|
||||
|
||||
/**
|
||||
* メッセージリソースのメッセージを、カラーコード置き換えしつつ、ChannelMemberに送信する
|
||||
* @param sender メッセージの送り先
|
||||
* @param pre プレフィックス
|
||||
* @param key リソースキー
|
||||
* @param args リソース内の置き換え対象キーワード
|
||||
*/
|
||||
protected void sendResourceMessage(
|
||||
ChannelMember cp, String pre, String key, Object... args) {
|
||||
|
||||
String org = Messages.get(key);
|
||||
if ( org == null || org.equals("") ) {
|
||||
return;
|
||||
}
|
||||
String msg = String.format(pre + org, args);
|
||||
cp.sendMessage(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
*/
|
||||
public abstract String getCommandName();
|
||||
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
*/
|
||||
public abstract String getPermissionNode();
|
||||
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
*/
|
||||
public abstract CommandType getCommandType();
|
||||
|
||||
/**
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
*/
|
||||
public abstract void sendUsageMessage(
|
||||
ChannelMember sender, String label);
|
||||
|
||||
/**
|
||||
* コマンドを実行します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
*/
|
||||
public abstract boolean runCommand(
|
||||
ChannelMember sender, String label, String[] args);
|
||||
}
|
||||
@@ -11,7 +11,7 @@ import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
* templateコマンドの実行クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class TemplateCommand extends SubCommandAbst {
|
||||
public class TemplateCommand extends LunaChatSubCommand {
|
||||
|
||||
private static final String COMMAND_NAME = "template";
|
||||
private static final String PERMISSION_NODE = "lunachat-admin." + COMMAND_NAME;
|
||||
@@ -20,7 +20,7 @@ public class TemplateCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandName()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -30,7 +30,7 @@ public class TemplateCommand extends SubCommandAbst {
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getPermissionNode()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
@@ -40,7 +40,7 @@ public class TemplateCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandType()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
@@ -51,7 +51,7 @@ public class TemplateCommand extends SubCommandAbst {
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#sendUsageMessage()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
@@ -65,7 +65,7 @@ public class TemplateCommand extends SubCommandAbst {
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#runCommand(java.lang.String[])
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(
|
||||
|
||||
@@ -13,7 +13,7 @@ import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
* unhideコマンドの実行クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class UnhideCommand extends SubCommandAbst {
|
||||
public class UnhideCommand extends LunaChatSubCommand {
|
||||
|
||||
private static final String COMMAND_NAME = "unhide";
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
@@ -23,7 +23,7 @@ public class UnhideCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandName()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -33,7 +33,7 @@ public class UnhideCommand extends SubCommandAbst {
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getPermissionNode()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
@@ -43,7 +43,7 @@ public class UnhideCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandType()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
@@ -54,7 +54,7 @@ public class UnhideCommand extends SubCommandAbst {
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#sendUsageMessage()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
@@ -69,7 +69,7 @@ public class UnhideCommand extends SubCommandAbst {
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#runCommand(java.lang.String[])
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(
|
||||
|
||||
@@ -12,7 +12,7 @@ import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
* unmuteコマンドの実行クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class UnmuteCommand extends SubCommandAbst {
|
||||
public class UnmuteCommand extends LunaChatSubCommand {
|
||||
|
||||
private static final String COMMAND_NAME = "unmute";
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
@@ -21,7 +21,7 @@ public class UnmuteCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandName()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -31,7 +31,7 @@ public class UnmuteCommand extends SubCommandAbst {
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getPermissionNode()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
@@ -41,7 +41,7 @@ public class UnmuteCommand extends SubCommandAbst {
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#getCommandType()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
@@ -52,7 +52,7 @@ public class UnmuteCommand extends SubCommandAbst {
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#sendUsageMessage()
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
@@ -66,7 +66,7 @@ public class UnmuteCommand extends SubCommandAbst {
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc3.command.SubCommandAbst#runCommand(java.lang.String[])
|
||||
* @see com.github.ucchyocean.lc3.command.LunaChatSubCommand#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする