Skip to content

Commit

Permalink
Totally unambiguous invalid character warning
Browse files Browse the repository at this point in the history
  • Loading branch information
buj committed Sep 1, 2024
1 parent 8055337 commit 82f3d7b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/java/darkdustry/commands/DiscordCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -363,5 +363,16 @@ public static void load() {
Socket.request(new MuteRequest(server, args[1], args[2], args.length > 3 ? args[3] : "Not Specified",
context.member().getDisplayName()), context::reply, context::timeout);
});

discordHandler.<MessageContext>register("unmute", "<server> <player...>", "Unmute a player.", (args, context) -> {
if (noRole(context, discordConfig.adminRoleIDs))
return;

var server = args[0];
if (notFound(context, server))
return;

Socket.request(new UnmuteRequest(server, args[1]), context::reply, context::timeout);
});
}
}
5 changes: 5 additions & 0 deletions src/main/java/darkdustry/listeners/NetHandlers.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ public static void connect(NetConnection con, ConnectPacket packet) {
con.mobile = packet.mobile;
con.modclient = packet.version == -1;

if (name.contains("\uFFFD")) {
Bundle.kick(con, locale, 0L, "kick.custom-client");
return;
}

if (con.hasBegunConnecting || Seq.with(net.getConnections())
.count(other -> other.uuid.equals(uuid) || other.usid.equals(usid)) > 1) {
Bundle.kick(con, locale, 0L, "kick.already-connected");
Expand Down

0 comments on commit 82f3d7b

Please sign in to comment.