fix: server ip leaking in discord disconnect reason and *seen even when hidden: true

This commit is contained in:
ChomeNS
2025-09-21 13:38:59 +07:00
parent 5efd7ddf8a
commit 262e13fa68
3 changed files with 11 additions and 3 deletions

View File

@@ -1 +1 @@
3663
3664

View File

@@ -153,7 +153,9 @@ public class DiscordPlugin {
public void disconnected (final DisconnectedEvent event) {
if (!bot.options.logConnectionStatusMessages || bot.connectAttempts >= 6) return;
final String reason = ComponentUtilities.stringifyDiscordAnsi(event.getReason());
final String reason = ComponentUtilities.stringifyDiscordAnsi(event.getReason())
.replace(bot.getServerString(true), bot.getServerString())
.replace(bot.options.host, bot.getServerString());
sendMessageInstantly(
String.format(
I18nUtilities.get("info.disconnected"),

View File

@@ -100,7 +100,13 @@ public class PlayersDatabasePlugin implements Listener {
if (!result.next()) return null; // doesn't exist
final long time = result.getTimestamp("time").getTime();
final String server = result.getString("server");
String server = result.getString("server");
for (final Bot bot : Main.bots) {
if (bot.options.hidden && bot.getServerString(true).equals(server)) {
server = bot.getServerString();
break;
}
}
return LongObjectImmutablePair.of(time, server);
} catch (final SQLException e) {