コミットを比較
| 作成者 | SHA1 | 日付 | |
|---|---|---|---|
|
|
4fddd66bef | ||
|
|
c2512d0de2 |
検索条件に一致するファイルはありません
@@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.github.ucchyocean</groupId>
|
||||
<artifactId>LunaChat</artifactId>
|
||||
<version>2.8.4</version>
|
||||
<version>2.8.6</version>
|
||||
<description>チャンネルチャットプラグイン</description>
|
||||
|
||||
<licenses>
|
||||
@@ -116,6 +116,11 @@
|
||||
<name>MD5 repository</name>
|
||||
<url>http://repo.md-5.net/content/repositories/releases</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>dhmc-rep</id>
|
||||
<name>Prism repository</name>
|
||||
<url>http://dhmc.us:8081/nexus/content/repositories/releases/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
@@ -151,5 +156,10 @@
|
||||
<artifactId>mcMMO</artifactId>
|
||||
<version>1.5.00</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.botsko</groupId>
|
||||
<artifactId>prism</artifactId>
|
||||
<version>2.0.6</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -18,6 +18,7 @@ import com.github.ucchyocean.lc.bridge.DynmapBridge;
|
||||
import com.github.ucchyocean.lc.bridge.HawkEyeBridge;
|
||||
import com.github.ucchyocean.lc.bridge.McMMOBridge;
|
||||
import com.github.ucchyocean.lc.bridge.MultiverseCoreBridge;
|
||||
import com.github.ucchyocean.lc.bridge.PrismBridge;
|
||||
import com.github.ucchyocean.lc.bridge.VaultChatBridge;
|
||||
import com.github.ucchyocean.lc.channel.ChannelManager;
|
||||
import com.github.ucchyocean.lc.command.LunaChatCommand;
|
||||
@@ -40,6 +41,7 @@ public class LunaChat extends JavaPlugin {
|
||||
private DynmapBridge dynmap;
|
||||
private HawkEyeBridge hawkeye;
|
||||
private MultiverseCoreBridge multiverse;
|
||||
private PrismBridge prism;
|
||||
|
||||
private ExpireCheckTask expireCheckerTask;
|
||||
private LunaChatLogger normalChatLogger;
|
||||
@@ -98,6 +100,11 @@ public class LunaChat extends JavaPlugin {
|
||||
getServer().getPluginManager().registerEvents(new McMMOBridge(), this);
|
||||
}
|
||||
|
||||
// Prismのロード
|
||||
if ( getServer().getPluginManager().isPluginEnabled("Prism") ) {
|
||||
prism = PrismBridge.load();
|
||||
}
|
||||
|
||||
// リスナーの登録
|
||||
getServer().getPluginManager().registerEvents(new PlayerListener(), this);
|
||||
|
||||
@@ -231,6 +238,14 @@ public class LunaChat extends JavaPlugin {
|
||||
return multiverse;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prism連携クラスを返す
|
||||
* @return MultiverseCoreBridge
|
||||
*/
|
||||
public PrismBridge getPrism() {
|
||||
return prism;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通常チャット用のロガーを返す
|
||||
* @return normalChatLogger
|
||||
|
||||
@@ -36,6 +36,9 @@ public class LunaChatConfig {
|
||||
/** チャンネルチャットの発言内容を、HawkEyeに記録するかどうか */
|
||||
private boolean loggingChatToHawkEye;
|
||||
|
||||
/** チャンネルチャットの発言内容を、Prismに記録するかどうか */
|
||||
private boolean loggingChatToPrism;
|
||||
|
||||
/** チャンネルチャットの発言内容を、コンソールに表示するかどうか */
|
||||
private boolean displayChatOnConsole;
|
||||
|
||||
@@ -171,6 +174,7 @@ public class LunaChatConfig {
|
||||
noJoinAsGlobal = config.getBoolean("noJoinAsGlobal", true);
|
||||
loggingChat = config.getBoolean("loggingChat", true);
|
||||
loggingChatToHawkEye = config.getBoolean("loggingChatToHawkEye", true);
|
||||
loggingChatToPrism = config.getBoolean("loggingChatToPrism", true);
|
||||
displayChatOnConsole = config.getBoolean("displayChatOnConsole", true);
|
||||
globalMarker = config.getString("globalMarker", "!");
|
||||
zeroMemberRemove = config.getBoolean("zeroMemberRemove", false);
|
||||
@@ -296,6 +300,14 @@ public class LunaChatConfig {
|
||||
return loggingChatToHawkEye;
|
||||
}
|
||||
|
||||
/**
|
||||
* チャンネルチャットの発言内容を、Prismに記録するかどうか
|
||||
* @return loggingChatToPrism
|
||||
*/
|
||||
public boolean isLoggingChatToPrism() {
|
||||
return loggingChatToPrism;
|
||||
}
|
||||
|
||||
/**
|
||||
* チャンネルチャットの発言内容を、コンソールに表示するかどうか
|
||||
* @return displayChatOnConsoleを返す
|
||||
|
||||
@@ -7,6 +7,7 @@ package com.github.ucchyocean.lc.bridge;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import com.github.ucchyocean.lc.LunaChat;
|
||||
import com.github.ucchyocean.lc.Utility;
|
||||
@@ -48,11 +49,15 @@ public class HawkEyeBridge {
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public void writeLog(String player, Location location, String data) {
|
||||
DataEntry entry = new DataEntry(player, DataType.CHAT, location, data);
|
||||
if ( isV162orLater ) {
|
||||
HawkEyeAPI.addEntry(entry);
|
||||
} else {
|
||||
HawkEyeAPI.addEntry(LunaChat.getInstance(), entry);
|
||||
}
|
||||
final DataEntry entry = new DataEntry(player, DataType.CHAT, location, data);
|
||||
new BukkitRunnable() {
|
||||
public void run() {
|
||||
if ( isV162orLater ) {
|
||||
HawkEyeAPI.addEntry(entry);
|
||||
} else {
|
||||
HawkEyeAPI.addEntry(LunaChat.getInstance(), entry);
|
||||
}
|
||||
}
|
||||
}.runTaskAsynchronously(LunaChat.getInstance());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* @author ucchy
|
||||
* @license LGPLv3
|
||||
* @copyright Copyright ucchy 2016
|
||||
*/
|
||||
package com.github.ucchyocean.lc.bridge;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import com.github.ucchyocean.lc.LunaChat;
|
||||
|
||||
import me.botsko.prism.Prism;
|
||||
import me.botsko.prism.actionlibs.ActionFactory;
|
||||
import me.botsko.prism.actionlibs.RecordingQueue;
|
||||
|
||||
/**
|
||||
* Prism連携クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class PrismBridge {
|
||||
|
||||
/** コンストラクタは使用不可 */
|
||||
private PrismBridge() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Prism をロードする
|
||||
* @return ロードしたブリッジのインスタンス
|
||||
*/
|
||||
public static PrismBridge load() {
|
||||
return new PrismBridge();
|
||||
}
|
||||
|
||||
/**
|
||||
* PrismにCHATログを書き出す
|
||||
* @param player プレイヤー
|
||||
* @param data データ
|
||||
*/
|
||||
public void writeLog(final Player player, final String data) {
|
||||
if ( !Prism.getIgnore().event( "player-chat", player ) ) {
|
||||
return;
|
||||
}
|
||||
new BukkitRunnable() {
|
||||
public void run() {
|
||||
RecordingQueue.addToQueue( ActionFactory.createPlayer(
|
||||
"player-chat", player, data ) );
|
||||
}
|
||||
}.runTaskAsynchronously(LunaChat.getInstance());
|
||||
}
|
||||
}
|
||||
@@ -750,15 +750,26 @@ public class ChannelImpl extends Channel {
|
||||
* @param player プレイヤー
|
||||
*/
|
||||
private void log(String message, String name, ChannelPlayer player) {
|
||||
|
||||
// LunaChatのチャットログへ記録
|
||||
LunaChatConfig config = LunaChat.getInstance().getLunaChatConfig();
|
||||
if ( config.isLoggingChat() && logger != null ) {
|
||||
logger.log(message, name);
|
||||
}
|
||||
|
||||
// Hawkeye Reloaded のチャットログへ記録
|
||||
if ( config.isLoggingChatToHawkEye() && LunaChat.getInstance().getHawkEye() != null
|
||||
&& player != null && player.getLocation() != null ) {
|
||||
LunaChat.getInstance().getHawkEye().writeLog(name, player.getLocation(),
|
||||
"channel(" + getName() + ")-" + Utility.stripColor(message));
|
||||
}
|
||||
|
||||
// Prism のチャットログへ記録
|
||||
if ( config.isLoggingChatToPrism() && LunaChat.getInstance().getPrism() != null
|
||||
&& player.getPlayer() != null ) {
|
||||
LunaChat.getInstance().getPrism().writeLog(player.getPlayer(),
|
||||
"channel(" + getName() + ")-" + Utility.stripColor(message));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,6 +29,11 @@ loggingChat: true
|
||||
# この設定を利用する場合は、HawkEyeのconfig.ymlで、log: セクションの chat の設定を true にしてください。
|
||||
loggingChatToHawkEye: true
|
||||
|
||||
# チャンネルチャットの発言内容を、Prismに記録するかどうか
|
||||
# この設定を利用する場合は、Prismのconfig.ymlで、
|
||||
# tracking: セクションの player-chat の設定を true にしてください。
|
||||
loggingChatToPrism: true
|
||||
|
||||
# チャンネルチャットの発言内容を、サーバーコンソールに表示するかどうか
|
||||
displayChatOnConsole: true
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ main: com.github.ucchyocean.lc.LunaChat
|
||||
version: ${project.version}
|
||||
author: ucchy
|
||||
description: ${project.description}
|
||||
softdepend: [Vault, dynmap, HawkEye, Multiverse-Core, mcMMO]
|
||||
softdepend: [Vault, dynmap, HawkEye, Multiverse-Core, mcMMO, Prism]
|
||||
|
||||
commands:
|
||||
lunachat:
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする