Skip to content

Commit

Permalink
1.0.8: allow-premium-names-registration option
Browse files Browse the repository at this point in the history
  • Loading branch information
hevav committed Jan 17, 2023
1 parent bea0c75 commit cffcb67
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.7
1.0.8
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

setGroup("net.elytrium")
setVersion("1.0.7")
setVersion("1.0.8")

compileJava {
getOptions().setEncoding("UTF-8")
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/net/elytrium/limboauth/socialaddon/Addon.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,11 @@ private void load() {
return;
}

if (!Settings.IMP.MAIN.ALLOW_PREMIUM_NAMES_REGISTRATION && this.plugin.isPremium(lowercaseNickname)) {
this.socialManager.broadcastMessage(dbField, id, Settings.IMP.MAIN.STRINGS.REGISTER_PREMIUM_NICKNAME);
return;
}

String newPassword = Long.toHexString(Double.doubleToLongBits(Math.random()));

RegisteredPlayer player = new RegisteredPlayer(account, "", "").setPassword(newPassword);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ public static class MAIN {
public String FORCE_UNLINK_MAIN_CMD = "forcesocialunlink";
public List<String> FORCE_UNLINK_ALIAS_CMD = List.of("forceunlink");

@Comment("Should we allow registration with premium usernames using social-register-cmds")
public boolean ALLOW_PREMIUM_NAMES_REGISTRATION = false;

public boolean ENABLE_NOTIFY = true;

@Comment("Will the unlink button unregister all socials at once?")
Expand Down Expand Up @@ -213,6 +216,7 @@ public static class STRINGS {
public String LINK_CODE = "🔑 Enter '/addsocial {CODE}' in game to complete account linking";
public String REGISTER_INCORRECT_NICKNAME = "There is no account with this nickname";
public String REGISTER_TAKEN_NICKNAME = "This nickname is already taken";
public String REGISTER_PREMIUM_NICKNAME = "This nickname belongs to a premium player";
@Placeholders({"{PASSWORD}"})
public String REGISTER_SUCCESS = "✅ Account was successfully registered{NL}Your password: {PASSWORD}{NL}Use '!keyboard' to show keyboard";

Expand Down

0 comments on commit cffcb67

Please sign in to comment.