LunaChat v3-k2 : Bug fixed.
このコミットが含まれているのは:
1 親
adfc7db64b
コミット
fc6589d188
17ファイル変更
+449
-418
検索条件に一致するファイルはありません
@@ -7,10 +7,11 @@ package com.github.ucchyocean.lc3;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
@@ -65,23 +66,14 @@ public class LunaChatLogger {
|
||||
String msg = Utility.stripColorCode(message);
|
||||
if ( msg == null ) msg = "";
|
||||
msg = msg.replace(",", ",");
|
||||
FileWriter writer = null;
|
||||
try {
|
||||
writer = new FileWriter(file, true);
|
||||
String str = lformat.format(new Date()) +
|
||||
"," + msg + "," + player;
|
||||
|
||||
try ( OutputStreamWriter writer = new OutputStreamWriter(
|
||||
new FileOutputStream(file, true), "UTF-8"); ) {
|
||||
|
||||
String str = lformat.format(new Date()) + "," + msg + "," + player;
|
||||
writer.write(str + "\r\n");
|
||||
writer.flush();
|
||||
} catch (Exception e) {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if ( writer != null ) {
|
||||
try {
|
||||
writer.close();
|
||||
} catch (Exception e) {
|
||||
// do nothing.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
@@ -147,11 +139,11 @@ public class LunaChatLogger {
|
||||
private ArrayList<String> readAllLines(File file) {
|
||||
|
||||
ArrayList<String> data = new ArrayList<String>();
|
||||
if ( !file.exists() ) return data;
|
||||
|
||||
BufferedReader reader = null;
|
||||
try ( BufferedReader reader = new BufferedReader(
|
||||
new InputStreamReader(new FileInputStream(file), "UTF-8")) ) {
|
||||
|
||||
try {
|
||||
reader = new BufferedReader(new FileReader(file));
|
||||
String line;
|
||||
while ( (line = reader.readLine()) != null ) {
|
||||
line = line.trim();
|
||||
@@ -159,18 +151,8 @@ public class LunaChatLogger {
|
||||
data.add(line);
|
||||
}
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if ( reader != null ) {
|
||||
try {
|
||||
reader.close();
|
||||
} catch (IOException e) {
|
||||
// do nothing.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
|
||||
@@ -538,7 +538,7 @@ public class Messages {
|
||||
String msg = resources.getString("cmdmsgJoin");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -548,7 +548,7 @@ public class Messages {
|
||||
String msg = resources.getString("cmdmsgSet");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -558,7 +558,7 @@ public class Messages {
|
||||
String msg = resources.getString("cmdmsgSetTopic");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%topic%", topic.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -567,7 +567,7 @@ public class Messages {
|
||||
public static String cmdmsgSetHide() {
|
||||
String msg = resources.getString("cmdmsgSetHide");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -577,7 +577,7 @@ public class Messages {
|
||||
String msg = resources.getString("cmdmsgLeave");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -588,7 +588,7 @@ public class Messages {
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%player%", player.toString());
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -599,7 +599,7 @@ public class Messages {
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%player%", player.toString());
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -608,7 +608,7 @@ public class Messages {
|
||||
public static String cmdmsgInvited2() {
|
||||
String msg = resources.getString("cmdmsgInvited2");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -617,7 +617,7 @@ public class Messages {
|
||||
public static String cmdmsgDeny() {
|
||||
String msg = resources.getString("cmdmsgDeny");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -626,7 +626,7 @@ public class Messages {
|
||||
public static String cmdmsgDenyed() {
|
||||
String msg = resources.getString("cmdmsgDenyed");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -637,7 +637,7 @@ public class Messages {
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%player%", player.toString());
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -647,7 +647,7 @@ public class Messages {
|
||||
String msg = resources.getString("cmdmsgKicked");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -658,7 +658,7 @@ public class Messages {
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%player%", player.toString());
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -670,7 +670,7 @@ public class Messages {
|
||||
msg = msg.replace("%player%", player.toString());
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
msg = msg.replace("%minutes%", minutes.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -680,7 +680,7 @@ public class Messages {
|
||||
String msg = resources.getString("cmdmsgBanned");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -691,7 +691,7 @@ public class Messages {
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%player%", player.toString());
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -701,7 +701,7 @@ public class Messages {
|
||||
String msg = resources.getString("cmdmsgPardoned");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -712,7 +712,7 @@ public class Messages {
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%player%", player.toString());
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -724,7 +724,7 @@ public class Messages {
|
||||
msg = msg.replace("%player%", player.toString());
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
msg = msg.replace("%minutes%", minutes.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -734,7 +734,7 @@ public class Messages {
|
||||
String msg = resources.getString("cmdmsgMuted");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -745,7 +745,7 @@ public class Messages {
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%player%", player.toString());
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -755,7 +755,7 @@ public class Messages {
|
||||
String msg = resources.getString("cmdmsgUnmuted");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -765,7 +765,7 @@ public class Messages {
|
||||
String msg = resources.getString("cmdmsgHided");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -775,7 +775,7 @@ public class Messages {
|
||||
String msg = resources.getString("cmdmsgHidedPlayer");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%player%", player.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -785,7 +785,7 @@ public class Messages {
|
||||
String msg = resources.getString("cmdmsgUnhided");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -795,7 +795,7 @@ public class Messages {
|
||||
String msg = resources.getString("cmdmsgUnhidedPlayer");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -804,7 +804,7 @@ public class Messages {
|
||||
public static String cmdmsgReload() {
|
||||
String msg = resources.getString("cmdmsgReload");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -814,7 +814,7 @@ public class Messages {
|
||||
String msg = resources.getString("cmdmsgCreate");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -824,7 +824,7 @@ public class Messages {
|
||||
String msg = resources.getString("cmdmsgRemove");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -834,7 +834,7 @@ public class Messages {
|
||||
String msg = resources.getString("cmdmsgFormat");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%format%", format.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -845,7 +845,7 @@ public class Messages {
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%player%", player.toString());
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -856,7 +856,7 @@ public class Messages {
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%player%", player.toString());
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -867,7 +867,7 @@ public class Messages {
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%key%", key.toString());
|
||||
msg = msg.replace("%value%", value.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -877,7 +877,7 @@ public class Messages {
|
||||
String msg = resources.getString("cmdmsgDictionaryRemove");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%key%", key.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -888,7 +888,7 @@ public class Messages {
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%key%", key.toString());
|
||||
msg = msg.replace("%value%", value.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -899,7 +899,7 @@ public class Messages {
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%index%", index.toString());
|
||||
msg = msg.replace("%value%", value.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -909,7 +909,7 @@ public class Messages {
|
||||
String msg = resources.getString("cmdmsgTemplateRemove");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%index%", index.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -920,7 +920,7 @@ public class Messages {
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%player%", player.toString());
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -930,7 +930,7 @@ public class Messages {
|
||||
String msg = resources.getString("cmdmsgPlayerJapanize");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%value%", value.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -941,7 +941,7 @@ public class Messages {
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%player%", player.toString());
|
||||
msg = msg.replace("%value%", value.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -952,7 +952,7 @@ public class Messages {
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%inviter%", inviter.toString());
|
||||
msg = msg.replace("%invited%", invited.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -962,7 +962,7 @@ public class Messages {
|
||||
String msg = resources.getString("cmdmsgReplyInviterNone");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%inviter%", inviter.toString());
|
||||
return resources.getString("infoPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("infoPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -971,7 +971,7 @@ public class Messages {
|
||||
public static String errmsgIngame() {
|
||||
String msg = resources.getString("errmsgIngame");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -980,7 +980,7 @@ public class Messages {
|
||||
public static String errmsgCommand() {
|
||||
String msg = resources.getString("errmsgCommand");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -989,7 +989,7 @@ public class Messages {
|
||||
public static String errmsgNotExist() {
|
||||
String msg = resources.getString("errmsgNotExist");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -998,7 +998,7 @@ public class Messages {
|
||||
public static String errmsgNotExistChannelAndPlayer() {
|
||||
String msg = resources.getString("errmsgNotExistChannelAndPlayer");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1007,7 +1007,7 @@ public class Messages {
|
||||
public static String errmsgNotExistOrNotSpecified() {
|
||||
String msg = resources.getString("errmsgNotExistOrNotSpecified");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1016,7 +1016,7 @@ public class Messages {
|
||||
public static String errmsgExist() {
|
||||
String msg = resources.getString("errmsgExist");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1025,7 +1025,7 @@ public class Messages {
|
||||
public static String errmsgNomember() {
|
||||
String msg = resources.getString("errmsgNomember");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1034,7 +1034,7 @@ public class Messages {
|
||||
public static String errmsgNomemberOther() {
|
||||
String msg = resources.getString("errmsgNomemberOther");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1044,7 +1044,7 @@ public class Messages {
|
||||
String msg = resources.getString("errmsgNotfoundPlayer");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%player%", player.toString());
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1053,7 +1053,7 @@ public class Messages {
|
||||
public static String errmsgNotInvited() {
|
||||
String msg = resources.getString("errmsgNotInvited");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1062,7 +1062,7 @@ public class Messages {
|
||||
public static String errmsgNotfoundChannel() {
|
||||
String msg = resources.getString("errmsgNotfoundChannel");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1072,7 +1072,7 @@ public class Messages {
|
||||
String msg = resources.getString("errmsgInvitedAlreadyExist");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%player%", player.toString());
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1081,7 +1081,7 @@ public class Messages {
|
||||
public static String errmsgInvitedAlreadyJoin() {
|
||||
String msg = resources.getString("errmsgInvitedAlreadyJoin");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1090,7 +1090,7 @@ public class Messages {
|
||||
public static String errmsgNoJoin() {
|
||||
String msg = resources.getString("errmsgNoJoin");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1099,7 +1099,7 @@ public class Messages {
|
||||
public static String errmsgBanned() {
|
||||
String msg = resources.getString("errmsgBanned");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1108,7 +1108,7 @@ public class Messages {
|
||||
public static String errmsgMuted() {
|
||||
String msg = resources.getString("errmsgMuted");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1117,7 +1117,7 @@ public class Messages {
|
||||
public static String errmsgAlreadyBanned() {
|
||||
String msg = resources.getString("errmsgAlreadyBanned");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1126,7 +1126,7 @@ public class Messages {
|
||||
public static String errmsgAlreadyMuted() {
|
||||
String msg = resources.getString("errmsgAlreadyMuted");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1135,7 +1135,7 @@ public class Messages {
|
||||
public static String errmsgAlreadyHided() {
|
||||
String msg = resources.getString("errmsgAlreadyHided");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1144,7 +1144,7 @@ public class Messages {
|
||||
public static String errmsgAlreadyHidedPlayer() {
|
||||
String msg = resources.getString("errmsgAlreadyHidedPlayer");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1153,7 +1153,7 @@ public class Messages {
|
||||
public static String errmsgAlreadyUnhided() {
|
||||
String msg = resources.getString("errmsgAlreadyUnhided");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1162,7 +1162,7 @@ public class Messages {
|
||||
public static String errmsgAlreadyUnhidedPlayer() {
|
||||
String msg = resources.getString("errmsgAlreadyUnhidedPlayer");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1171,7 +1171,7 @@ public class Messages {
|
||||
public static String errmsgCannotJoinPersonal() {
|
||||
String msg = resources.getString("errmsgCannotJoinPersonal");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1180,7 +1180,7 @@ public class Messages {
|
||||
public static String errmsgNotModerator() {
|
||||
String msg = resources.getString("errmsgNotModerator");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1189,7 +1189,7 @@ public class Messages {
|
||||
public static String errmsgNotBanned() {
|
||||
String msg = resources.getString("errmsgNotBanned");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1198,7 +1198,7 @@ public class Messages {
|
||||
public static String errmsgNotMuted() {
|
||||
String msg = resources.getString("errmsgNotMuted");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1207,7 +1207,7 @@ public class Messages {
|
||||
public static String errmsgInvalidOptions() {
|
||||
String msg = resources.getString("errmsgInvalidOptions");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1216,7 +1216,7 @@ public class Messages {
|
||||
public static String errmsgPassword1() {
|
||||
String msg = resources.getString("errmsgPassword1");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1225,7 +1225,7 @@ public class Messages {
|
||||
public static String errmsgPassword2() {
|
||||
String msg = resources.getString("errmsgPassword2");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1234,7 +1234,7 @@ public class Messages {
|
||||
public static String errmsgPassword3() {
|
||||
String msg = resources.getString("errmsgPassword3");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1243,7 +1243,7 @@ public class Messages {
|
||||
public static String errmsgPasswordNotmatch() {
|
||||
String msg = resources.getString("errmsgPasswordNotmatch");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1253,7 +1253,7 @@ public class Messages {
|
||||
String msg = resources.getString("errmsgPermission");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%permission%", permission.toString());
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1263,7 +1263,7 @@ public class Messages {
|
||||
String msg = resources.getString("errmsgCannotLeaveGlobal");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1273,7 +1273,7 @@ public class Messages {
|
||||
String msg = resources.getString("errmsgCannotKickGlobal");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1283,7 +1283,7 @@ public class Messages {
|
||||
String msg = resources.getString("errmsgCannotBANGlobal");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1293,7 +1293,7 @@ public class Messages {
|
||||
String msg = resources.getString("errmsgCannotRemoveGlobal");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1303,7 +1303,7 @@ public class Messages {
|
||||
String msg = resources.getString("errmsgCannotModeratorGlobal");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1313,7 +1313,7 @@ public class Messages {
|
||||
String msg = resources.getString("errmsgCannotLeaveForceJoin");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1322,7 +1322,7 @@ public class Messages {
|
||||
public static String errmsgNotfoundPM() {
|
||||
String msg = resources.getString("errmsgNotfoundPM");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1331,7 +1331,7 @@ public class Messages {
|
||||
public static String errmsgCannotSendPMSelf() {
|
||||
String msg = resources.getString("errmsgCannotSendPMSelf");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1341,7 +1341,7 @@ public class Messages {
|
||||
String msg = resources.getString("errmsgCannotUseForChannel");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1352,7 +1352,7 @@ public class Messages {
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
msg = msg.replace("%min%", min.toString());
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1363,7 +1363,7 @@ public class Messages {
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
msg = msg.replace("%max%", max.toString());
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1373,7 +1373,7 @@ public class Messages {
|
||||
String msg = resources.getString("errmsgCannotUseForGlobal");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%word%", word.toString());
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1383,7 +1383,7 @@ public class Messages {
|
||||
String msg = resources.getString("errmsgInvalidColorCode");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%value%", value.toString());
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1392,7 +1392,7 @@ public class Messages {
|
||||
public static String errmsgInvalidTemplateNumber() {
|
||||
String msg = resources.getString("errmsgInvalidTemplateNumber");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1402,7 +1402,7 @@ public class Messages {
|
||||
String msg = resources.getString("errmsgToolongDescription");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%max%", max.toString());
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1412,7 +1412,7 @@ public class Messages {
|
||||
String msg = resources.getString("errmsgToolongAlias");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%max%", max.toString());
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1422,7 +1422,7 @@ public class Messages {
|
||||
String msg = resources.getString("errmsgToolongPassword");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%max%", max.toString());
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1432,7 +1432,7 @@ public class Messages {
|
||||
String msg = resources.getString("errmsgInvalidBooleanOption");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%key%", key.toString());
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1441,7 +1441,7 @@ public class Messages {
|
||||
public static String errmsgInvalidRangeOption() {
|
||||
String msg = resources.getString("errmsgInvalidRangeOption");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1452,7 +1452,7 @@ public class Messages {
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%key%", key.toString());
|
||||
msg = msg.replace("%value%", value.toString());
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1461,7 +1461,7 @@ public class Messages {
|
||||
public static String errmsgCannotOffGlobalBroadcast() {
|
||||
String msg = resources.getString("errmsgCannotOffGlobalBroadcast");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1471,7 +1471,7 @@ public class Messages {
|
||||
String msg = resources.getString("errmsgFormatConstraint");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%key%", key.toString());
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1480,7 +1480,7 @@ public class Messages {
|
||||
public static String errmsgInvalidBanExpireParameter() {
|
||||
String msg = resources.getString("errmsgInvalidBanExpireParameter");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1489,7 +1489,7 @@ public class Messages {
|
||||
public static String errmsgInvalidMuteExpireParameter() {
|
||||
String msg = resources.getString("errmsgInvalidMuteExpireParameter");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1498,7 +1498,7 @@ public class Messages {
|
||||
public static String errmsgCannotHideSelf() {
|
||||
String msg = resources.getString("errmsgCannotHideSelf");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1509,7 +1509,7 @@ public class Messages {
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%aliase%", aliase.toString());
|
||||
msg = msg.replace("%channel%", channel.toString());
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1519,7 +1519,7 @@ public class Messages {
|
||||
String msg = resources.getString("errmsgNotPermission");
|
||||
if ( msg == null ) return "";
|
||||
msg = msg.replace("%permission%", permission.toString());
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1528,7 +1528,7 @@ public class Messages {
|
||||
public static String errmsgChannelChatDisabled() {
|
||||
String msg = resources.getString("errmsgChannelChatDisabled");
|
||||
if ( msg == null ) return "";
|
||||
return resources.getString("errorPrefix", "") + msg;
|
||||
return Utility.replaceColorCode(resources.getString("errorPrefix", "") + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -89,7 +89,7 @@ public class Utility {
|
||||
*/
|
||||
public static String stripColorCode(String source) {
|
||||
if (source == null) return null;
|
||||
return stripAltColorCode(source).replaceAll("\u00A7([0-9a-fk-or])", "");
|
||||
return stripAltColorCode(source).replaceAll("\u00A7([0-9a-fk-or])", "").replaceAll("&([0-9a-fk-or])", "");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -334,7 +334,7 @@ public class BukkitEventListener implements Listener {
|
||||
message = message.substring(marker.length());
|
||||
}
|
||||
|
||||
// 2byteコードを含むなら、Japanize変換は行わない
|
||||
// 2byteコードを含む、または、半角カタカナのみなら、Japanize変換は行わない
|
||||
String kanaTemp = Utility.stripColorCode(message);
|
||||
if ( !skipJapanize &&
|
||||
( kanaTemp.getBytes().length > kanaTemp.length() ||
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc3.bungee;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@@ -274,14 +274,27 @@ public class BungeeEventListener implements Listener {
|
||||
// NGワードのマスク
|
||||
message = maskNGWord(message, config.getNgwordCompiled());
|
||||
|
||||
// Japanizeの付加
|
||||
// Japanizeをスキップするかどうかフラグ
|
||||
boolean skipJapanize = !LunaChat.getAPI().isPlayerJapanize(sender.getName());
|
||||
|
||||
// 一時的なJapanizeスキップが指定されているか確認する
|
||||
if ( message.startsWith(config.getNoneJapanizeMarker()) ) {
|
||||
|
||||
message = message.substring(config.getNoneJapanizeMarker().length());
|
||||
skipJapanize = true;
|
||||
}
|
||||
|
||||
} else {
|
||||
// 2byteコードを含む、または、半角カタカナのみなら、Japanize変換は行わない
|
||||
String kanaTemp = Utility.stripColorCode(message);
|
||||
if ( !skipJapanize &&
|
||||
( kanaTemp.getBytes(StandardCharsets.UTF_8).length > kanaTemp.length() ||
|
||||
kanaTemp.matches("[ \\uFF61-\\uFF9F]+") ) ) {
|
||||
skipJapanize = true;
|
||||
}
|
||||
|
||||
String japanize = Japanizer.japanize(message, config.getJapanizeType(),
|
||||
// Japanizeの付加
|
||||
if ( !skipJapanize ) {
|
||||
|
||||
String japanize = Japanizer.japanize(Utility.stripColorCode(message), config.getJapanizeType(),
|
||||
LunaChat.getAPI().getAllDictionary());
|
||||
if ( japanize.length() > 0 ) {
|
||||
|
||||
@@ -311,48 +324,59 @@ public class BungeeEventListener implements Listener {
|
||||
result = result.replace("%msg", message);
|
||||
result = Utility.replaceColorCode(result);
|
||||
|
||||
// 発言したプレイヤーがいるサーバー"以外"のサーバーに、
|
||||
// TODO イベントパススルーモードを追加する
|
||||
// イベントをキャンセルする
|
||||
event.setCancelled(true);
|
||||
|
||||
// //発言したプレイヤーがいるサーバー"以外"のサーバーに、
|
||||
// hideされているプレイヤーを除くすべてのプレイヤーに、
|
||||
// 発言内容を送信する。
|
||||
List<ChannelMember> hidelist = api.getHidelist(ChannelMember.getChannelMember(sender));
|
||||
for ( String server : parent.getProxy().getServers().keySet() ) {
|
||||
|
||||
if ( server.equals(senderServer) ) {
|
||||
continue;
|
||||
}
|
||||
// if ( server.equals(senderServer) ) {
|
||||
// continue;
|
||||
// }
|
||||
|
||||
ServerInfo info = parent.getProxy().getServerInfo(server);
|
||||
for ( ProxiedPlayer player : info.getPlayers() ) {
|
||||
sendMessage(player, result);
|
||||
if ( !containsHideList(player, hidelist) ) {
|
||||
sendMessage(player, result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ローカルも置き換える処理なら、置換えを行う
|
||||
if ( config.isBroadcastChatLocalJapanize() ) {
|
||||
|
||||
// NOTE: 改行がサポートされないので、改行を含む場合は、
|
||||
// \nで分割して前半をセットし、後半は150ミリ秒後に送信する。
|
||||
if ( !message.contains("\n") ) {
|
||||
event.setMessage(Utility.stripColorCode(message));
|
||||
} else {
|
||||
int index = message.indexOf("\n");
|
||||
String pre = message.substring(0, index);
|
||||
final String post = Utility.replaceColorCode(
|
||||
message.substring(index + "\n".length()));
|
||||
event.setMessage(Utility.stripColorCode(pre));
|
||||
parent.getProxy().getScheduler().schedule(parent, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for ( ProxiedPlayer p : sender.getServer().getInfo().getPlayers() ) {
|
||||
sendMessage(p, post);
|
||||
}
|
||||
}
|
||||
}, 150, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
}
|
||||
// if ( config.isBroadcastChatLocalJapanize() ) {
|
||||
//
|
||||
// // NOTE: 改行がサポートされないので、改行を含む場合は、
|
||||
// // \nで分割して前半をセットし、後半は150ミリ秒後に送信する。
|
||||
// if ( !message.contains("\n") ) {
|
||||
// event.setMessage(Utility.stripColorCode(message));
|
||||
// } else {
|
||||
// int index = message.indexOf("\n");
|
||||
// String pre = message.substring(0, index);
|
||||
// final String post = Utility.replaceColorCode(
|
||||
// message.substring(index + "\n".length()));
|
||||
// event.setMessage(Utility.stripColorCode(pre));
|
||||
// parent.getProxy().getScheduler().schedule(parent, new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// for ( ProxiedPlayer p : sender.getServer().getInfo().getPlayers() ) {
|
||||
// sendMessage(p, post);
|
||||
// }
|
||||
// }
|
||||
// }, 150, TimeUnit.MILLISECONDS);
|
||||
// }
|
||||
// }
|
||||
|
||||
// コンソールに表示設定なら、コンソールに表示する
|
||||
if ( config.isDisplayChatOnConsole() ) {
|
||||
parent.getLogger().info(result);
|
||||
}
|
||||
|
||||
// ログに記録する
|
||||
LunaChat.getNormalChatLogger().log(Utility.stripColorCode(result), sender.getName());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -534,4 +558,17 @@ public class BungeeEventListener implements Listener {
|
||||
if ( priority == EventPriority.HIGHEST ) return "HIGHEST".equals(c);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定されたプレイヤーが指定されたHideListに含まれるかどうかを判定する
|
||||
* @param p プレイヤー
|
||||
* @param list リスト
|
||||
* @return 含まれるかどうか
|
||||
*/
|
||||
private boolean containsHideList(ProxiedPlayer p, List<ChannelMember> list) {
|
||||
for ( ChannelMember m : list ) {
|
||||
if (m.getName().equals(p.getName())) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -479,7 +479,12 @@ public class BukkitChannel extends Channel {
|
||||
msg = msg.replace("%ch", getName());
|
||||
//msg = msg.replace("%msg", message);
|
||||
msg = msg.replace("%color", getColorCode());
|
||||
msg = msg.replace("%to", getPrivateMessageTo());
|
||||
if ( getPrivateMessageTo() != null ) {
|
||||
msg = msg.replace("%to", getPrivateMessageTo().getDisplayName());
|
||||
} else {
|
||||
msg = msg.replace("%to", "");
|
||||
}
|
||||
msg = msg.replace("%recieverserver", "");
|
||||
|
||||
if ( msg.contains("%date") ) {
|
||||
msg = msg.replace("%date", dateFormat.format(new Date()));
|
||||
|
||||
@@ -17,7 +17,6 @@ import java.util.regex.Pattern;
|
||||
import com.github.ucchyocean.lc3.LunaChat;
|
||||
import com.github.ucchyocean.lc3.LunaChatAPI;
|
||||
import com.github.ucchyocean.lc3.LunaChatConfig;
|
||||
import com.github.ucchyocean.lc3.LunaChatLogger;
|
||||
import com.github.ucchyocean.lc3.Messages;
|
||||
import com.github.ucchyocean.lc3.NGWordAction;
|
||||
import com.github.ucchyocean.lc3.Utility;
|
||||
@@ -40,9 +39,6 @@ public class BungeeChannel extends Channel {
|
||||
private SimpleDateFormat dateFormat;
|
||||
private SimpleDateFormat timeFormat;
|
||||
|
||||
/** ロガー */
|
||||
private LunaChatLogger logger;
|
||||
|
||||
/**
|
||||
* コンストラクタ
|
||||
* @param name チャンネル名
|
||||
@@ -51,7 +47,6 @@ public class BungeeChannel extends Channel {
|
||||
|
||||
super(name);
|
||||
|
||||
logger = new LunaChatLogger(name.replace(">", "-"));
|
||||
dateFormat = new SimpleDateFormat("yyyy/MM/dd");
|
||||
timeFormat = new SimpleDateFormat("HH:mm:ss");
|
||||
}
|
||||
@@ -124,6 +119,7 @@ public class BungeeChannel extends Channel {
|
||||
|
||||
// 2byteコードを含むか、半角カタカナのみなら、Japanize変換は行わない
|
||||
String kanaTemp = Utility.stripColorCode(maskedMessage);
|
||||
|
||||
if ( !skipJapanize &&
|
||||
( kanaTemp.getBytes().length > kanaTemp.length() ||
|
||||
kanaTemp.matches("[ \\uFF61-\\uFF9F]+") ) ) {
|
||||
@@ -417,7 +413,18 @@ public class BungeeChannel extends Channel {
|
||||
msg = msg.replace("%ch", getName());
|
||||
//msg = msg.replace("%msg", message);
|
||||
msg = msg.replace("%color", getColorCode());
|
||||
msg = msg.replace("%to", getPrivateMessageTo());
|
||||
if ( getPrivateMessageTo() != null ) {
|
||||
msg = msg.replace("%to", getPrivateMessageTo().getDisplayName());
|
||||
if ( getPrivateMessageTo() instanceof ChannelMemberProxiedPlayer ) {
|
||||
ChannelMemberProxiedPlayer cm = (ChannelMemberProxiedPlayer)getPrivateMessageTo();
|
||||
msg = msg.replace("%recieverserver", cm.getServer().getInfo().getName());
|
||||
} else {
|
||||
msg = msg.replace("%recieverserver", "");
|
||||
}
|
||||
} else {
|
||||
msg = msg.replace("%to", "");
|
||||
msg = msg.replace("%recieverserver", "");
|
||||
}
|
||||
|
||||
if ( msg.contains("%date") ) {
|
||||
msg = msg.replace("%date", dateFormat.format(new Date()));
|
||||
|
||||
@@ -111,8 +111,8 @@ public abstract class Channel {
|
||||
/** 期限付きMuteの期限(key=プレイヤー名、value=期日(ミリ秒)) */
|
||||
private Map<ChannelMember, Long> muteExpires;
|
||||
|
||||
/** 1:1チャットの相手名 */
|
||||
private String privateMessageTo;
|
||||
/** 1:1チャットの相手 */
|
||||
private ChannelMember privateMessageTo;
|
||||
|
||||
/** カラーコードの使用可否 */
|
||||
private boolean allowcc;
|
||||
@@ -145,7 +145,7 @@ public abstract class Channel {
|
||||
this.chatRange = 0;
|
||||
this.banExpires = new HashMap<ChannelMember, Long>();
|
||||
this.muteExpires = new HashMap<ChannelMember, Long>();
|
||||
this.privateMessageTo = "";
|
||||
this.privateMessageTo = null;
|
||||
this.allowcc = true;
|
||||
|
||||
LunaChatConfig config = LunaChat.getConfig();
|
||||
@@ -156,7 +156,7 @@ public abstract class Channel {
|
||||
}
|
||||
this.japanizeType = config.getJapanizeType();
|
||||
|
||||
logger = new LunaChatLogger(name.replace(">", "-"));
|
||||
logger = new LunaChatLogger(name.replace(">", "-").replace("*", "_"));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -853,9 +853,9 @@ public abstract class Channel {
|
||||
|
||||
/**
|
||||
* 1:1チャットのときに、会話の相手先を取得する
|
||||
* @return 会話の相手のプレイヤー名
|
||||
* @return 会話の相手のプレイヤー
|
||||
*/
|
||||
public String getPrivateMessageTo() {
|
||||
public ChannelMember getPrivateMessageTo() {
|
||||
return privateMessageTo;
|
||||
}
|
||||
|
||||
@@ -863,8 +863,8 @@ public abstract class Channel {
|
||||
* 1:1チャットのときに、会話の相手先を設定する
|
||||
* @param name 会話の相手のプレイヤー名
|
||||
*/
|
||||
public void setPrivateMessageTo(String name) {
|
||||
this.privateMessageTo = name;
|
||||
public void setPrivateMessageTo(ChannelMember to) {
|
||||
this.privateMessageTo = to;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,9 +7,9 @@ package com.github.ucchyocean.lc3.command;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.github.ucchyocean.lc3.LunaChat;
|
||||
import com.github.ucchyocean.lc3.LunaChatLogger;
|
||||
import com.github.ucchyocean.lc3.Messages;
|
||||
import com.github.ucchyocean.lc3.bukkit.LunaChatBukkit;
|
||||
import com.github.ucchyocean.lc3.channel.Channel;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
|
||||
@@ -123,10 +123,10 @@ public class LogCommand extends LunaChatSubCommand {
|
||||
|
||||
// グローバルチャンネル設定が無くて、指定チャンネルがマーカーの場合、
|
||||
// 通常チャットのログを取得する
|
||||
LunaChatLogger logger = LunaChatBukkit.getInstance().getNormalChatLogger();
|
||||
LunaChatLogger logger = LunaChat.getNormalChatLogger();
|
||||
logs = logger.getLog(argsPlayer, argsFilter, argsDate, reverse);
|
||||
|
||||
cname = "グローバルチャット";
|
||||
cname = "GlobalChat";
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc3.command;
|
||||
|
||||
import com.github.ucchyocean.lc3.LunaChat;
|
||||
import com.github.ucchyocean.lc3.LunaChatAPI;
|
||||
import com.github.ucchyocean.lc3.Messages;
|
||||
import com.github.ucchyocean.lc3.bukkit.LunaChatBukkit;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
|
||||
/**
|
||||
@@ -40,7 +40,7 @@ public class LunaChatJapanizeCommand {
|
||||
|
||||
// Japanize設定をon/offにする
|
||||
boolean value = args[0].equalsIgnoreCase("on");
|
||||
LunaChatAPI api = LunaChatBukkit.getInstance().getLunaChatAPI();
|
||||
LunaChatAPI api = LunaChat.getAPI();
|
||||
api.setPlayersJapanize(sender.getName(), value);
|
||||
|
||||
sender.sendMessage(Messages.cmdmsgPlayerJapanize(args[0]));
|
||||
@@ -65,7 +65,7 @@ public class LunaChatJapanizeCommand {
|
||||
|
||||
// Japanize設定をon/offにする
|
||||
boolean value = args[1].equalsIgnoreCase("on");
|
||||
LunaChatAPI api = LunaChatBukkit.getInstance().getLunaChatAPI();
|
||||
LunaChatAPI api = LunaChat.getAPI();
|
||||
api.setPlayersJapanize(target.getName(), value);
|
||||
|
||||
target.sendMessage(Messages.cmdmsgPlayerJapanize(args[1]));
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc3.command;
|
||||
|
||||
import com.github.ucchyocean.lc3.LunaChat;
|
||||
import com.github.ucchyocean.lc3.LunaChatAPI;
|
||||
import com.github.ucchyocean.lc3.Messages;
|
||||
import com.github.ucchyocean.lc3.bukkit.LunaChatBukkit;
|
||||
import com.github.ucchyocean.lc3.channel.Channel;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
|
||||
@@ -78,7 +78,7 @@ public class LunaChatMessageCommand {
|
||||
}
|
||||
|
||||
// チャンネルが存在するかどうかをチェックする
|
||||
LunaChatAPI api = LunaChatBukkit.getInstance().getLunaChatAPI();
|
||||
LunaChatAPI api = LunaChat.getAPI();
|
||||
String cname = inviter.getName() + ">" + invited.getName();
|
||||
Channel channel = api.getChannel(cname);
|
||||
if ( channel == null ) {
|
||||
@@ -87,7 +87,7 @@ public class LunaChatMessageCommand {
|
||||
channel.setVisible(false);
|
||||
channel.addMember(inviter);
|
||||
channel.addMember(invited);
|
||||
channel.setPrivateMessageTo(invited.getName());
|
||||
channel.setPrivateMessageTo(invited);
|
||||
}
|
||||
|
||||
// メッセージがあるなら送信する
|
||||
|
||||
@@ -122,6 +122,9 @@ public abstract class ChannelMember implements Comparable<ChannelMember> {
|
||||
* @return ChannelMember
|
||||
*/
|
||||
public static ChannelMember getChannelMember(Object obj) {
|
||||
|
||||
if ( obj != null && obj instanceof ChannelMember ) return (ChannelMember)obj;
|
||||
|
||||
if ( LunaChat.getMode() == LunaChatMode.BUKKIT ) {
|
||||
return ChannelMemberBukkit.getChannelMemberBukkit(obj);
|
||||
} else if ( LunaChat.getMode() == LunaChatMode.BUNGEE ) {
|
||||
|
||||
@@ -58,9 +58,9 @@ public class MessageParser {
|
||||
" msg = msg.replace(\"%%%s%%\", %s.toString());", keyword, keyword));
|
||||
}
|
||||
if ( key.startsWith("errmsg") ) {
|
||||
System.out.println(" return resources.getString(\"errorPrefix\", \"\") + msg;");
|
||||
System.out.println(" return Utility.replaceColorCode(resources.getString(\"errorPrefix\", \"\") + msg);");
|
||||
} else if ( key.startsWith("cmdmsg") ) {
|
||||
System.out.println(" return resources.getString(\"infoPrefix\", \"\") + msg;");
|
||||
System.out.println(" return Utility.replaceColorCode(resources.getString(\"infoPrefix\", \"\") + msg);");
|
||||
} else {
|
||||
System.out.println(" return Utility.replaceColorCode(msg);");
|
||||
}
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする