コミットを比較
| 作成者 | SHA1 | 日付 | |
|---|---|---|---|
|
|
a7b28931e9 | ||
|
|
d3fa98509d | ||
|
|
42a9625595 | ||
|
|
aab06a502a | ||
|
|
2e032f9ecf | ||
|
|
f7f741d926 | ||
|
|
c9e4d01a68 | ||
|
|
fdeb9d0610 | ||
|
|
2b0e3a9b97 | ||
|
|
e053d72010 | ||
|
|
eeb1a28911 | ||
|
|
dca18b87e4 |
検索条件に一致するファイルはありません
@@ -13,6 +13,7 @@
|
||||
<files>
|
||||
<file>
|
||||
<source>target/LunaChat.jar</source>
|
||||
<destName>plugins/LunaChat.jar</destName>
|
||||
</file>
|
||||
</files>
|
||||
|
||||
|
||||
バイナリ
バイナリファイルは表示されません。
@@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.github.ucchyocean</groupId>
|
||||
<artifactId>LunaChat</artifactId>
|
||||
<version>2.7.1</version>
|
||||
<version>2.7.7</version>
|
||||
<description>チャンネルチャットプラグイン</description>
|
||||
|
||||
<licenses>
|
||||
@@ -92,14 +92,20 @@
|
||||
<url>http://nexus.theyeticave.net/content/repositories/pub_releases</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>dynmap-repo</id>
|
||||
<name>mikeprimm repository</name>
|
||||
<id>mikeprimm-repo</id>
|
||||
<name>Dynmap repository</name>
|
||||
<url>http://repo.mikeprimm.com/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>rasagne-repo</id>
|
||||
<name>Craft Bukkit Alternate Nexus Repository</name>
|
||||
<url>http://lasagne.tgnmc.com:8081/nexus/content/groups/public</url>
|
||||
<id>onarandombox-repo</id>
|
||||
<name>Multiverse repository</name>
|
||||
<url>http://repo.onarandombox.com/content/groups/public</url>
|
||||
</repository>
|
||||
|
||||
<repository>
|
||||
<id>spigot-repo</id>
|
||||
<name>Spigot Maven Repository</name>
|
||||
<url>https://hub.spigotmc.org/nexus/content/groups/public</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
@@ -107,17 +113,29 @@
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<version>1.8-R0.1-SNAPSHOT</version>
|
||||
<version>1.8.8-R0.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.milkbowl.vault</groupId>
|
||||
<artifactId>Vault</artifactId>
|
||||
<version>1.5.2</version>
|
||||
<artifactId>VaultAPI</artifactId>
|
||||
<version>1.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.dynmap</groupId>
|
||||
<artifactId>dynmap-api</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>uk.co.oliwali</groupId>
|
||||
<artifactId>HawkEye</artifactId>
|
||||
<version>1.5.5</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/lib/HawkEye.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.onarandombox.multiversecore</groupId>
|
||||
<artifactId>Multiverse-Core</artifactId>
|
||||
<version>2.5</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -11,13 +11,13 @@ import java.util.List;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.configuration.serialization.ConfigurationSerialization;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import com.github.ucchyocean.lc.bridge.DynmapBridge;
|
||||
import com.github.ucchyocean.lc.bridge.HawkEyeBridge;
|
||||
import com.github.ucchyocean.lc.bridge.MultiverseCoreBridge;
|
||||
import com.github.ucchyocean.lc.bridge.VaultChatBridge;
|
||||
import com.github.ucchyocean.lc.channel.Channel;
|
||||
import com.github.ucchyocean.lc.channel.ChannelManager;
|
||||
import com.github.ucchyocean.lc.command.LunaChatCommand;
|
||||
import com.github.ucchyocean.lc.command.LunaChatJapanizeCommand;
|
||||
@@ -37,6 +37,8 @@ public class LunaChat extends JavaPlugin {
|
||||
|
||||
private VaultChatBridge vaultchat;
|
||||
private DynmapBridge dynmap;
|
||||
private HawkEyeBridge hawkeye;
|
||||
private MultiverseCoreBridge multiverse;
|
||||
|
||||
private ExpireCheckTask expireCheckerTask;
|
||||
private LunaChatLogger normalChatLogger;
|
||||
@@ -78,6 +80,17 @@ public class LunaChat extends JavaPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
// HawkEye のロード
|
||||
if ( getServer().getPluginManager().isPluginEnabled("HawkEye") ) {
|
||||
hawkeye = new HawkEyeBridge(this);
|
||||
}
|
||||
|
||||
// MultiverseCore のロード
|
||||
temp = getServer().getPluginManager().getPlugin("Multiverse-Core");
|
||||
if ( temp != null ) {
|
||||
multiverse = MultiverseCoreBridge.load(temp);
|
||||
}
|
||||
|
||||
// リスナーの登録
|
||||
getServer().getPluginManager().registerEvents(new PlayerListener(), this);
|
||||
|
||||
@@ -87,9 +100,6 @@ public class LunaChat extends JavaPlugin {
|
||||
replyCommand = new LunaChatReplyCommand();
|
||||
lcjapanizeCommand = new LunaChatJapanizeCommand();
|
||||
|
||||
// シリアル化可能オブジェクトの登録
|
||||
ConfigurationSerialization.registerClass(Channel.class, "Channel");
|
||||
|
||||
// 期限チェッカータスクの起動
|
||||
expireCheckerTask = new ExpireCheckTask();
|
||||
expireCheckerTask.runTaskTimerAsynchronously(this, 100, 600);
|
||||
@@ -198,6 +208,22 @@ public class LunaChat extends JavaPlugin {
|
||||
return dynmap;
|
||||
}
|
||||
|
||||
/**
|
||||
* HawkEye連携クラスを返す
|
||||
* @return HawkEyeBridge
|
||||
*/
|
||||
public HawkEyeBridge getHawkEye() {
|
||||
return hawkeye;
|
||||
}
|
||||
|
||||
/**
|
||||
* MultiverseCore連携クラスを返す
|
||||
* @return MultiverseCoreBridge
|
||||
*/
|
||||
public MultiverseCoreBridge getMultiverseCore() {
|
||||
return multiverse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通常チャット用のロガーを返す
|
||||
* @return normalChatLogger
|
||||
|
||||
@@ -29,6 +29,9 @@ public class LunaChatConfig {
|
||||
/** チャンネルチャットの発言内容を、ログに残すかどうか */
|
||||
private boolean loggingChat;
|
||||
|
||||
/** チャンネルチャットの発言内容を、HawkEyeに記録するかどうか */
|
||||
private boolean loggingChatToHawkEye;
|
||||
|
||||
/** チャンネルチャットの発言内容を、コンソールに表示するかどうか */
|
||||
private boolean displayChatOnConsole;
|
||||
|
||||
@@ -156,6 +159,7 @@ public class LunaChatConfig {
|
||||
enableChannelChat = config.getBoolean("enableChannelChat", true);
|
||||
noJoinAsGlobal = config.getBoolean("noJoinAsGlobal", true);
|
||||
loggingChat = config.getBoolean("loggingChat", true);
|
||||
loggingChatToHawkEye = config.getBoolean("loggingChatToHawkEye", true);
|
||||
displayChatOnConsole = config.getBoolean("displayChatOnConsole", true);
|
||||
globalMarker = config.getString("globalMarker", "!");
|
||||
zeroMemberRemove = config.getBoolean("zeroMemberRemove", false);
|
||||
@@ -262,6 +266,14 @@ public class LunaChatConfig {
|
||||
return loggingChat;
|
||||
}
|
||||
|
||||
/**
|
||||
* チャンネルチャットの発言内容を、HawkEyeに記録するかどうか
|
||||
* @return loggingChatToHawkEye
|
||||
*/
|
||||
public boolean isLoggingChatToHawkEye() {
|
||||
return loggingChatToHawkEye;
|
||||
}
|
||||
|
||||
/**
|
||||
* チャンネルチャットの発言内容を、コンソールに表示するかどうか
|
||||
* @return displayChatOnConsoleを返す
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
@@ -14,6 +16,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
@@ -24,7 +27,7 @@ import com.github.ucchyocean.lc.channel.Channel;
|
||||
import com.github.ucchyocean.lc.channel.ChannelPlayer;
|
||||
import com.github.ucchyocean.lc.channel.ChannelPlayerName;
|
||||
import com.github.ucchyocean.lc.channel.ChannelPlayerUUID;
|
||||
import com.github.ucchyocean.lc.channel.DelayedJapanizeConvertTask;
|
||||
import com.github.ucchyocean.lc.channel.DelayedJapanizeNormalChatTask;
|
||||
import com.github.ucchyocean.lc.event.LunaChatPreChatEvent;
|
||||
import com.github.ucchyocean.lc.japanize.JapanizeType;
|
||||
|
||||
@@ -38,11 +41,22 @@ public class PlayerListener implements Listener {
|
||||
private static final String LIST_ENDLINE = Resources.get("listEndLine");
|
||||
private static final String LIST_FORMAT = Resources.get("listFormat");
|
||||
|
||||
private SimpleDateFormat dateFormat;
|
||||
private SimpleDateFormat timeFormat;
|
||||
|
||||
/**
|
||||
* コンストラクタ
|
||||
*/
|
||||
public PlayerListener() {
|
||||
dateFormat = new SimpleDateFormat("yyyy/MM/dd");
|
||||
timeFormat = new SimpleDateFormat("HH:mm:ss");
|
||||
}
|
||||
|
||||
/**
|
||||
* プレイヤーのチャットごとに呼び出されるメソッド
|
||||
* @param event チャットイベント
|
||||
*/
|
||||
@EventHandler
|
||||
@EventHandler(priority=EventPriority.HIGH, ignoreCancelled=true)
|
||||
public void onChat(AsyncPlayerChatEvent event) {
|
||||
|
||||
LunaChatConfig config = LunaChat.getInstance().getLunaChatConfig();
|
||||
@@ -235,6 +249,14 @@ public class PlayerListener implements Listener {
|
||||
message = Utility.replaceColorCode(message);
|
||||
}
|
||||
|
||||
// hideされているプレイヤーを、recipientから抜く
|
||||
for ( ChannelPlayer cp : api.getHidelist(player) ) {
|
||||
Player p = cp.getPlayer();
|
||||
if ( p != null ) {
|
||||
event.getRecipients().remove(p);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 一時的にJapanizeスキップ設定かどうかを確認する
|
||||
boolean skipJapanize = false;
|
||||
@@ -274,8 +296,8 @@ public class PlayerListener implements Listener {
|
||||
|
||||
String taskFormat = Utility.replaceColorCode(config.getJapanizeLine2Format());
|
||||
|
||||
DelayedJapanizeConvertTask task = new DelayedJapanizeConvertTask(message,
|
||||
config.getJapanizeType(), null, player, taskFormat, null);
|
||||
DelayedJapanizeNormalChatTask task = new DelayedJapanizeNormalChatTask(
|
||||
message, config.getJapanizeType(), player, taskFormat, event);
|
||||
|
||||
// 発言処理を必ず先に実施させるため、遅延を入れてタスクを実行する。
|
||||
int wait = config.getJapanizeWait();
|
||||
@@ -365,6 +387,13 @@ public class PlayerListener implements Listener {
|
||||
format = format.replace("%username", "%1$s");
|
||||
format = format.replace("%msg", "%2$s");
|
||||
|
||||
if ( format.contains("%date") ) {
|
||||
format = format.replace("%date", dateFormat.format(new Date()));
|
||||
}
|
||||
if ( format.contains("%time") ) {
|
||||
format = format.replace("%time", timeFormat.format(new Date()));
|
||||
}
|
||||
|
||||
if ( format.contains("%prefix") || format.contains("%suffix") ) {
|
||||
|
||||
String prefix = "";
|
||||
@@ -379,7 +408,15 @@ public class PlayerListener implements Listener {
|
||||
}
|
||||
|
||||
if ( format.contains("%world") ) {
|
||||
format = format.replace("%world", player.getWorld().getName());
|
||||
|
||||
String worldname = null;
|
||||
if ( LunaChat.getInstance().getMultiverseCore() != null ) {
|
||||
worldname = LunaChat.getInstance().getMultiverseCore().getWorldAlias(player.getWorld());
|
||||
}
|
||||
if ( worldname == null || worldname.equals("") ) {
|
||||
worldname = player.getWorld().getName();
|
||||
}
|
||||
format = format.replace("%world", worldname);
|
||||
}
|
||||
|
||||
return Utility.replaceColorCode(format);
|
||||
|
||||
@@ -301,4 +301,14 @@ public class Utility {
|
||||
return null;
|
||||
return player;
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定された名前のプレイヤーを取得する
|
||||
* @param name プレイヤー名
|
||||
* @return プレイヤー
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public static Player getPlayerExact(String name) {
|
||||
return Bukkit.getPlayer(name);
|
||||
}
|
||||
}
|
||||
@@ -96,6 +96,7 @@ public class DynmapBridge implements Listener {
|
||||
channel.chatFromOtherSource(
|
||||
event.getName(), event.getSource(), event.getMessage());
|
||||
event.setProcessed();
|
||||
dynmap.sendBroadcastToWeb(null, event.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* @author ucchy
|
||||
* @license LGPLv3
|
||||
* @copyright Copyright ucchy 2015
|
||||
*/
|
||||
package com.github.ucchyocean.lc.bridge;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import uk.co.oliwali.HawkEye.util.HawkEyeAPI;
|
||||
|
||||
/**
|
||||
* HawkEye連携クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class HawkEyeBridge {
|
||||
|
||||
private JavaPlugin lunaChatInstance;
|
||||
|
||||
public HawkEyeBridge(JavaPlugin lunaChatInstance) {
|
||||
this.lunaChatInstance = lunaChatInstance;
|
||||
}
|
||||
|
||||
/**
|
||||
* HawkEyeにログを書き出す
|
||||
* @param action アクション
|
||||
* @param player プレイヤー
|
||||
* @param location 場所
|
||||
* @param data データ
|
||||
*/
|
||||
public void writeLog(String action, Player player, Location location, String data) {
|
||||
HawkEyeAPI.addCustomEntry(lunaChatInstance, action, player, location, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* HawkEyeにログを書き出す
|
||||
* @param action アクション
|
||||
* @param player プレイヤー名
|
||||
* @param location 場所
|
||||
* @param data データ
|
||||
*/
|
||||
public void writeLog(String action, String player, Location location, String data) {
|
||||
HawkEyeAPI.addCustomEntry(lunaChatInstance, action, player, location, data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* @author ucchy
|
||||
* @license LGPLv3
|
||||
* @copyright Copyright ucchy 2015
|
||||
*/
|
||||
package com.github.ucchyocean.lc.bridge;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.api.Core;
|
||||
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
|
||||
|
||||
/**
|
||||
* MultiverseCore連携クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class MultiverseCoreBridge {
|
||||
|
||||
/** MultiverseCore API クラス */
|
||||
private Core mvc;
|
||||
|
||||
/** コンストラクタは使用不可 */
|
||||
private MultiverseCoreBridge() {
|
||||
}
|
||||
|
||||
/**
|
||||
* MultiverseCore-apiをロードする
|
||||
* @param plugin MultiverseCoreのプラグインインスタンス
|
||||
* @param ロードしたかどうか
|
||||
*/
|
||||
public static MultiverseCoreBridge load(Plugin plugin) {
|
||||
|
||||
if ( plugin instanceof MultiverseCore ) {
|
||||
MultiverseCoreBridge bridge = new MultiverseCoreBridge();
|
||||
bridge.mvc = (Core)plugin;
|
||||
return bridge;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定されたワールドのエイリアス名を取得する
|
||||
* @param worldName ワールド名
|
||||
* @return エイリアス名、取得できない場合はnullが返される
|
||||
*/
|
||||
public String getWorldAlias(String worldName) {
|
||||
|
||||
MultiverseWorld mvworld = mvc.getMVWorldManager().getMVWorld(worldName);
|
||||
if ( mvworld != null ) {
|
||||
return mvworld.getAlias();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定されたワールドのエイリアス名を取得する
|
||||
* @param world ワールド
|
||||
* @return エイリアス名、取得できない場合はnullが返される
|
||||
*/
|
||||
public String getWorldAlias(World world) {
|
||||
|
||||
MultiverseWorld mvworld = mvc.getMVWorldManager().getMVWorld(world);
|
||||
if ( mvworld != null ) {
|
||||
return mvworld.getAlias();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,6 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc.bridge;
|
||||
|
||||
import net.milkbowl.vault.Vault;
|
||||
import net.milkbowl.vault.chat.Chat;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
@@ -33,14 +32,12 @@ public class VaultChatBridge {
|
||||
*/
|
||||
public static VaultChatBridge load(Plugin plugin) {
|
||||
|
||||
if ( plugin instanceof Vault ) {
|
||||
RegisteredServiceProvider<Chat> chatProvider =
|
||||
Bukkit.getServicesManager().getRegistration(Chat.class);
|
||||
if ( chatProvider != null ) {
|
||||
VaultChatBridge bridge = new VaultChatBridge();
|
||||
bridge.chatPlugin = chatProvider.getProvider();
|
||||
return bridge;
|
||||
}
|
||||
RegisteredServiceProvider<Chat> chatProvider =
|
||||
Bukkit.getServicesManager().getRegistration(Chat.class);
|
||||
if ( chatProvider != null ) {
|
||||
VaultChatBridge bridge = new VaultChatBridge();
|
||||
bridge.chatPlugin = chatProvider.getProvider();
|
||||
return bridge;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -364,9 +364,10 @@ public abstract class Channel implements ConfigurationSerializable {
|
||||
* @param message メッセージ
|
||||
* @param format フォーマット
|
||||
* @param sendDynmap dynmapへ送信するかどうか
|
||||
* @param displayName 発言者の表示名(APIに使用されます)
|
||||
*/
|
||||
public abstract void sendMessage(
|
||||
ChannelPlayer player, String message, String format, boolean sendDynmap);
|
||||
ChannelPlayer player, String message, String format, boolean sendDynmap, String displayName);
|
||||
|
||||
/**
|
||||
* チャンネル情報を返す
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc.channel;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@@ -67,6 +69,9 @@ public class ChannelImpl extends Channel {
|
||||
|
||||
private static final String ERRMSG_MUTED = Resources.get("errmsgMuted");
|
||||
|
||||
private SimpleDateFormat dateFormat;
|
||||
private SimpleDateFormat timeFormat;
|
||||
|
||||
/** ロガー */
|
||||
private LunaChatLogger logger;
|
||||
|
||||
@@ -79,6 +84,8 @@ public class ChannelImpl extends Channel {
|
||||
super(name);
|
||||
|
||||
logger = new LunaChatLogger(name.replace(">", "-"));
|
||||
dateFormat = new SimpleDateFormat("yyyy/MM/dd");
|
||||
timeFormat = new SimpleDateFormat("HH:mm:ss");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -101,7 +108,7 @@ public class ChannelImpl extends Channel {
|
||||
LunaChatAPI api = LunaChat.getInstance().getLunaChatAPI();
|
||||
|
||||
// Muteされているかどうかを確認する
|
||||
if ( player != null && getMuted().contains(player) ) {
|
||||
if ( getMuted().contains(player) ) {
|
||||
player.sendMessage( PREERR + ERRMSG_MUTED );
|
||||
return;
|
||||
}
|
||||
@@ -178,13 +185,13 @@ public class ChannelImpl extends Channel {
|
||||
}
|
||||
|
||||
// タスクを作成しておく
|
||||
delayedTask = new DelayedJapanizeConvertTask(maskedMessage,
|
||||
delayedTask = new DelayedJapanizeChannelChatTask(maskedMessage,
|
||||
japanizeType, this, player, jpFormat, messageFormat);
|
||||
}
|
||||
|
||||
if ( isIncludeSyncChat ) {
|
||||
// メッセージの送信
|
||||
sendMessage(player, maskedMessage, msgFormat, true);
|
||||
sendMessage(player, maskedMessage, msgFormat, true, player.getDisplayName());
|
||||
}
|
||||
|
||||
// 非同期実行タスクがある場合、追加で実行する
|
||||
@@ -204,7 +211,7 @@ public class ChannelImpl extends Channel {
|
||||
String m = replaceKeywordsForSystemMessages(
|
||||
MSG_BAN_NGWORD, player.getName());
|
||||
player.sendMessage(m);
|
||||
sendMessage(null, m, null, true);
|
||||
sendMessage(null, m, null, true, "system");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,7 +224,7 @@ public class ChannelImpl extends Channel {
|
||||
String m = replaceKeywordsForSystemMessages(
|
||||
MSG_KICK_NGWORD, player.getName());
|
||||
player.sendMessage(m);
|
||||
sendMessage(null, m, null, true);
|
||||
sendMessage(null, m, null, true, "system");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,7 +237,7 @@ public class ChannelImpl extends Channel {
|
||||
String m = replaceKeywordsForSystemMessages(
|
||||
MSG_MUTE_NGWORD, player.getName());
|
||||
player.sendMessage(m);
|
||||
sendMessage(null, m, null, true);
|
||||
sendMessage(null, m, null, true, "system");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -271,7 +278,8 @@ public class ChannelImpl extends Channel {
|
||||
}
|
||||
|
||||
// メッセージの送信
|
||||
sendMessage(null, maskedMessage, msgFormat, false);
|
||||
boolean sendDynmap = source == null || !source.equals("web");
|
||||
sendMessage(null, maskedMessage, msgFormat, sendDynmap, name);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -292,7 +300,7 @@ public class ChannelImpl extends Channel {
|
||||
return;
|
||||
}
|
||||
msg = replaceKeywordsForSystemMessages(msg, player.getName());
|
||||
sendMessage(null, msg, null, false);
|
||||
sendMessage(null, msg, null, false, "system");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -301,10 +309,11 @@ public class ChannelImpl extends Channel {
|
||||
* @param message メッセージ
|
||||
* @param format フォーマット
|
||||
* @param sendDynmap dynmapへ送信するかどうか
|
||||
* @param name 発言者名
|
||||
*/
|
||||
@Override
|
||||
public void sendMessage(ChannelPlayer player, String message,
|
||||
String format, boolean sendDynmap) {
|
||||
String format, boolean sendDynmap, String name) {
|
||||
|
||||
LunaChatConfig config = LunaChat.getInstance().getLunaChatConfig();
|
||||
|
||||
@@ -404,7 +413,7 @@ public class ChannelImpl extends Channel {
|
||||
// イベントコール
|
||||
LunaChatChannelMessageEvent event =
|
||||
new LunaChatChannelMessageEvent(
|
||||
getName(), player, message, recipients);
|
||||
getName(), player, message, recipients, name, originalMessage);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
message = event.getMessage();
|
||||
recipients = event.getRecipients();
|
||||
@@ -448,8 +457,7 @@ public class ChannelImpl extends Channel {
|
||||
}
|
||||
|
||||
// ロギング
|
||||
String p = (player != null) ? player.getName() : "";
|
||||
log(originalMessage, p);
|
||||
log(originalMessage, name);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -615,7 +623,7 @@ public class ChannelImpl extends Channel {
|
||||
// メッセージ通知を流す
|
||||
if ( !MSG_BAN_EXPIRED.equals("") ) {
|
||||
String msg = replaceKeywords(MSG_BAN_EXPIRED, cp);
|
||||
sendMessage(null, msg, null, false);
|
||||
sendMessage(null, msg, null, false, "system");
|
||||
}
|
||||
|
||||
if ( cp.isOnline() && !MSG_BAN_EXPIRED_PLAYER.equals("") ) {
|
||||
@@ -639,7 +647,7 @@ public class ChannelImpl extends Channel {
|
||||
// メッセージ通知を流す
|
||||
if ( !MSG_MUTE_EXPIRED.equals("") ) {
|
||||
String msg = replaceKeywords(MSG_MUTE_EXPIRED, cp);
|
||||
sendMessage(null, msg, null, false);
|
||||
sendMessage(null, msg, null, false, "system");
|
||||
}
|
||||
|
||||
if ( cp.isOnline() && !MSG_MUTE_EXPIRED_PLAYER.equals("") ) {
|
||||
@@ -679,6 +687,13 @@ public class ChannelImpl extends Channel {
|
||||
msg = msg.replace("%color", getColorCode());
|
||||
msg = msg.replace("%to", getPrivateMessageTo());
|
||||
|
||||
if ( msg.contains("%date") ) {
|
||||
msg = msg.replace("%date", dateFormat.format(new Date()));
|
||||
}
|
||||
if ( msg.contains("%time") ) {
|
||||
msg = msg.replace("%time", timeFormat.format(new Date()));
|
||||
}
|
||||
|
||||
if ( player != null ) {
|
||||
msg = msg.replace("%username", player.getDisplayName());
|
||||
msg = msg.replace("%player", player.getName());
|
||||
@@ -688,8 +703,16 @@ public class ChannelImpl extends Channel {
|
||||
msg = msg.replace("%suffix", player.getSuffix());
|
||||
}
|
||||
|
||||
if ( msg.contains("%world") ) {
|
||||
msg = msg.replace("%world", player.getWorldName());
|
||||
if ( format.contains("%world") ) {
|
||||
|
||||
String worldname = null;
|
||||
if ( LunaChat.getInstance().getMultiverseCore() != null ) {
|
||||
worldname = LunaChat.getInstance().getMultiverseCore().getWorldAlias(player.getWorldName());
|
||||
}
|
||||
if ( worldname == null || worldname.equals("") ) {
|
||||
worldname = player.getWorldName();
|
||||
}
|
||||
format = format.replace("%world", worldname);
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -730,6 +753,15 @@ public class ChannelImpl extends Channel {
|
||||
if ( config.isLoggingChat() && logger != null ) {
|
||||
logger.log(message, player);
|
||||
}
|
||||
if ( config.isLoggingChatToHawkEye() && LunaChat.getInstance().getHawkEye() != null ) {
|
||||
Location location = null;
|
||||
Player pl = Utility.getPlayerExact(player);
|
||||
if ( pl != null ) {
|
||||
location = pl.getLocation();
|
||||
}
|
||||
String data = Utility.stripColor(message);
|
||||
LunaChat.getInstance().getHawkEye().writeLog("channel(" + getName() + ")", player, location, data);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -645,7 +645,7 @@ public class ChannelManager implements LunaChatAPI {
|
||||
|
||||
// Japanize変換タスクを作成して、同期で実行する。
|
||||
DelayedJapanizeConvertTask task = new DelayedJapanizeConvertTask(
|
||||
message, type, null, null, "%japanize", null);
|
||||
message, type, null, null, "%japanize");
|
||||
if ( task.runSync() ) {
|
||||
return task.getResult();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* @author ucchy
|
||||
* @license LGPLv3
|
||||
* @copyright Copyright ucchy 2015
|
||||
*/
|
||||
package com.github.ucchyocean.lc.channel;
|
||||
|
||||
import com.github.ucchyocean.lc.japanize.JapanizeType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author ucchy
|
||||
*/
|
||||
public class DelayedJapanizeChannelChatTask extends DelayedJapanizeConvertTask {
|
||||
|
||||
private Channel channel;
|
||||
private ChannelPlayer player;
|
||||
private String lineFormat;
|
||||
|
||||
/**
|
||||
* コンストラクタ
|
||||
* @param org 変換前の文字列
|
||||
* @param type 変換タイプ
|
||||
* @param channel 変換後に発言する、発言先チャンネル
|
||||
* @param player 発言したプレイヤー
|
||||
* @param japanizeFormat 変換後に発言するときの、発言フォーマット
|
||||
* @param lineFormat
|
||||
*/
|
||||
public DelayedJapanizeChannelChatTask(String org, JapanizeType type, Channel channel,
|
||||
ChannelPlayer player, String japanizeFormat, String lineFormat) {
|
||||
super(org, type, channel, player, japanizeFormat);
|
||||
this.channel = channel;
|
||||
this.player = player;
|
||||
this.lineFormat = lineFormat;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.lang.Runnable#run()
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
if ( runSync() ) {
|
||||
// チャンネルへ送信
|
||||
String name = (player != null) ? player.getDisplayName() : "";
|
||||
channel.sendMessage(player, getResult(), lineFormat, true, name);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -34,7 +34,6 @@ public class DelayedJapanizeConvertTask extends BukkitRunnable {
|
||||
private Channel channel;
|
||||
private ChannelPlayer player;
|
||||
private String format;
|
||||
private String lineFormat;
|
||||
private String result;
|
||||
|
||||
/**
|
||||
@@ -46,40 +45,17 @@ public class DelayedJapanizeConvertTask extends BukkitRunnable {
|
||||
* @param japanizeFormat 変換後に発言するときの、発言フォーマット
|
||||
*/
|
||||
public DelayedJapanizeConvertTask(String org, JapanizeType type, Channel channel,
|
||||
ChannelPlayer player, String japanizeFormat, String lineFormat) {
|
||||
ChannelPlayer player, String japanizeFormat) {
|
||||
this.org = org;
|
||||
this.type = type;
|
||||
this.channel = channel;
|
||||
this.player = player;
|
||||
this.format = japanizeFormat;
|
||||
this.lineFormat = lineFormat;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.lang.Runnable#run()
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
if ( runSync() ) {
|
||||
|
||||
// チャンネルへ送信
|
||||
if ( channel != null ) {
|
||||
channel.sendMessage(player, result, lineFormat, true);
|
||||
} else {
|
||||
Bukkit.broadcastMessage(result);
|
||||
|
||||
// 設定に応じてdynmapへ送信する
|
||||
if ( LunaChat.getInstance().getLunaChatConfig().
|
||||
isSendBroadcastChannelChatToDynmap() &&
|
||||
LunaChat.getInstance().getDynmap() != null ) {
|
||||
if ( player != null && player.getPlayer() != null )
|
||||
LunaChat.getInstance().getDynmap().chat(player.getPlayer(), result);
|
||||
else
|
||||
LunaChat.getInstance().getDynmap().broadcast(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
runSync();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* @author ucchy
|
||||
* @license LGPLv3
|
||||
* @copyright Copyright ucchy 2015
|
||||
*/
|
||||
package com.github.ucchyocean.lc.channel;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
|
||||
import com.github.ucchyocean.lc.LunaChat;
|
||||
import com.github.ucchyocean.lc.japanize.JapanizeType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author ucchy
|
||||
*/
|
||||
public class DelayedJapanizeNormalChatTask extends DelayedJapanizeConvertTask {
|
||||
|
||||
private ChannelPlayer player;
|
||||
private AsyncPlayerChatEvent event;
|
||||
|
||||
/**
|
||||
* コンストラクタ
|
||||
* @param org 変換前の文字列
|
||||
* @param type 変換タイプ
|
||||
* @param player 発言したプレイヤー
|
||||
* @param japanizeFormat 変換後に発言するときの、発言フォーマット
|
||||
* @param event イベント
|
||||
*/
|
||||
public DelayedJapanizeNormalChatTask(String org, JapanizeType type,
|
||||
ChannelPlayer player, String japanizeFormat, final AsyncPlayerChatEvent event) {
|
||||
super(org, type, null, player, japanizeFormat);
|
||||
this.player = player;
|
||||
this.event = event;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.lang.Runnable#run()
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
if ( runSync() ) {
|
||||
|
||||
String result = getResult();
|
||||
|
||||
// 送信
|
||||
for ( Player p : event.getRecipients() ) {
|
||||
p.sendMessage(result);
|
||||
}
|
||||
Bukkit.getConsoleSender().sendMessage(result);
|
||||
|
||||
// 設定に応じてdynmapへ送信する
|
||||
if ( LunaChat.getInstance().getLunaChatConfig().
|
||||
isSendBroadcastChannelChatToDynmap() &&
|
||||
LunaChat.getInstance().getDynmap() != null ) {
|
||||
if ( player != null && player.getPlayer() != null )
|
||||
LunaChat.getInstance().getDynmap().chat(player.getPlayer(), result);
|
||||
else
|
||||
LunaChat.getInstance().getDynmap().broadcast(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,9 @@ public class InviteCommand extends SubCommandAbst {
|
||||
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";
|
||||
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
@@ -74,6 +77,22 @@ public class InviteCommand extends SubCommandAbst {
|
||||
@Override
|
||||
public boolean runCommand(CommandSender sender, String label, String[] args) {
|
||||
|
||||
if ( args.length >= 3 && args[2].equalsIgnoreCase("force") ) {
|
||||
return runForceInviteCommand(sender, label, args);
|
||||
}
|
||||
|
||||
return runNormalInviteCommand(sender, label, args);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通常のinviteコマンドを処理する
|
||||
* @param sender
|
||||
* @param label
|
||||
* @param args
|
||||
* @return
|
||||
*/
|
||||
private boolean runNormalInviteCommand(CommandSender sender, String label, String[] args) {
|
||||
|
||||
// プレイヤーでなければ終了する
|
||||
if (!(sender instanceof Player)) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgIngame");
|
||||
@@ -129,4 +148,74 @@ public class InviteCommand extends SubCommandAbst {
|
||||
sendResourceMessage(invited, PREINFO, "cmdmsgInvited2");
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 強制入室コマンドを処理する
|
||||
* @param sender
|
||||
* @param label
|
||||
* @param args
|
||||
* @return
|
||||
*/
|
||||
private boolean runForceInviteCommand(CommandSender sender, String label, String[] args) {
|
||||
|
||||
// パーミッションチェック
|
||||
if ( !sender.hasPermission(PERMISSION_NODE_FORCE_INVITE) ) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgPermission",
|
||||
PERMISSION_NODE_FORCE_INVITE);
|
||||
return true;
|
||||
}
|
||||
|
||||
Player player = null;
|
||||
if (sender instanceof Player) {
|
||||
player = (Player) sender;
|
||||
}
|
||||
|
||||
// 引数チェック
|
||||
// このコマンドは、コンソールでも実行できるが、その場合はチャンネル名を指定する必要がある
|
||||
String cname = null;
|
||||
if ( player != null && args.length <= 3 ) {
|
||||
Channel def = api.getDefaultChannel(player.getName());
|
||||
if ( def != null ) {
|
||||
cname = def.getName();
|
||||
}
|
||||
} else if ( args.length >= 4 ) {
|
||||
cname = args[3];
|
||||
} else {
|
||||
sendResourceMessage(sender, PREERR, "errmsgCommand");
|
||||
return true;
|
||||
}
|
||||
|
||||
// チャンネルが存在するかどうか確認する
|
||||
Channel channel = api.getChannel(cname);
|
||||
if ( channel == null ) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgNotExist");
|
||||
return true;
|
||||
}
|
||||
|
||||
// 招待相手が存在するかどうかを確認する
|
||||
String invitedName = args[1];
|
||||
ChannelPlayer invited = ChannelPlayer.getChannelPlayer(invitedName);
|
||||
if ( invited == null || !invited.isOnline() ) {
|
||||
sendResourceMessage(sender, PREERR,
|
||||
"errmsgNotfoundPlayer", invitedName);
|
||||
return true;
|
||||
}
|
||||
|
||||
// 招待相手が既にチャンネルに参加しているかどうかを確認する
|
||||
if (channel.getMembers().contains(invited)) {
|
||||
sendResourceMessage(sender, PREERR,
|
||||
"errmsgInvitedAlreadyExist", invitedName);
|
||||
return true;
|
||||
}
|
||||
|
||||
// 参加する
|
||||
channel.addMember(invited);
|
||||
api.setDefaultChannel(invitedName, cname);
|
||||
sendResourceMessage(sender, PREINFO,
|
||||
"cmdmsgInvite", invitedName, channel.getName());
|
||||
sendResourceMessage(invited, PREINFO,
|
||||
"cmdmsgJoin", channel.getName());
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,7 @@ public class LunaChatCommand implements CommandExecutor {
|
||||
private static final String PREERR = Resources.get("errorPrefix");
|
||||
|
||||
private ArrayList<SubCommandAbst> commands;
|
||||
private ArrayList<SubCommandAbst> commonCommands;
|
||||
private JoinCommand joinCommand;
|
||||
private HelpCommand helpCommand;
|
||||
|
||||
@@ -49,8 +50,6 @@ public class LunaChatCommand implements CommandExecutor {
|
||||
commands.add(new PardonCommand());
|
||||
commands.add(new MuteCommand());
|
||||
commands.add(new UnmuteCommand());
|
||||
commands.add(new HideCommand());
|
||||
commands.add(new UnhideCommand());
|
||||
commands.add(new InfoCommand());
|
||||
commands.add(new LogCommand());
|
||||
commands.add(new CreateCommand());
|
||||
@@ -58,14 +57,18 @@ public class LunaChatCommand implements CommandExecutor {
|
||||
commands.add(new FormatCommand());
|
||||
commands.add(new ModeratorCommand());
|
||||
commands.add(new ModCommand());
|
||||
commands.add(new DictionaryCommand());
|
||||
commands.add(new DicCommand());
|
||||
commands.add(new OptionCommand());
|
||||
commands.add(new TemplateCommand());
|
||||
commands.add(new CheckCommand());
|
||||
commands.add(new ReloadCommand());
|
||||
helpCommand = new HelpCommand(commands);
|
||||
commands.add(helpCommand);
|
||||
|
||||
commonCommands = new ArrayList<SubCommandAbst>();
|
||||
commonCommands.add(new HideCommand());
|
||||
commonCommands.add(new UnhideCommand());
|
||||
commonCommands.add(new DictionaryCommand());
|
||||
commonCommands.add(new DicCommand());
|
||||
commonCommands.add(new ReloadCommand());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -75,6 +78,25 @@ public class LunaChatCommand implements CommandExecutor {
|
||||
public boolean onCommand(CommandSender sender, Command command,
|
||||
String label, String[] args) {
|
||||
|
||||
// チャンネルチャットが無効でも利用できるコマンドはここで処理する
|
||||
// (hide, unhide, dic, dictionary, reload)
|
||||
if ( args.length >= 1 ) {
|
||||
for ( SubCommandAbst c : commonCommands ) {
|
||||
if ( c.getCommandName().equalsIgnoreCase(args[0]) ) {
|
||||
|
||||
// パーミッションの確認
|
||||
String node = c.getPermissionNode();
|
||||
if ( !sender.hasPermission(node) ) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgPermission", node);
|
||||
return true;
|
||||
}
|
||||
|
||||
// 実行
|
||||
return c.runCommand(sender, label, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// チャンネルチャット機能が無効になっている場合は、メッセージを表示して終了
|
||||
if ( !LunaChat.getInstance().getLunaChatConfig().isEnableChannelChat()
|
||||
&& !sender.isOp() ) {
|
||||
|
||||
@@ -75,7 +75,7 @@ public abstract class SubCommandAbst {
|
||||
msg = msg.replace("%player", "");
|
||||
}
|
||||
msg = Utility.replaceColorCode(msg);
|
||||
channel.sendMessage(null, msg, null, true);
|
||||
channel.sendMessage(null, msg, null, true, "system");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,7 +104,7 @@ public abstract class SubCommandAbst {
|
||||
msg = msg.replace("%player", "");
|
||||
}
|
||||
msg = Utility.replaceColorCode(msg);
|
||||
channel.sendMessage(null, msg, null, true);
|
||||
channel.sendMessage(null, msg, null, true, "system");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,13 +19,18 @@ public class LunaChatChannelMessageEvent extends LunaChatBaseEvent {
|
||||
private ChannelPlayer player;
|
||||
private String message;
|
||||
private ArrayList<ChannelPlayer> recipients;
|
||||
private String displayName;
|
||||
private String originalMessage;
|
||||
|
||||
public LunaChatChannelMessageEvent(String channelName,
|
||||
ChannelPlayer player, String message, ArrayList<ChannelPlayer> recipients) {
|
||||
ChannelPlayer player, String message, ArrayList<ChannelPlayer> recipients,
|
||||
String displayName, String originalMessage) {
|
||||
super(channelName);
|
||||
this.player = player;
|
||||
this.message = message;
|
||||
this.recipients = recipients;
|
||||
this.displayName = displayName;
|
||||
this.originalMessage = originalMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,6 +57,22 @@ public class LunaChatChannelMessageEvent extends LunaChatBaseEvent {
|
||||
return recipients;
|
||||
}
|
||||
|
||||
/**
|
||||
* 発言者の表示名を取得する
|
||||
* @return 発言者の表示名
|
||||
*/
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
/**
|
||||
* オリジナルメッセージ(チャットフォーマットを適用していない状態のメッセージ)を取得する
|
||||
* @return オリジナルメッセージ
|
||||
*/
|
||||
public String getOriginalMessage() {
|
||||
return originalMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* メッセージを上書き設定する
|
||||
* @param message メッセージ
|
||||
|
||||
@@ -47,16 +47,20 @@ public class IMEConverter {
|
||||
// 変換の実行
|
||||
private static String conv(String org, boolean isGoogleIME) {
|
||||
|
||||
if ( org.length() == 0 ) {
|
||||
return "";
|
||||
}
|
||||
|
||||
HttpURLConnection urlconn = null;
|
||||
BufferedReader reader = null;
|
||||
try {
|
||||
String baseurl;
|
||||
String encode;
|
||||
if ( isGoogleIME ) {
|
||||
baseurl = GOOGLE_IME_URL + URLEncoder.encode(org , "UTF-8");;
|
||||
baseurl = GOOGLE_IME_URL + URLEncoder.encode(org , "UTF-8");
|
||||
encode = "UTF-8";
|
||||
} else {
|
||||
baseurl = SOCIAL_IME_URL + URLEncoder.encode(org , "UTF-8");;
|
||||
baseurl = SOCIAL_IME_URL + URLEncoder.encode(org , "UTF-8");
|
||||
encode = "EUC_JP";
|
||||
}
|
||||
URL url = new URL(baseurl);
|
||||
@@ -147,4 +151,13 @@ public class IMEConverter {
|
||||
}
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
// デバッグ用エントリ
|
||||
public static void main(String[] args) {
|
||||
String testee = "sonnnakotohanak(ry)";
|
||||
System.out.println("original : " + testee);
|
||||
System.out.println("kana : " + KanaConverter.conv(testee));
|
||||
System.out.println("GoogleIME : " + convByGoogleIME(KanaConverter.conv(testee)));
|
||||
System.out.println("SocialIME : " + convBySocialIME(KanaConverter.conv(testee)));
|
||||
}
|
||||
}
|
||||
@@ -150,7 +150,20 @@ public class KanaConverter {
|
||||
} else if ( tmp.equals("]") ) {
|
||||
line.append(last + "」");
|
||||
last = "";
|
||||
} else if ( tmp.equals("<") ) {
|
||||
line.append(last + "<");
|
||||
last = "";
|
||||
} else if ( tmp.equals(">") ) {
|
||||
line.append(last + ">");
|
||||
last = "";
|
||||
} else if ( tmp.equals("&") ) {
|
||||
line.append(last + "&");
|
||||
last = "";
|
||||
} else if ( tmp.equals("\"") ) {
|
||||
line.append(last + "”");
|
||||
last = "";
|
||||
} else if ( tmp.equals("(") || tmp.equals(")") ) {
|
||||
line.append(last);
|
||||
last = "";
|
||||
} else {
|
||||
line.append(last + tmp);
|
||||
|
||||
@@ -16,6 +16,10 @@ noJoinAsGlobal: true
|
||||
# チャンネルチャットの発言内容を、ログに残すかどうか
|
||||
loggingChat: true
|
||||
|
||||
# チャンネルチャットの発言内容を、HawkEyeに記録するかどうか
|
||||
# この設定を利用する場合は、HawkEyeのconfig.ymlで、log: セクションの other の設定を true にしてください。
|
||||
loggingChatToHawkEye: true
|
||||
|
||||
# チャンネルチャットの発言内容を、サーバーコンソールに表示するかどうか
|
||||
displayChatOnConsole: true
|
||||
|
||||
@@ -55,6 +59,8 @@ formatConstraint: ['%username', '%msg']
|
||||
# %world : 発言したワールド名
|
||||
# %prefix : プレフィックス(VaultとPermissionsExが導入されている場合に置き換えられます)
|
||||
# %suffix : サフィックス(VaultとPermissionsExが導入されている場合に置き換えられます)
|
||||
# %date : 日付
|
||||
# %time : 時刻
|
||||
# %msg : 発言内容(Japanize変換された場合は、Japanize結果を含みます。)
|
||||
defaultFormat: '&f[%color%ch&f]%prefix%username%suffix&a:&f %msg'
|
||||
|
||||
@@ -82,6 +88,8 @@ maxChannelNameLength: 20
|
||||
# %world : 発言したワールド名
|
||||
# %prefix : プレフィックス(VaultとPermissionsExが導入されている場合に置き換えられます)
|
||||
# %suffix : サフィックス(VaultとPermissionsExが導入されている場合に置き換えられます)
|
||||
# %date : 日付
|
||||
# %time : 時刻
|
||||
# %msg : 発言内容(Japanize変換された場合は、Japanize結果を含みます。)
|
||||
defaultFormatForPrivateMessage: '&7[%player -> %to]&f %msg'
|
||||
|
||||
@@ -136,6 +144,8 @@ enableNormalChatMessageFormat: true
|
||||
# %world : 発言したワールド名
|
||||
# %prefix : プレフィックス(VaultとPermissionsExが導入されている場合に置き換えられます)
|
||||
# %suffix : サフィックス(VaultとPermissionsExが導入されている場合に置き換えられます)
|
||||
# %date : 日付
|
||||
# %time : 時刻
|
||||
# %msg : 発言内容(Japanize変換された場合は、Japanize結果を含みます。)
|
||||
normalChatMessageFormat: '&f%prefix%username%suffix&a:&f %msg'
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ usageHidePlayer: '&6/%s hide (player) &7- 指定したプレイヤーの発言
|
||||
usageUnhide: '&6/%s unhide [channel] &7- 指定したチャンネルの発言内容を非表示から表示に戻します。'
|
||||
usageUnhidePlayer: '&6/%s unhide (player) &7- 指定したプレイヤーの発言内容を非表示から表示に戻します。'
|
||||
usageInfo: '&6/%s info [channel] &7- チャンネルの情報を表示します。'
|
||||
usageLog: '&6/%s log [channel] [p=player] [f=filter] [f=date] [r] &7- チャンネルの発言ログを表示します。'
|
||||
usageLog: '&6/%s log [channel] [p=player] [f=filter] [d=date] [r] &7- チャンネルの発言ログを表示します。'
|
||||
|
||||
usageCreate: '&6/%s create (channel) [description] &7- チャンネルを作成します。'
|
||||
usageRemove: '&6/%s remove [channel] &7- チャンネルを削除します。'
|
||||
|
||||
@@ -3,7 +3,7 @@ main: com.github.ucchyocean.lc.LunaChat
|
||||
version: ${project.version}
|
||||
author: ucchy
|
||||
description: ${project.description}
|
||||
softdepend: [Vault, dynmap]
|
||||
softdepend: [Vault, dynmap, HawkEye, Multiverse-Core]
|
||||
|
||||
commands:
|
||||
lunachat:
|
||||
@@ -13,7 +13,7 @@ commands:
|
||||
/<command> join (channel) - チャンネルに参加します。
|
||||
/<command> leave - 参加しているチャンネルから退出します。
|
||||
/<command> list - チャンネルのリストを表示します。
|
||||
/<command> invite (name) - 指定した人をチャンネルチャットに招待します。
|
||||
/<command> invite (name) [force] - 指定した人をチャンネルチャットに招待します。
|
||||
/<command> accept - 招待を受けてチャンネルチャットに入室します。
|
||||
/<command> deny - 招待を拒否します。
|
||||
/<command> kick (name) - 指定した人をチャンネルチャットからキックします。
|
||||
@@ -227,6 +227,9 @@ permissions:
|
||||
lunachat-admin.japanize-other:
|
||||
description: 他者のjapanizeオンオフ設定コマンドの使用権限
|
||||
default: op
|
||||
lunachat-admin.force-invite:
|
||||
description: 強制入室コマンドの使用権限
|
||||
default: op
|
||||
lunachat-admin.*:
|
||||
children:
|
||||
lunachat-admin.mod-all-channels: true
|
||||
@@ -236,4 +239,5 @@ permissions:
|
||||
lunachat-admin.check: true
|
||||
lunachat-admin.reload: true
|
||||
lunachat-admin.japanize-other: true
|
||||
lunachat-admin.force-invite: true
|
||||
description: 管理者向けの全コマンドの使用権限
|
||||
新しいイシューから参照
ユーザーをブロックする