コミットを比較
| 作成者 | SHA1 | 日付 | |
|---|---|---|---|
|
|
e8d2583ac0 |
検索条件に一致するファイルはありません
バイナリ
バイナリファイルは表示されません。
@@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.github.ucchyocean</groupId>
|
||||
<artifactId>LunaChat</artifactId>
|
||||
<version>2.8.1</version>
|
||||
<version>2.8.2</version>
|
||||
<description>チャンネルチャットプラグイン</description>
|
||||
|
||||
<licenses>
|
||||
@@ -132,7 +132,7 @@
|
||||
<dependency>
|
||||
<groupId>uk.co.oliwali</groupId>
|
||||
<artifactId>HawkEye</artifactId>
|
||||
<version>1.5.5</version>
|
||||
<version>1.7.1-DEV</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/lib/HawkEye.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
@@ -83,7 +83,7 @@ public class LunaChat extends JavaPlugin {
|
||||
|
||||
// HawkEye のロード
|
||||
if ( getServer().getPluginManager().isPluginEnabled("HawkEye") ) {
|
||||
hawkeye = new HawkEyeBridge(this);
|
||||
hawkeye = new HawkEyeBridge();
|
||||
}
|
||||
|
||||
// MultiverseCore のロード
|
||||
|
||||
@@ -337,6 +337,6 @@ public class Utility {
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public static Player getPlayerExact(String name) {
|
||||
return Bukkit.getPlayer(name);
|
||||
return Bukkit.getPlayer(stripColor(name));
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,9 @@ 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.DataType;
|
||||
import uk.co.oliwali.HawkEye.entry.DataEntry;
|
||||
import uk.co.oliwali.HawkEye.util.HawkEyeAPI;
|
||||
|
||||
/**
|
||||
@@ -17,31 +18,25 @@ import uk.co.oliwali.HawkEye.util.HawkEyeAPI;
|
||||
*/
|
||||
public class HawkEyeBridge {
|
||||
|
||||
private JavaPlugin lunaChatInstance;
|
||||
|
||||
public HawkEyeBridge(JavaPlugin lunaChatInstance) {
|
||||
this.lunaChatInstance = lunaChatInstance;
|
||||
}
|
||||
|
||||
/**
|
||||
* HawkEyeにログを書き出す
|
||||
* HawkEyeにCHATログを書き出す
|
||||
* @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);
|
||||
HawkEyeAPI.addEntry(new DataEntry(player, DataType.CHAT, location, data));
|
||||
}
|
||||
|
||||
/**
|
||||
* HawkEyeにログを書き出す
|
||||
* HawkEyeにCHATログを書き出す
|
||||
* @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);
|
||||
HawkEyeAPI.addEntry(new DataEntry(player, DataType.CHAT, location, data));
|
||||
}
|
||||
}
|
||||
@@ -457,7 +457,7 @@ public class ChannelImpl extends Channel {
|
||||
}
|
||||
|
||||
// ロギング
|
||||
log(originalMessage, name);
|
||||
log(originalMessage, name, player);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -745,22 +745,19 @@ public class ChannelImpl extends Channel {
|
||||
|
||||
/**
|
||||
* ログを記録する
|
||||
* @param player 発言者
|
||||
* @param name 発言者
|
||||
* @param message 記録するメッセージ
|
||||
* @param player プレイヤー
|
||||
*/
|
||||
private void log(String message, String player) {
|
||||
private void log(String message, String name, ChannelPlayer player) {
|
||||
LunaChatConfig config = LunaChat.getInstance().getLunaChatConfig();
|
||||
if ( config.isLoggingChat() && logger != null ) {
|
||||
logger.log(message, player);
|
||||
logger.log(message, name);
|
||||
}
|
||||
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);
|
||||
if ( config.isLoggingChatToHawkEye() && LunaChat.getInstance().getHawkEye() != null
|
||||
&& player != null && player.getLocation() != null ) {
|
||||
LunaChat.getInstance().getHawkEye().writeLog("channel(" + getName() + ")", name,
|
||||
player.getLocation(), Utility.stripColor(message));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc.channel;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.BlockCommandSender;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
@@ -66,6 +67,12 @@ public abstract class ChannelPlayer implements Comparable<ChannelPlayer> {
|
||||
*/
|
||||
public abstract String getWorldName();
|
||||
|
||||
/**
|
||||
* 発言者が今いる位置を取得する
|
||||
* @return 発言者の位置
|
||||
*/
|
||||
public abstract Location getLocation();
|
||||
|
||||
/**
|
||||
* 指定されたパーミッションノードの権限を持っているかどうかを取得する
|
||||
* @param node パーミッションノード
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc.channel;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.BlockCommandSender;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -105,6 +106,19 @@ public class ChannelPlayerBlock extends ChannelPlayer {
|
||||
return "-";
|
||||
}
|
||||
|
||||
/**
|
||||
* 発言者が今いる位置を取得する
|
||||
* @return 発言者の位置
|
||||
* @see com.github.ucchyocean.lc.channel.ChannelPlayer#getLocation()
|
||||
*/
|
||||
@Override
|
||||
public Location getLocation() {
|
||||
if ( sender != null ) {
|
||||
return sender.getBlock().getLocation();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定されたパーミッションノードの権限を持っているかどうかを取得する
|
||||
* @param node パーミッションノード
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc.channel;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -105,6 +106,16 @@ public class ChannelPlayerConsole extends ChannelPlayer {
|
||||
return "-";
|
||||
}
|
||||
|
||||
/**
|
||||
* 発言者が今いる位置を取得する
|
||||
* @return 常にnullが返される
|
||||
* @see com.github.ucchyocean.lc.channel.ChannelPlayer#getLocation()
|
||||
*/
|
||||
@Override
|
||||
public Location getLocation() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定されたパーミッションノードの権限を持っているかどうかを取得する
|
||||
* @param node パーミッションノード
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
package com.github.ucchyocean.lc.channel;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@@ -136,6 +137,20 @@ public class ChannelPlayerName extends ChannelPlayer {
|
||||
return "-";
|
||||
}
|
||||
|
||||
/**
|
||||
* 発言者が今いる位置を取得する
|
||||
* @return 発言者の位置
|
||||
* @see com.github.ucchyocean.lc.channel.ChannelPlayer#getLocation()
|
||||
*/
|
||||
@Override
|
||||
public Location getLocation() {
|
||||
Player player = getPlayer();
|
||||
if ( player != null ) {
|
||||
return player.getLocation();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定されたパーミッションノードの権限を持っているかどうかを取得する
|
||||
* @param node パーミッションノード
|
||||
|
||||
@@ -8,6 +8,7 @@ package com.github.ucchyocean.lc.channel;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -186,6 +187,20 @@ public class ChannelPlayerUUID extends ChannelPlayer {
|
||||
return "-";
|
||||
}
|
||||
|
||||
/**
|
||||
* 発言者が今いる位置を取得する
|
||||
* @return 発言者の位置
|
||||
* @see com.github.ucchyocean.lc.channel.ChannelPlayer#getLocation()
|
||||
*/
|
||||
@Override
|
||||
public Location getLocation() {
|
||||
Player player = getPlayer();
|
||||
if ( player != null ) {
|
||||
return player.getLocation();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定されたパーミッションノードの権限を持っているかどうかを取得する
|
||||
* @param node パーミッションノード
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする