Skip to content

Commit

Permalink
fix: 修复FloodgatePrefixProtect名称大小写问题 (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
shulng committed Aug 28, 2024
1 parent aeeb2f1 commit 4cd8b75
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/cc/baka9/catseedlogin/bukkit/Listeners.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public void onPlayerPreLogin(AsyncPlayerPreLoginEvent event) {
}
if (Config.Settings.FloodgatePrefixProtect && Bukkit.getPluginManager().getPlugin("floodgate") != null) {
String prefix = FloodgateApi.getInstance().getPlayerPrefix();
if (name.startsWith(prefix) && !FloodgateApi.getInstance().isFloodgatePlayer(event.getUniqueId())) {
if (name.toLowerCase().startsWith(prefix.toLowerCase()) && !FloodgateApi.getInstance().isFloodgatePlayer(event.getUniqueId())) {
event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_OTHER, "非法的基岩版玩家名称,请非基岩版玩家的名称不要以" + prefix + "开头");
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class CommunicationAuth {
try {
messageDigest = MessageDigest.getInstance("SHA-256");
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException("SHA-256 algorithm not found", e);
throw new RuntimeException(e);
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/cc/baka9/catseedlogin/util/Mail.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ public static void sendMail(String receiveMailAccount, String subject, String co
email.setSubject(subject);
email.setMsg(content);
email.addTo(receiveMailAccount);
((HtmlEmail) email).setCharset("UTF-8");
((HtmlEmail) email).setCharset("GBK");
email.setCharset("UTF-8");
email.send();

}
Expand Down

0 comments on commit 4cd8b75

Please sign in to comment.