{
}
} else {
if (core.getPendingLogin().remove(ip + username) != null && config.get("secondAttemptCracked", false)) {
- core.getPlugin().getLog().info("Second attempt login -> cracked {}", username);
-
- //first login request failed so make a cracked session
- startCrackedSession(source, profile, username);
- return;
+ // LimeLogin start
+ GovindasPreSecondAttemptEvent event = new GovindasPreSecondAttemptEvent(ip, username);
+ ProxyServer.getInstance().getPluginManager().callEvent(event);
+ if (!event.isCancelled()) {
+ core.getPlugin().getLog().info("Second attempt login -> cracked {}", username);
+ //first login request failed so make a cracked session
+ startCrackedSession(source, profile, username);
+ return;
+ }
+ // LimeLogin start
}
Optional {
private boolean checkPremiumName(S source, String username, StoredProfile profile) throws Exception {
core.getPlugin().getLog().info("GameProfile {} uses a premium username", username);
- if (core.getConfig().get("autoRegister", false) && (authHook == null || !authHook.isRegistered(username))) {
- requestPremiumLogin(source, profile, username, false);
+ // LimeLogin start
+
+ //start of Govindas comment, THIS IS NEEDED to be commented if FastLogin database gets emptied, to not get premium users counted as cracked
+ //if (core.getConfig().get("autoRegister", false) && (authHook == null || !authHook.isRegistered(username))) {
+ //end of Govindas comment
+
+ // LimeLogin stop
+ if (core.getConfig().get("autoRegister", false) && (authHook == null)) {
+ // LimeLogin start
+ requestPremiumLogin(source, profile, username, false); //Comment: always use false to fix an error XD
+ // LimeLogin stop
return true;
}
diff --git a/core/src/main/java/com/github/games647/fastlogin/core/shared/event/GovindasPreSecondAttemptEvent.java b/core/src/main/java/com/github/games647/fastlogin/core/shared/event/GovindasPreSecondAttemptEvent.java
new file mode 100644
index 0000000..007083e
--- /dev/null
+++ b/core/src/main/java/com/github/games647/fastlogin/core/shared/event/GovindasPreSecondAttemptEvent.java
@@ -0,0 +1,36 @@
+// LimeLogin start
+package com.github.games647.fastlogin.core.shared.event;
+
+import net.md_5.bungee.api.plugin.Cancellable;
+import net.md_5.bungee.api.plugin.Event;
+
+public class GovindasPreSecondAttemptEvent extends Event implements Cancellable {
+
+ private final String ip;
+ private final String username;
+ private boolean cancelled;
+
+ public GovindasPreSecondAttemptEvent(String ip, String username) {
+ this.ip = ip;
+ this.username = username;
+ }
+ public String getIP() {
+ return ip;
+ }
+
+
+ public String getUsername() {
+ return username;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return cancelled;
+ }
+
+ @Override
+ public void setCancelled(boolean cancelled) {
+ this.cancelled = cancelled;
+ }
+}
+// LimeLogin stop
\ No newline at end of file
diff --git a/core/src/main/resources/config.yml b/core/src/main/resources/config.yml
index ecb1c44..477c026 100644
--- a/core/src/main/resources/config.yml
+++ b/core/src/main/resources/config.yml
@@ -235,7 +235,7 @@ autoRegisterFloodgate: false
# Recommended is the use of MariaDB (a better version of MySQL)
# Single file SQLite database
-driver: 'org.sqlite.JDBC'
+driver: 'fastlogin.sqlite.JDBC'
# File location
database: '{pluginDir}/FastLogin.db'
--
2.32.0.windows.1