diff options
| author | plutorocks <> | 2026-02-24 22:39:45 -0500 |
|---|---|---|
| committer | plutorocks <> | 2026-02-24 22:39:45 -0500 |
| commit | a6f97af47016fd9e0d28ffcce6b7e3be152c6eff (patch) | |
| tree | 5e7023aad07d60fbd98946f73b9bd4186c6d8a39 /src | |
| parent | 3461ba9fda8b8969f1f4b3d5b40de70063653002 (diff) | |
fix: fix IRC againmain
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/java/dev/plutorocks/IrcClient.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main/java/dev/plutorocks/IrcClient.java b/src/main/java/dev/plutorocks/IrcClient.java index a7b8c7f..703c0c1 100644 --- a/src/main/java/dev/plutorocks/IrcClient.java +++ b/src/main/java/dev/plutorocks/IrcClient.java @@ -138,6 +138,16 @@ public class IrcClient { ); return; } + if ("432".equals(code)) { + sendClientChat( + Text.literal("[IRC] ").formatted(Formatting.AQUA) + .append(Text.literal("Nick " + nick + " is invalid on this server (e.g. too long).") + .formatted(Formatting.GRAY)) + ); + MinecraftIRC.LOGGER.warn("[IRC] Nick {} rejected with 432", nick); + running = false; + return; + } if ("433".equals(code)) { sendClientChat( Text.literal("[IRC] ").formatted(Formatting.AQUA) @@ -145,6 +155,16 @@ public class IrcClient { .formatted(Formatting.GRAY)) ); MinecraftIRC.LOGGER.warn("[IRC] Nick {} already in use (433)", nick); + running = false; + return; + } + if ("451".equals(code)) { + sendClientChat( + Text.literal("[IRC] ").formatted(Formatting.AQUA) + .append(Text.literal("Server says connection is not registered (451).") + .formatted(Formatting.GRAY)) + ); + MinecraftIRC.LOGGER.warn("[IRC] Received 451 (connection not registered)"); return; } } @@ -211,6 +231,15 @@ public class IrcClient { MinecraftIRC.LOGGER.info("[IRC] Ignoring sendChannelMessage while not connected: {}", message); return; } + if (!registered) { + MinecraftIRC.LOGGER.info("[IRC] Ignoring sendChannelMessage while not registered: {}", message); + sendClientChat( + Text.literal("[IRC] ").formatted(Formatting.AQUA) + .append(Text.literal("Cannot send message yet; IRC connection is not fully registered.") + .formatted(Formatting.GRAY)) + ); + return; + } sendRaw("PRIVMSG " + channel + " :" + message); } |
