コミットを比較
| 作成者 | SHA1 | 日付 | |
|---|---|---|---|
|
|
a981b1050a | ||
|
|
edbba82258 | ||
|
|
62311a0db0 |
検索条件に一致するファイルはありません
@@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.github.ucchyocean</groupId>
|
||||
<artifactId>LunaChat</artifactId>
|
||||
<version>2.8.11</version>
|
||||
<version>2.8.13</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.15.2-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -66,12 +66,12 @@ public class Resources {
|
||||
|
||||
YamlConfiguration messages = new YamlConfiguration();
|
||||
JarFile jarFile = null;
|
||||
BufferedReader reader = null;
|
||||
try {
|
||||
jarFile = new JarFile(LunaChat.getPluginJarFile());
|
||||
ZipEntry zipEntry = jarFile.getEntry(FILE_NAME);
|
||||
InputStream inputStream = jarFile.getInputStream(zipEntry);
|
||||
BufferedReader reader =
|
||||
new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
|
||||
reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
|
||||
String line;
|
||||
while ( (line = reader.readLine()) != null ) {
|
||||
if ( line.contains(":") && !line.startsWith("#") ) {
|
||||
@@ -85,6 +85,13 @@ public class Resources {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if ( reader != null ) {
|
||||
try {
|
||||
reader.close();
|
||||
} catch (IOException e) {
|
||||
// do nothing.
|
||||
}
|
||||
}
|
||||
if ( jarFile != null ) {
|
||||
try {
|
||||
jarFile.close();
|
||||
|
||||
@@ -88,8 +88,10 @@ public class BanCommand extends SubCommandAbst {
|
||||
|
||||
// 対象チャンネルを取得、取得できない場合はエラー表示して終了する
|
||||
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());
|
||||
@@ -126,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;
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
package com.github.ucchyocean.lc.command;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -22,6 +24,7 @@ import com.github.ucchyocean.lc.channel.ChannelPlayer;
|
||||
public class ListCommand extends SubCommandAbst {
|
||||
|
||||
private static final String LIST_FIRSTLINE = Resources.get("listFirstLine");
|
||||
private static final String LIST_FIRSTLINE_PAGING = Resources.get("listFirstLinePaging");
|
||||
private static final String LIST_ENDLINE = Resources.get("listEndLine");
|
||||
private static final String LIST_FORMAT = Resources.get("listFormat");
|
||||
|
||||
@@ -29,6 +32,8 @@ public class ListCommand extends SubCommandAbst {
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
private static final String USAGE_KEY = "usageList";
|
||||
|
||||
private static final int PAGE_SIZE = 8;
|
||||
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
@@ -88,8 +93,13 @@ public class ListCommand extends SubCommandAbst {
|
||||
player = (Player) sender;
|
||||
}
|
||||
|
||||
int page = 0;
|
||||
if ( args.length >= 2 && args[1].matches("[0-9]") ) {
|
||||
page = Integer.parseInt(args[1]);
|
||||
}
|
||||
|
||||
// リストを取得して表示する
|
||||
ArrayList<String> list = getList(player);
|
||||
ArrayList<String> list = getList(player, page);
|
||||
for (String msg : list) {
|
||||
sender.sendMessage(msg);
|
||||
}
|
||||
@@ -99,9 +109,39 @@ public class ListCommand extends SubCommandAbst {
|
||||
/**
|
||||
* リスト表示用のリストを返す
|
||||
* @param player プレイヤー、指定しない場合はnullにする
|
||||
* @param page 表示するページ、0を指定した場合は全表示
|
||||
* @return リスト
|
||||
*/
|
||||
private ArrayList<String> getList(Player player) {
|
||||
private ArrayList<String> getList(Player player, int page) {
|
||||
|
||||
ArrayList<String> list = getPlayerList(player);
|
||||
int size = list.size();
|
||||
int maxPage = (int)(size / PAGE_SIZE) + 1;
|
||||
|
||||
if ( page < 0 ) page = 0;
|
||||
if ( page > maxPage ) page = maxPage;
|
||||
|
||||
ArrayList<String> items = new ArrayList<>();
|
||||
if ( page == 0 ) { // 全表示
|
||||
items.add(LIST_FIRSTLINE);
|
||||
items.addAll(list);
|
||||
items.add(LIST_ENDLINE);
|
||||
} else { // ページ表示
|
||||
items.add(String.format(LIST_FIRSTLINE_PAGING, page, maxPage));
|
||||
int endIndex = (page * PAGE_SIZE > size) ? size : page * PAGE_SIZE;
|
||||
items.addAll(list.subList((page - 1) * PAGE_SIZE, endIndex));
|
||||
items.add(LIST_ENDLINE);
|
||||
}
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定されたプレイヤーに対するチャンネルリストを返す
|
||||
* @param player プレイヤー
|
||||
* @return チャンネルリスト
|
||||
*/
|
||||
private ArrayList<String> getPlayerList(Player player) {
|
||||
|
||||
ArrayList<String> items = new ArrayList<String>();
|
||||
String dchannel = "";
|
||||
@@ -117,8 +157,16 @@ public class ListCommand extends SubCommandAbst {
|
||||
}
|
||||
ChannelPlayer cp = ChannelPlayer.getChannelPlayer(player);
|
||||
|
||||
items.add(LIST_FIRSTLINE);
|
||||
for ( Channel channel : api.getChannels() ) {
|
||||
// チャンネルを取得して、チャンネル名でソートする
|
||||
ArrayList<Channel> channels = new ArrayList<>(api.getChannels());
|
||||
Collections.sort(channels, new Comparator<Channel>() {
|
||||
public int compare(Channel c1, Channel c2) {
|
||||
return c1.getName().compareTo(c2.getName());
|
||||
}
|
||||
});
|
||||
|
||||
// 指定されたプレイヤー名に合うように、フィルタ&表示用整形する。
|
||||
for ( Channel channel : channels ) {
|
||||
|
||||
// BANされているチャンネルは表示しない
|
||||
if ( channel.getBanned().contains(cp) ) {
|
||||
@@ -155,7 +203,6 @@ public class ListCommand extends SubCommandAbst {
|
||||
LIST_FORMAT, disp, onlineNum, memberNum, desc);
|
||||
items.add(item);
|
||||
}
|
||||
items.add(LIST_ENDLINE);
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ removeModeratorMessage: '&f[%color%ch&f]&7%player さんがチャンネルのモ
|
||||
noRecipientMessage: '&f[%color%ch&f]&7あなたの発言は、誰にも届きませんでした。'
|
||||
|
||||
listFirstLine: '&7---------- &bチャンネルリスト &7----------'
|
||||
listFirstLinePaging: '&7---------- &bチャンネルリスト&7(&c%d&7/&c%d&7) ----------'
|
||||
listEndLine: '&7----------------------------------'
|
||||
listFormat: '&7| &f%s&7(&c%d&7/&c%d&7) &a%s'
|
||||
listPlainPrefix: '&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) - チャンネルを作成します。
|
||||
@@ -241,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
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする