コミットを比較

..
10 コミット
作成者 SHA1 メッセージ 日付
ucchy edbba82258 LunaChat v2.8.12 : small bug fix. 2019-08-25 13:33:21 +09:00
ucchy 62311a0db0 Updated pom.xml file. 2019-08-25 00:31:43 +09:00
ucchy 75656e8e5c Merge remote-tracking branch 'origin/feature/v2.8.11' 2019-08-25 00:11:47 +09:00
ucchy 06a817ff35 LunaChat v2.8.11 : Fixed issue #160 2019-08-25 00:10:09 +09:00
ucchy c139bbd79c LunaChat v2.8.11 : Fixed issue #159 2019-08-24 01:46:13 +09:00
ucchy 23da91109e LunaChat v2.8.11 : Fixed issue #153 2019-08-24 00:18:57 +09:00
ucchy df6e351bc9 Merge branch 'master' of https://github.com/ucchyocean/LunaChat.git 2019-08-18 00:03:21 +09:00
ucchy f334b685a5 Fixed FindBugs warning messages. 2019-08-18 00:02:52 +09:00
うっちぃ 24390f3c95 Merge pull request #158 from KisaragiEffective/patch-1
Create LICENSE
2019-07-18 09:31:50 +09:00
KisaragiEffective 38e3f436a1 Create LICENSE
LGPLv3
2019-07-16 17:40:38 +09:00
19個のファイルの変更、514行の追加、84行の削除

検索条件に一致するファイルはありません

+165
ファイルの表示
@@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
+2 -5
ファイルの表示
@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.ucchyocean</groupId>
<artifactId>LunaChat</artifactId>
<version>2.8.10</version>
<version>2.8.12</version>
<description>A powerfull chat channel plugin with IME (Kana-Kanji conversion) support</description>
<licenses>
@@ -74,9 +74,6 @@
<executions>
<execution>
<phase>deploy</phase>
<goals>
<goal>assembly</goal>
</goals>
</execution>
</executions>
</plugin>
@@ -143,7 +140,7 @@
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.14.2-R0.1-SNAPSHOT</version>
<version>1.14.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
+1 -1
ファイルの表示
@@ -251,7 +251,7 @@ public class LunaChatConfig {
japanizeWait = config.getInt("japanizeWait", 1);
// globalチャンネルが、使用可能なチャンネル名かどうかを調べる
if ( !globalChannel.equals("") &&
if ( globalChannel != null && !globalChannel.equals("") &&
!globalChannel.matches("[0-9a-zA-Z\\-_]{1,20}") ) {
String msg = String.format(
Resources.get("errmsgCannotUseForGlobal"), globalChannel);
+3 -1
ファイルの表示
@@ -65,7 +65,9 @@ public class LunaChatLogger {
@Override
public void run() {
String msg = ChatColor.stripColor(message).replace(",", ",");
String msg = ChatColor.stripColor(message);
if ( msg == null ) msg = "";
msg = msg.replace(",", ",");
FileWriter writer = null;
try {
writer = new FileWriter(file, true);
+2 -1
ファイルの表示
@@ -150,7 +150,8 @@ public class PlayerListener implements Listener {
for ( Channel channel : LunaChat.getInstance().getLunaChatAPI().getChannels() ) {
String cname = channel.getName();
if ( channel.isPersonalChat() && cname.contains(player.getName()) ) {
String pname = player.getName();
if ( channel.isPersonalChat() && cname.contains(pname) ) {
boolean isAllOffline = true;
for ( ChannelPlayer cp : channel.getMembers() ) {
if ( !cp.equals(player) && cp.isOnline() &&
+1
ファイルの表示
@@ -962,6 +962,7 @@ public abstract class Channel implements ConfigurationSerializable {
return name.endsWith(".yml");
}
});
if ( files == null ) files = new File[0];
HashMap<String, Channel> result = new HashMap<String, Channel>();
for ( File file : files ) {
+1 -1
ファイルの表示
@@ -200,7 +200,7 @@ public class ChannelImpl extends Channel {
}
// NGワード発言者に、NGワードアクションを実行する
if ( isNG && player != null ) {
if ( isNG ) {
if ( config.getNgwordAction() == NGWordAction.BAN ) {
// BANする
+4 -1
ファイルの表示
@@ -80,7 +80,10 @@ public class ChannelManager implements LunaChatAPI {
defaultChannels = new HashMap<String, String>();
for ( String key : config.getKeys(false) ) {
defaultChannels.put(key, config.getString(key).toLowerCase());
String value = config.getString(key);
if ( value != null) {
defaultChannels.put(key, value.toLowerCase());
}
}
// テンプレート設定のロード
+11 -10
ファイルの表示
@@ -77,12 +77,6 @@ public class BanCommand extends SubCommandAbst {
public boolean runCommand(
CommandSender sender, String label, String[] args) {
// プレイヤーでなければ終了する
if (!(sender instanceof Player)) {
sendResourceMessage(sender, PREERR, "errmsgIngame");
return true;
}
// 実行引数から、BANするユーザーを取得する
String kickedName = "";
if (args.length >= 2) {
@@ -92,9 +86,16 @@ public class BanCommand extends SubCommandAbst {
return true;
}
// デフォルト参加チャンネルを取得、取得できない場合はエラー表示して終了する
Player kicker = (Player) sender;
Channel channel = api.getDefaultChannel(kicker.getName());
// 対象チャンネルを取得、取得できない場合はエラー表示して終了する
Channel channel = null;
boolean isSpecifiedChannel = false;
if (args.length >= 3) {
channel = api.getChannel(args[2]);
isSpecifiedChannel = true;
} else if (sender instanceof Player) {
Player kicker = (Player) sender;
channel = api.getDefaultChannel(kicker.getName());
}
if (channel == null) {
sendResourceMessage(sender, PREERR, "errmsgNoJoin");
return true;
@@ -127,7 +128,7 @@ public class BanCommand extends SubCommandAbst {
// 期限付きBANの場合、期限の指定が正しいかどうかをチェックする
int expireMinutes = -1;
if (args.length >= 3) {
if (args.length >= 3 && !isSpecifiedChannel) {
if ( !args[2].matches("[0-9]+") ) {
sendResourceMessage(sender, PREERR, "errmsgInvalidBanExpireParameter");
return true;
+25 -12
ファイルの表示
@@ -97,30 +97,43 @@ public class HideCommand extends SubCommandAbst {
// 引数チェック
String cname = null;
boolean isPlayerCommand = false;
boolean isChannelCommand = false;
if ( args.length <= 1 ) {
Channel def = api.getDefaultChannel(player.getName());
if ( def != null ) {
cname = def.getName();
}
} else if ( args.length >= 2 ) {
cname = args[1];
} else {
sendResourceMessage(sender, PREERR, "errmsgCommand");
return true;
}
// 指定されたコマンドが「/ch hide list」なら、リストを表示して終了
if ( cname != null && cname.equals("list") ) {
for ( String item : getHideInfoList(player) ) {
player.sendMessage(item);
if ( args[1].equals("list") ) {
// 指定されたコマンドが「/ch hide list」なら、リストを表示して終了
for ( String item : getHideInfoList(player) ) {
player.sendMessage(item);
}
return true;
} else if ( args.length >= 3 && args[1].equalsIgnoreCase("player") ) {
// 指定されたコマンドが「/ch hide player (player名)」なら、対象をプレイヤーとする。
isPlayerCommand = true;
isChannelCommand = false;
cname = args[2];
} else if ( args.length >= 3 && args[1].equalsIgnoreCase("channel") ) {
// 指定されたコマンドが「/ch hide channel (channel名)」なら、対象をチャンネルとする。
isPlayerCommand = false;
isChannelCommand = true;
cname = args[2];
} else {
// 「/ch hide (player名 または channel名)」
cname = args[1];
}
return true;
}
// チャンネルかプレイヤーが存在するかどうかをチェックする
boolean isChannelCommand = false;
Channel channel = api.getChannel(cname);
if ( channel != null ) {
if ( !isPlayerCommand && channel != null ) {
isChannelCommand = true;
} else if ( Utility.getOfflinePlayer(cname) == null ) {
sendResourceMessage(sender, PREERR, "errmsgNotExistChannelAndPlayer");
+8 -9
ファイルの表示
@@ -75,12 +75,6 @@ public class KickCommand extends SubCommandAbst {
public boolean runCommand(
CommandSender sender, String label, String[] args) {
// プレイヤーでなければ終了する
if (!(sender instanceof Player)) {
sendResourceMessage(sender, PREERR, "errmsgIngame");
return true;
}
// 実行引数から、キックするユーザーを取得する
String kickedName = "";
if (args.length >= 2) {
@@ -90,9 +84,14 @@ public class KickCommand extends SubCommandAbst {
return true;
}
// デフォルト参加チャンネルを取得、取得できない場合はエラー表示して終了する
Player kicker = (Player) sender;
Channel channel = api.getDefaultChannel(kicker.getName());
// 対象チャンネルを取得、取得できない場合はエラー表示して終了する
Channel channel = null;
if (args.length >= 3) {
channel = api.getChannel(args[2]);
} else if (sender instanceof Player) {
Player kicker = (Player) sender;
channel = api.getDefaultChannel(kicker.getName());
}
if (channel == null) {
sendResourceMessage(sender, PREERR, "errmsgNoJoin");
return true;
+121 -2
ファイルの表示
@@ -60,6 +60,7 @@ public class LunaChatCommand implements CommandExecutor {
commands.add(new OptionCommand());
commands.add(new TemplateCommand());
commands.add(new CheckCommand());
commands.add(new SetCommand());
helpCommand = new HelpCommand(commands);
commands.add(helpCommand);
@@ -157,6 +158,12 @@ public class LunaChatCommand implements CommandExecutor {
coms.add(c.getCommandName());
}
}
for ( SubCommandAbst c : commonCommands ) {
if ( c.getCommandName().startsWith(arg) &&
sender.hasPermission(c.getPermissionNode()) ) {
coms.add(c.getCommandName());
}
}
return coms;
} else if ( args.length == 2 && (
@@ -172,10 +179,46 @@ public class LunaChatCommand implements CommandExecutor {
}
return items;
} else if ( args.length == 2 && (
args[0].equalsIgnoreCase("ban") ||
args[0].equalsIgnoreCase("pardon") ||
args[0].equalsIgnoreCase("kick") ||
args[0].equalsIgnoreCase("mute") ||
args[0].equalsIgnoreCase("unmute") ) ) {
// プレイヤー名で補完する
String arg = args[1].toLowerCase();
ArrayList<String> items = new ArrayList<String>();
for ( Player player : Utility.getOnlinePlayers() ) {
String pname = player.getName();
pname = pname == null ? "" : pname.toLowerCase();
if ( pname.startsWith(arg) ) {
items.add(player.getName());
}
}
return items;
} else if ( args.length == 3 && (
args[0].equalsIgnoreCase("ban") ||
args[0].equalsIgnoreCase("pardon") ||
args[0].equalsIgnoreCase("kick") ||
args[0].equalsIgnoreCase("mute") ||
args[0].equalsIgnoreCase("unmute") ) ) {
// チャンネル名で補完する
String arg = args[2].toLowerCase();
ArrayList<String> items = new ArrayList<String>();
for ( String name : getListCanJoin(sender) ) {
if ( name.toLowerCase().startsWith(arg) ) {
items.add(name);
}
}
return items;
} else if ( args.length == 2 && (
args[0].equalsIgnoreCase("hide") ||
args[0].equalsIgnoreCase("unhide") ) ) {
// 参加可能チャンネル名とプレイヤー名で補完する
// 参加可能チャンネル名とプレイヤー名と
// 文字列"player", "channel"で補完する
String arg = args[1].toLowerCase();
ArrayList<String> items = new ArrayList<String>();
for ( String name : getListCanJoin(sender) ) {
@@ -184,10 +227,50 @@ public class LunaChatCommand implements CommandExecutor {
}
}
for ( Player player : Utility.getOnlinePlayers() ) {
if ( player.getName().toLowerCase().startsWith(arg) ) {
String pname = player.getName();
pname = pname == null ? "" : pname.toLowerCase();
if ( pname.startsWith(arg) ) {
items.add(player.getName());
}
}
if ( "player".startsWith(arg) ) {
items.add("player");
}
if ( "channel".startsWith(arg) ) {
items.add("channel");
}
return items;
} else if ( args.length == 3 &&
(args[0].equalsIgnoreCase("hide") ||
args[0].equalsIgnoreCase("unhide") ) &&
args[1].equalsIgnoreCase("player") ) {
// プレイヤー名で補完する
String arg = args[2].toLowerCase();
ArrayList<String> items = new ArrayList<String>();
for ( Player player : Utility.getOnlinePlayers() ) {
String pname = player.getName();
pname = pname == null ? "" : pname.toLowerCase();
if ( pname.startsWith(arg) ) {
items.add(player.getName());
}
}
return items;
} else if ( args.length == 3 &&
(args[0].equalsIgnoreCase("hide") ||
args[0].equalsIgnoreCase("unhide") ) &&
args[1].equalsIgnoreCase("channel") ) {
// チャンネル名で補完する
String arg = args[2].toLowerCase();
ArrayList<String> items = new ArrayList<String>();
for ( String name : getListCanJoin(sender) ) {
if ( name.toLowerCase().startsWith(arg) ) {
items.add(name);
}
}
return items;
} else if ( args.length == 2 && args[0].equalsIgnoreCase("remove") ) {
@@ -227,6 +310,42 @@ public class LunaChatCommand implements CommandExecutor {
}
return items;
} else if ( args.length == 2 &&
args[0].equalsIgnoreCase("set") ) {
// "default" で補完する
String arg = args[1].toLowerCase();
ArrayList<String> items = new ArrayList<String>();
if ( "default".startsWith(arg) ) {
items.add("default");
}
return items;
} else if ( args.length == 3 &&
args[0].equalsIgnoreCase("set") && args[1].equalsIgnoreCase("default") ) {
// プレイヤー名で補完する
String arg = args[2].toLowerCase();
ArrayList<String> items = new ArrayList<String>();
for ( Player player : Utility.getOnlinePlayers() ) {
String pname = player.getName();
pname = pname == null ? "" : pname.toLowerCase();
if ( pname.startsWith(arg) ) {
items.add(player.getName());
}
}
return items;
} else if ( args.length == 4 &&
args[0].equalsIgnoreCase("set") && args[1].equalsIgnoreCase("default") ) {
// チャンネル名で補完する
String arg = args[3].toLowerCase();
ArrayList<String> items = new ArrayList<String>();
for ( String name : getListCanJoin(sender) ) {
if ( name.toLowerCase().startsWith(arg) ) {
items.add(name);
}
}
return items;
}
return null;
}
+11 -10
ファイルの表示
@@ -77,12 +77,6 @@ public class MuteCommand extends SubCommandAbst {
public boolean runCommand(
CommandSender sender, String label, String[] args) {
// プレイヤーでなければ終了する
if (!(sender instanceof Player)) {
sendResourceMessage(sender, PREERR, "errmsgIngame");
return true;
}
// 実行引数から、Muteするユーザーを取得する
String kickedName = "";
if (args.length >= 2) {
@@ -92,9 +86,16 @@ public class MuteCommand extends SubCommandAbst {
return true;
}
// デフォルト参加チャンネルを取得、取得できない場合はエラー表示して終了する
Player kicker = (Player) sender;
Channel channel = api.getDefaultChannel(kicker.getName());
// 対象チャンネルを取得、取得できない場合はエラー表示して終了する
boolean isSpecifiedChannel = false;
Channel channel = null;
if (args.length >= 3) {
channel = api.getChannel(args[2]);
isSpecifiedChannel = true;
} else if (sender instanceof Player) {
Player kicker = (Player) sender;
channel = api.getDefaultChannel(kicker.getName());
}
if (channel == null) {
sendResourceMessage(sender, PREERR, "errmsgNoJoin");
return true;
@@ -121,7 +122,7 @@ public class MuteCommand extends SubCommandAbst {
// 期限付きMuteの場合、期限の指定が正しいかどうかをチェックする
int expireMinutes = -1;
if (args.length >= 3) {
if (args.length >= 3 && !isSpecifiedChannel) {
if ( !args[2].matches("[0-9]+") ) {
sendResourceMessage(sender, PREERR, "errmsgInvalidMuteExpireParameter");
return true;
+8 -9
ファイルの表示
@@ -75,12 +75,6 @@ public class PardonCommand extends SubCommandAbst {
public boolean runCommand(
CommandSender sender, String label, String[] args) {
// プレイヤーでなければ終了する
if (!(sender instanceof Player)) {
sendResourceMessage(sender, PREERR, "errmsgIngame");
return true;
}
// 実行引数から、BAN解除するユーザーを取得する
String kickedName = "";
if (args.length >= 2) {
@@ -90,9 +84,14 @@ public class PardonCommand extends SubCommandAbst {
return true;
}
// デフォルト参加チャンネルを取得、取得できない場合はエラー表示して終了する
Player kicker = (Player) sender;
Channel channel = api.getDefaultChannel(kicker.getName());
// 対象チャンネルを取得、取得できない場合はエラー表示して終了する
Channel channel = null;
if (args.length >= 3) {
channel = api.getChannel(args[2]);
} else if (sender instanceof Player) {
Player kicker = (Player) sender;
channel = api.getDefaultChannel(kicker.getName());
}
if (channel == null) {
sendResourceMessage(sender, PREERR, "errmsgNoJoin");
return true;
+105
ファイルの表示
@@ -0,0 +1,105 @@
package com.github.ucchyocean.lc.command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.github.ucchyocean.lc.Utility;
import com.github.ucchyocean.lc.channel.Channel;
public class SetCommand extends SubCommandAbst {
private static final String COMMAND_NAME = "set";
private static final String PERMISSION_NODE = "lunachat-admin." + COMMAND_NAME;
private static final String USAGE_KEY1 = "usageSet1";
/**
* コマンドを取得します。
* @return コマンド
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getCommandName()
*/
@Override
public String getCommandName() {
return COMMAND_NAME;
}
/**
* パーミッションノードを取得します。
* @return パーミッションノード
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getPermissionNode()
*/
@Override
public String getPermissionNode() {
return PERMISSION_NODE;
}
/**
* コマンドの種別を取得します。
* @return コマンド種別
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getCommandType()
*/
@Override
public CommandType getCommandType() {
return CommandType.ADMIN;
}
/**
* 使用方法に関するメッセージをsenderに送信します。
* @param sender コマンド実行者
* @param label 実行ラベル
* @see com.github.ucchyocean.lc.command.SubCommandAbst#sendUsageMessage()
*/
@Override
public void sendUsageMessage(CommandSender sender, String label) {
sendResourceMessage(sender, "", USAGE_KEY1, label);
}
/**
* コマンドを実行します。
* @param sender コマンド実行者
* @param label 実行ラベル
* @param args 実行時の引数
* @return コマンドが実行されたかどうか
* @see com.github.ucchyocean.lc.command.SubCommandAbst#runCommand(java.lang.String[])
*/
@Override
public boolean runCommand(CommandSender sender, String label, String[] args) {
// 引数チェック
// このコマンドは、コンソールでも実行できる
if ( args.length >= 3 && args[1].equalsIgnoreCase("default") ) {
// 「/ch set default (player名) [channel名]」の実行
String targetPlayer = args[2];
Channel targetChannel = null;
if ( args.length >= 4 ) {
targetChannel = api.getChannel(args[3]);
} else if ( sender instanceof Player ) {
Player player = (Player)sender;
targetChannel = api.getDefaultChannel(player.getName());
}
if ( targetChannel == null ) {
// チャンネルが正しく指定されなかった
sendResourceMessage(sender, PREERR, "errmsgNotExistOrNotSpecified");
return true;
}
// 発言先を設定
api.setDefaultChannel(targetPlayer, targetChannel.getName());
sendResourceMessage(sender, PREINFO, "cmdmsgSetDefault", targetPlayer, targetChannel.getName());
Player target = Utility.getPlayerExact(targetPlayer);
if ( target != null ) {
sendResourceMessage(target, PREINFO, "cmdmsgSet", targetChannel.getName());
}
return true;
}
return false;
}
}
+19 -6
ファイルの表示
@@ -87,22 +87,35 @@ public class UnhideCommand extends SubCommandAbst {
// 引数チェック
String cname = null;
boolean isPlayerCommand = false;
boolean isChannelCommand = false;
if ( args.length <= 1 ) {
Channel def = api.getDefaultChannel(player.getName());
if ( def != null ) {
cname = def.getName();
}
} else if ( args.length >= 2 ) {
cname = args[1];
} else {
sendResourceMessage(sender, PREERR, "errmsgCommand");
return true;
if ( args.length >= 3 && args[1].equalsIgnoreCase("player") ) {
// 指定されたコマンドが「/ch unhide player (player名)」なら、対象をプレイヤーとする。
isPlayerCommand = true;
isChannelCommand = false;
cname = args[2];
} else if ( args.length >= 3 && args[1].equalsIgnoreCase("channel") ) {
// 指定されたコマンドが「/ch unhide channel (channel名)」なら、対象をチャンネルとする。
isPlayerCommand = false;
isChannelCommand = true;
cname = args[2];
} else {
// 「/ch hide (player名 または channel名)」
cname = args[1];
}
}
// チャンネルかプレイヤーが存在するかどうかをチェックする
boolean isChannelCommand = false;
Channel channel = api.getChannel(cname);
if ( channel != null ) {
if ( !isPlayerCommand && channel != null ) {
isChannelCommand = true;
} else if ( Utility.getOfflinePlayer(cname) == null ) {
sendResourceMessage(sender, PREERR, "errmsgNotExistChannelAndPlayer");
+8 -9
ファイルの表示
@@ -75,12 +75,6 @@ public class UnmuteCommand extends SubCommandAbst {
public boolean runCommand(
CommandSender sender, String label, String[] args) {
// プレイヤーでなければ終了する
if (!(sender instanceof Player)) {
sendResourceMessage(sender, PREERR, "errmsgIngame");
return true;
}
// 実行引数から、Mute解除するユーザーを取得する
String kickedName = "";
if (args.length >= 2) {
@@ -90,9 +84,14 @@ public class UnmuteCommand extends SubCommandAbst {
return true;
}
// デフォルト参加チャンネルを取得、取得できない場合はエラー表示して終了する
Player kicker = (Player) sender;
Channel channel = api.getDefaultChannel(kicker.getName());
// 対象チャンネルを取得、取得できない場合はエラー表示して終了する
Channel channel = null;
if (args.length >= 3) {
channel = api.getChannel(args[2]);
} else if (sender instanceof Player) {
Player kicker = (Player) sender;
channel = api.getDefaultChannel(kicker.getName());
}
if (channel == null) {
sendResourceMessage(sender, PREERR, "errmsgNoJoin");
return true;
+3
ファイルの表示
@@ -94,6 +94,7 @@ cmdmsgTemplateRemove: 'テンプレート %s番を削除しました。'
cmdmsgCheck: '削除対象のチャンネルは %d 個です。'
cmdmsgCheckConfirm: '全て削除する場合は、/%s check remove を実行してください。'
cmdmsgCheckRemove: '%d 個のチャンネルを削除しました。'
cmdmsgSetDefault: '%s さんの発言先を %s に設定しました。'
cmdmsgPlayerJapanize: 'Your chat''s Japanize conversion was turned %s.'
cmdmsgPlayerJapanizeOther: '%s さんのJapanize変換を %s にしました。'
@@ -105,6 +106,7 @@ errmsgIngame: 'このコマンドはゲーム内からしか実行できませ
errmsgCommand: 'コマンドの指定が正しくありません。'
errmsgNotExist: '指定されたチャンネルが存在しません。'
errmsgNotExistChannelAndPlayer: '指定されたチャンネルもプレイヤーも存在しません。'
errmsgNotExistOrNotSpecified: '指定されたチャンネルが存在しないか、チャンネルが指定されませんでした。'
errmsgExist: '指定されたチャンネル名が既に存在します。'
errmsgNomember: '指定されたチャンネルに参加していません。'
errmsgNomemberOther: '指定されたプレイヤーはチャンネルに参加していません。'
@@ -196,6 +198,7 @@ usageCheck1: '&6/%s check &7- モデレーターがいないチャンネルを
usageCheck2: '&6/%s check remove &7- /ch check で一覧されたチャンネルを全て削除します。'
usageReload: '&6/%s reload &7- config.ymlの再読み込みをします。'
usageHelp: '&6/%s help [user|mod|admin] [page] &7- ヘルプを表示します。'
usageSet1: '&6/%s set default (player) [channel] &7- 指定したプレイヤーの発言先チャンネルを、指定したチャンネルに設定します。'
usageMessage: '&6/%s (name) [message] &7- 指定したプレイヤーとの個人チャットを開始します。'
usageReply: '&6/%s [message] &7- 受信した個人チャットに返信します。'
+16 -7
ファイルの表示
@@ -16,17 +16,21 @@ commands:
/<command> invite (name) [force] - 指定した人をチャンネルチャットに招待します。
/<command> accept - 招待を受けてチャンネルチャットに入室します。
/<command> deny - 招待を拒否します。
/<command> kick (name) - 指定した人をチャンネルチャットからキックします。
/<command> ban (name) - 指定した人をチャンネルチャットからBANします。
/<command> kick (name) [channel] - 指定した人をチャンネルチャットからキックします。
/<command> ban (name) [channel] - 指定した人をチャンネルチャットからBANします。
/<command> ban (name) [minutes] - 指定した人を指定した分間、BANします。
/<command> pardon (name) - 指定した人のBANを解除します。
/<command> mute (name) - 指定した人をチャンネルチャットからMuteします。
/<command> pardon (name) [channel] - 指定した人のBANを解除します。
/<command> mute (name) [channel] - 指定した人をチャンネルチャットからMuteします。
/<command> mute (name) [minutes] - 指定した人を指定した分間、Muteします。
/<command> unmute (name) - 指定した人のMuteを解除します。
/<command> hide [channel] - 指定したチャンネルの発言内容を非表示にします。指定を省略すると、現在自分が居るチャンネルが非表示になります。
/<command> unmute (name) [channel] - 指定した人のMuteを解除します。
/<command> hide (channel) - 指定したチャンネルの発言内容を非表示にします。
/<command> hide channel (channel) - 指定したチャンネルの発言内容を非表示にします。
/<command> hide (player) - 指定したプレイヤーの発言内容を非表示にします。
/<command> unhide [channel] - 指定したチャンネルの発言内容を非表示から表示に戻します。
/<command> hide player (player) - 指定したプレイヤーの発言内容を非表示にします。
/<command> unhide (channel) - 指定したチャンネルの発言内容を非表示から表示に戻します。
/<command> unhide channel (channel) - 指定したチャンネルの発言内容を非表示から表示に戻します。
/<command> unhide (player) - 指定したプレイヤーの発言内容を非表示から表示に戻します。
/<command> unhide player (player) - 指定したプレイヤーの発言内容を非表示から表示に戻します。
/<command> info [channel] - チャンネルの情報を表示します。
/<command> log [channel] [key=value...] - チャンネルのログを表示します。
/<command> create (channel) - チャンネルを作成します。
@@ -38,6 +42,7 @@ commands:
/<command> template (number) (template...) - メッセージフォーマットのテンプレートを登録します。
/<command> check - モデレータがいないチャンネルを一覧します。
/<command> check remove - /<command> check で一覧されたチャンネルを全て削除します。
/<command> set default (player) [channel] - 指定したプレイヤーの発言先チャンネルを、指定したチャンネルに設定します。
/<command> reload - config.ymlの再読み込みをします。
/<command> help [user|mod|admin] [page] - ヘルプを表示します。
tell:
@@ -221,6 +226,9 @@ permissions:
lunachat-admin.check:
description: checkコマンドの使用権限
default: op
lunachat-admin.set:
description: setコマンドの使用権限
default: op
lunachat-admin.reload:
description: reloadコマンドの使用権限
default: op
@@ -237,6 +245,7 @@ permissions:
lunachat-admin.template: true
lunachat-admin.dictionary: true
lunachat-admin.check: true
lunachat-admin.set: true
lunachat-admin.reload: true
lunachat-admin.japanize-other: true
lunachat-admin.force-invite: true