aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/net
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net')
-rw-r--r--src/main/java/net/elytrium/limboauth/LimboAuth.java19
-rw-r--r--src/main/java/net/elytrium/limboauth/Settings.java5
2 files changed, 24 insertions, 0 deletions
diff --git a/src/main/java/net/elytrium/limboauth/LimboAuth.java b/src/main/java/net/elytrium/limboauth/LimboAuth.java
index ed04f3a..b2d2e43 100644
--- a/src/main/java/net/elytrium/limboauth/LimboAuth.java
+++ b/src/main/java/net/elytrium/limboauth/LimboAuth.java
@@ -495,6 +495,25 @@ public class LimboAuth {
if (onlineMode || isFloodgate) {
if (registeredPlayer == null || registeredPlayer.getHash().isEmpty()) {
registeredPlayer = AuthSessionHandler.fetchInfo(this.playerDao, player.getUniqueId());
+ if (registeredPlayer == null && Settings.IMP.MAIN.SAVE_PREMIUM_ACCOUNTS) {
+ registeredPlayer = new RegisteredPlayer(
+ nickname,
+ nickname.toLowerCase(Locale.ROOT),
+ "",
+ player.getRemoteAddress().getAddress().getHostAddress(),
+ "",
+ System.currentTimeMillis(),
+ player.getUniqueId().toString(),
+ player.getUniqueId().toString()
+ );
+
+ try {
+ this.playerDao.create(registeredPlayer);
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ }
+
if (registeredPlayer == null || registeredPlayer.getHash().isEmpty()) {
// Due to the current connection state, which is set to LOGIN there, we cannot send the packets.
// We need to wait for the PLAY connection state to set.
diff --git a/src/main/java/net/elytrium/limboauth/Settings.java b/src/main/java/net/elytrium/limboauth/Settings.java
index 99bb2f0..68102eb 100644
--- a/src/main/java/net/elytrium/limboauth/Settings.java
+++ b/src/main/java/net/elytrium/limboauth/Settings.java
@@ -73,6 +73,11 @@ public class Settings extends YamlConfig {
"If the player had the cracked account, and switched to the premium account, the cracked UUID will be used."
})
public boolean SAVE_UUID = true;
+ @Comment({
+ "Saves in the database the accounts of premium users whose login is via online-mode-need-auth: false",
+ "Can be disabled to reduce the size of stored data in the database"
+ })
+ public boolean SAVE_PREMIUM_ACCOUNTS = true;
public boolean ENABLE_TOTP = true;
public boolean TOTP_NEED_PASSWORD = true;
public boolean REGISTER_NEED_REPEAT_PASSWORD = true;