コミットを比較
| 作成者 | SHA1 | 日付 | |
|---|---|---|---|
|
|
75656e8e5c | ||
|
|
06a817ff35 | ||
|
|
c139bbd79c | ||
|
|
23da91109e | ||
|
|
df6e351bc9 | ||
|
|
f334b685a5 | ||
|
|
24390f3c95 | ||
|
|
38e3f436a1 |
検索条件に一致するファイルはありません
@@ -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,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.github.ucchyocean</groupId>
|
||||
<artifactId>LunaChat</artifactId>
|
||||
<version>2.8.10</version>
|
||||
<version>2.8.11</version>
|
||||
<description>A powerfull chat channel plugin with IME (Kana-Kanji conversion) support</description>
|
||||
|
||||
<licenses>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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() &&
|
||||
|
||||
@@ -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 ) {
|
||||
|
||||
@@ -200,7 +200,7 @@ public class ChannelImpl extends Channel {
|
||||
}
|
||||
|
||||
// NGワード発言者に、NGワードアクションを実行する
|
||||
if ( isNG && player != null ) {
|
||||
if ( isNG ) {
|
||||
if ( config.getNgwordAction() == NGWordAction.BAN ) {
|
||||
// BANする
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
// テンプレート設定のロード
|
||||
|
||||
@@ -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,14 @@ public class BanCommand 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;
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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- 受信した個人チャットに返信します。'
|
||||
|
||||
@@ -38,6 +38,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 +222,9 @@ permissions:
|
||||
lunachat-admin.check:
|
||||
description: checkコマンドの使用権限
|
||||
default: op
|
||||
lunachat-admin.set:
|
||||
description: setコマンドの使用権限
|
||||
default: op
|
||||
lunachat-admin.reload:
|
||||
description: reloadコマンドの使用権限
|
||||
default: op
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする