LunaChat v1.2.0 : Fixed issue #11
このコミットが含まれているのは:
1 親
03946cf98b
コミット
6c0de0e74e
4ファイル変更
+26
-2
検索条件に一致するファイルはありません
@@ -78,6 +78,7 @@ public class Channel {
|
||||
this.banned = new ArrayList<String>();
|
||||
this.moderator = new ArrayList<String>();
|
||||
this.password = "";
|
||||
this.visible = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -39,6 +39,7 @@ public class ChannelManager {
|
||||
private static final String KEY_BANNED = "banned";
|
||||
private static final String KEY_MODERATOR = "moderator";
|
||||
private static final String KEY_PASSWORD = "password";
|
||||
private static final String KEY_VISIBLE = "visible";
|
||||
|
||||
private File file;
|
||||
private HashMap<String, Channel> channels;
|
||||
@@ -119,6 +120,7 @@ public class ChannelManager {
|
||||
List<String> banned = section.getStringList(KEY_BANNED);
|
||||
List<String> moderator = section.getStringList(KEY_MODERATOR);
|
||||
String password = section.getString(KEY_PASSWORD, "");
|
||||
boolean visible = section.getBoolean(KEY_VISIBLE, true);
|
||||
if ( members == null ) {
|
||||
members = new ArrayList<String>();
|
||||
}
|
||||
@@ -128,6 +130,7 @@ public class ChannelManager {
|
||||
channel.banned = banned;
|
||||
channel.moderator = moderator;
|
||||
channel.password = password;
|
||||
channel.visible = visible;
|
||||
return channel;
|
||||
}
|
||||
|
||||
@@ -148,6 +151,7 @@ public class ChannelManager {
|
||||
config.set("channels." + key + "." + KEY_BANNED, channel.banned);
|
||||
config.set("channels." + key + "." + KEY_MODERATOR, channel.moderator);
|
||||
config.set("channels." + key + "." + KEY_PASSWORD, channel.password);
|
||||
config.set("channels." + key + "." + KEY_VISIBLE, channel.visible);
|
||||
}
|
||||
|
||||
for ( String key : defaultChannels.keySet() ) {
|
||||
|
||||
@@ -134,7 +134,7 @@ public class LunaChatCommand implements CommandExecutor {
|
||||
}
|
||||
}
|
||||
|
||||
// デフォルト発言先をチェックする
|
||||
// チャンネルを取得する
|
||||
Player player = (Player) sender;
|
||||
Channel channel = LunaChat.manager.getChannel(channelName);
|
||||
|
||||
@@ -157,6 +157,18 @@ public class LunaChatCommand implements CommandExecutor {
|
||||
sendResourceMessage(sender, PREINFO, "cmdmsgSet", channelName);
|
||||
|
||||
} else {
|
||||
|
||||
// パスワードが設定されている場合は、パスワードを確認する
|
||||
if ( !channel.password.equals("") ) {
|
||||
if ( !channel.password.equals(message.toString().trim()) ) {
|
||||
// パスワード不一致
|
||||
sendResourceMessage(sender, PREERR, "errmsgPassword1");
|
||||
sendResourceMessage(sender, PREERR, "errmsgPassword2");
|
||||
sendResourceMessage(sender, PREERR, "errmsgPassword3");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// チャンネルに参加し、デフォルトの発言先に設定する
|
||||
channel.addMember(player.getName());
|
||||
sendResourceMessage(sender, PREINFO, "cmdmsgJoin", channelName);
|
||||
@@ -745,6 +757,7 @@ public class LunaChatCommand implements CommandExecutor {
|
||||
// フォーマットの設定
|
||||
channel.format = format;
|
||||
sendResourceMessage(sender, PREINFO, "cmdmsgFormat", format);
|
||||
LunaChat.manager.save();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -811,6 +824,7 @@ public class LunaChatCommand implements CommandExecutor {
|
||||
}
|
||||
}
|
||||
|
||||
LunaChat.manager.save();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -904,6 +918,8 @@ public class LunaChatCommand implements CommandExecutor {
|
||||
|
||||
if ( !setOption ) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgInvalidOptions");
|
||||
} else {
|
||||
LunaChat.manager.save();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする