diff --git a/src/main/java/com/github/ucchyocean/lc3/bungee/BungeeEventListener.java b/src/main/java/com/github/ucchyocean/lc3/bungee/BungeeEventListener.java index bc4168a..e918983 100644 --- a/src/main/java/com/github/ucchyocean/lc3/bungee/BungeeEventListener.java +++ b/src/main/java/com/github/ucchyocean/lc3/bungee/BungeeEventListener.java @@ -285,6 +285,12 @@ public class BungeeEventListener implements Listener { // 2byteコードを含む、または、半角カタカナのみなら、Japanize変換は行わない String kanaTemp = Utility.stripColorCode(message); + + // TODO でばっぐコード +// System.out.println("==LCDebug: file.encoding=" + System.getProperty("file.encoding")); +// System.out.println("==LCDebug: kanaBytes=" + kanaTemp.getBytes(StandardCharsets.UTF_8).length + +// ", kanaLen=" + kanaTemp.length()); + if ( !skipJapanize && ( kanaTemp.getBytes(StandardCharsets.UTF_8).length > kanaTemp.length() || kanaTemp.matches("[ \\uFF61-\\uFF9F]+") ) ) { diff --git a/src/main/java/com/github/ucchyocean/lc3/channel/BungeeChannel.java b/src/main/java/com/github/ucchyocean/lc3/channel/BungeeChannel.java index 3c8a760..e660d73 100644 --- a/src/main/java/com/github/ucchyocean/lc3/channel/BungeeChannel.java +++ b/src/main/java/com/github/ucchyocean/lc3/channel/BungeeChannel.java @@ -5,6 +5,7 @@ */ package com.github.ucchyocean.lc3.channel; +import java.nio.charset.StandardCharsets; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; @@ -121,7 +122,7 @@ public class BungeeChannel extends Channel { String kanaTemp = Utility.stripColorCode(maskedMessage); if ( !skipJapanize && - ( kanaTemp.getBytes().length > kanaTemp.length() || + ( kanaTemp.getBytes(StandardCharsets.UTF_8).length > kanaTemp.length() || kanaTemp.matches("[ \\uFF61-\\uFF9F]+") ) ) { skipJapanize = true; } diff --git a/src/main/resources/messages_en.yml b/src/main/resources/messages_en.yml index ce1944c..388b81c 100644 --- a/src/main/resources/messages_en.yml +++ b/src/main/resources/messages_en.yml @@ -3,14 +3,14 @@ # @license LGPLv3 # @copyright Copyright ucchy 2020 -joinMessage: '&f[%color%%channel%&f]&7%player% has joined the channel' -quitMessage: '&f[%color%%channel%&f]&7%player% has left the channel' +joinMessage: '&f[%color%%channel%&f]&7%player% has joined the channel.' +quitMessage: '&f[%color%%channel%&f]&7%player% has left the channel.' breakupMessage: '&f[%color%%channel%&f]&7The channel has been deleted.' banMessage: '&f[%color%%channel%&f]&7%player% was banned from the channel.' kickMessage: '&f[%color%%channel%&f]&7%player% was kicked from the channel.' muteMessage: '&f[%color%%channel%&f]&7%player% has been deprived the voice of this channel.' banNGWordMessage: '&f[%color%%channel%&f]&7%player% was banned from the channel, caused by saying NG word.' -kickNGWordMessage: '&f[%color%%channel%&f]&7%player% was kicked from the channel, caused by saying NG word' +kickNGWordMessage: '&f[%color%%channel%&f]&7%player% was kicked from the channel, caused by saying NG word.' muteNGWordMessage: '&f[%color%%channel%&f]&7%player% has been deprived the voice of this channel, caused by saying NG word.' banWithExpireMessage: '&f[%color%%channel%&f]&7%player% was banned from the channel, with an expiration of %minutes% minutes.' muteWithExpireMessage: '&f[%color%%channel%&f]&7%player% was kicked from the channel, with an expiration of %minutes% minutes.' @@ -139,7 +139,7 @@ errmsgCannotRemoveGlobal: 'Channel %channel% is a global channel and cannot be d errmsgCannotModeratorGlobal: 'Cannot set moderator because channel %channel% is a global channel. ' errmsgCannotLeaveForceJoin: 'Channel %channel% is a forced channel and cannot leave. ' errmsgNotfoundPM: 'There are no private messages you received. ' -errmsgCannotSendPMSelf: 'Can't send a private message to yourself. ' +errmsgCannotSendPMSelf: 'Can''t send a private message to yourself. ' errmsgCannotUseForChannel: '%channel% contains characters that cannot be used in the channel name. ' errmsgCannotUseForChannelTooShort: '%channel% is too short to be used in the channel name. It must be at least %min% characters. ' errmsgCannotUseForChannelTooLong: '%channel% is too long to be used in the channel name. Must be less than or equal to %max% characters. ' @@ -172,9 +172,9 @@ usageKick: '&6/%label% kick (name) &7- Kick the specified player from channel ch usageBan: '&6/%label% ban (name) &7- BAN the specified player from channel chat. ' usageBan2: '&6/%label% ban (name) [minutes] &7- BAN the specified player for the specified number of minutes. ' usagePardon: '&6/%label% pardon (name) &7- Removes the ban for the specified player. ' -usageMute: '&6/%label% mute (name) &7- Removes the right to speak the specified player's channel. ' +usageMute: '&6/%label% mute (name) &7- Removes the right to speak the specified player''s channel. ' usageMute2: '&6/%label% mute (name) [minutes] &7- Strips the specified player for the specified number of minutes. ' -usageUnmute: '&6/%label% unmute (name) &7- Cancels the deprivation of the specified player's channel. ' +usageUnmute: '&6/%label% unmute (name) &7- Cancels the deprivation of the specified player''s channel. ' usageHide: '&6/%label% hide [channel] &7- Hides the message contents of the specified channel. ' usageHidePlayer: '&6/%label% hide (player) &7- Hides the speech of the specified player. ' usageUnhide: '&6/%label% unhide [channel] &7- Restores the message contents of the specified channel from being hidden to being displayed. ' @@ -195,7 +195,7 @@ usageCheck1: '&6/%label% check &7- Lists channels without moderators. ' usageCheck2: '&6/%label% check remove &7- /ch Remove all channels listed by check. ' usageReload: '&6/%label% reload &7- Reload config.yml. ' usageHelp: '&6/%label% help [user|mod|admin] [page] &7- Display help. ' -usageSet1: '&6/%label% set default (player) [channel] &7- Sets the specified player's channel to the specified channel. ' +usageSet1: '&6/%label% set default (player) [channel] &7- Sets the specified player''s channel to the specified channel. ' usageMessage: '&6/%label% (name) [message] &7- Starts a private chat with the specified player. ' usageReply: '&6/%label% [message] &7- Reply to the received personal chat. '