commit
a05ca52d66
@ -17,9 +17,6 @@ sessionLogin:
|
|||||||
sessionExpireOnIpChange: true
|
sessionExpireOnIpChange: true
|
||||||
|
|
||||||
security:
|
security:
|
||||||
# Should players in the OP list have every permissions?
|
|
||||||
opPermissions: true
|
|
||||||
|
|
||||||
# Online players aren't kicked out for "Logged in from another location!", this option should always be set to true!
|
# Online players aren't kicked out for "Logged in from another location!", this option should always be set to true!
|
||||||
forceSingleSession: true
|
forceSingleSession: true
|
||||||
# Should we display all other accounts from a player when he joins?
|
# Should we display all other accounts from a player when he joins?
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
# Database AuthMeReloaded configuration file
|
# Database AuthMeReloaded configuration file
|
||||||
|
|
||||||
# What type of database do you want to use? Avariable options: sqlite, mysql, redis
|
# What type of database do you want to use? Avariable options: sqlite, mysql, redis
|
||||||
# (The old flatfile backend is now deprecated, if you set this option to 'file' the 'file to SQLite' converter will be executed!)
|
|
||||||
backend: sqlite
|
backend: sqlite
|
||||||
# Do you like to cache all the queries? (Performance Boost)
|
# Do you like to cache all the queries? (Performance Boost)
|
||||||
caching: true
|
caching: true
|
||||||
@ -12,6 +11,7 @@ databaseName: authme
|
|||||||
tableName: authme
|
tableName: authme
|
||||||
|
|
||||||
# MySql Database connection settings
|
# MySql Database connection settings
|
||||||
|
# Avariable only if the AuthMeReloaded-Mysql module is installed!
|
||||||
mysql:
|
mysql:
|
||||||
port: '3306'
|
port: '3306'
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
@ -19,6 +19,7 @@ mysql:
|
|||||||
password: '12345'
|
password: '12345'
|
||||||
|
|
||||||
# Redis Database connection settings
|
# Redis Database connection settings
|
||||||
|
# Avariable only if the AuthMeReloaded-Redis module is installed!
|
||||||
redis:
|
redis:
|
||||||
# Get Redis from http://redis.io/
|
# Get Redis from http://redis.io/
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
|
|||||||
@ -67,8 +67,6 @@ password:
|
|||||||
# When it's true, registration require that kind of command:
|
# When it's true, registration require that kind of command:
|
||||||
# /register <password> <confirmPassword>
|
# /register <password> <confirmPassword>
|
||||||
doublePasswordCheck: true
|
doublePasswordCheck: true
|
||||||
# Should players can use their usernames as passwords?
|
|
||||||
allowNameAsPassword: false
|
|
||||||
# Deny unsafe passwords for being used, put them on lowercase!
|
# Deny unsafe passwords for being used, put them on lowercase!
|
||||||
unsafePasswords:
|
unsafePasswords:
|
||||||
- '123456'
|
- '123456'
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
<hr>
|
<p align="center"><img src="http://i61.tinypic.com/291dm49.png"></p>
|
||||||
<p align="center"><img src="http://i61.tinypic.com/fnfchs.png"></p>
|
|
||||||
<p align="center"><strong>The most used authentication plugin for CraftBukkit/Spigot!</strong></p>
|
<p align="center"><strong>The most used authentication plugin for CraftBukkit/Spigot!</strong></p>
|
||||||
<hr>
|
<hr>
|
||||||
#####Development tools:
|
#####Development tools:
|
||||||
@ -14,7 +13,7 @@
|
|||||||
|
|
||||||
- JavaDocs: <a href="http://xephi.github.io/AuthMeReloaded/index.html">AuthMe Javadoc</a>
|
- JavaDocs: <a href="http://xephi.github.io/AuthMeReloaded/index.html">AuthMe Javadoc</a>
|
||||||
|
|
||||||
- Maven Repo: <a href="http://xephi.fr:8080/plugin/repository/everything/">AuthMe Repo</a>
|
- Maven Repo: <a href="http://ci.xephi.fr/plugin/repository/everything/">AuthMe Repo</a>
|
||||||
|
|
||||||
#####Statistics:
|
#####Statistics:
|
||||||
|
|
||||||
@ -39,7 +38,7 @@ McStats: http://mcstats.org/plugin/AuthMe
|
|||||||
|
|
||||||
#####Running Requirements:
|
#####Running Requirements:
|
||||||
>- Java 1.7 (should work also with Java 1.8)
|
>- Java 1.7 (should work also with Java 1.8)
|
||||||
>- Spigot or CraftBukkit
|
>- Spigot or CraftBukkit (1.7.10 or 1.8.X)
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
###Plugin Description:
|
###Plugin Description:
|
||||||
@ -60,7 +59,7 @@ typing commands or use the inventory. It can also kick players with uncommon lon
|
|||||||
<li>Username spoofing protection.</li>
|
<li>Username spoofing protection.</li>
|
||||||
<li>Countries Whitelist/Blacklist! <a href="http://dev.bukkit.org/bukkit-plugins/authme-reloaded/pages/countries-codes/">(countries codes)</a></li>
|
<li>Countries Whitelist/Blacklist! <a href="http://dev.bukkit.org/bukkit-plugins/authme-reloaded/pages/countries-codes/">(countries codes)</a></li>
|
||||||
<li><strong>Built-in AntiBot System!</strong></li>
|
<li><strong>Built-in AntiBot System!</strong></li>
|
||||||
<li><del>Passpartu Feature: Admin can login with all account more info <a href="http://dev.bukkit.org/server-mods/authme-reloaded/pages/how-to-install-and-initial-configuration/">here</a></del> <strong>(Deprecated)</strong></li>
|
<li><strong>ForceLogin Feature: Admins can login with all account via console command!</strong></li>
|
||||||
<li><strong>Avoid the "Logged in from another location" message!</strong></li>
|
<li><strong>Avoid the "Logged in from another location" message!</strong></li>
|
||||||
<li>Session Login!</li>
|
<li>Session Login!</li>
|
||||||
<li>Editable translations and messages!</li>
|
<li>Editable translations and messages!</li>
|
||||||
|
|||||||
17
pom.xml
17
pom.xml
@ -21,7 +21,7 @@
|
|||||||
<maven.compiler.target>1.7</maven.compiler.target>
|
<maven.compiler.target>1.7</maven.compiler.target>
|
||||||
|
|
||||||
<!-- Change MC Version HERE! -->
|
<!-- Change MC Version HERE! -->
|
||||||
<bukkitVersion>1.8.7-R0.1-SNAPSHOT</bukkitVersion>
|
<bukkitVersion>1.8.8-R0.1-SNAPSHOT</bukkitVersion>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<!-- Official Build Server -->
|
<!-- Official Build Server -->
|
||||||
@ -178,6 +178,7 @@
|
|||||||
<groupId>mysql</groupId>
|
<groupId>mysql</groupId>
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
<version>5.1.36</version>
|
<version>5.1.36</version>
|
||||||
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- SQLite Library -->
|
<!-- SQLite Library -->
|
||||||
@ -185,6 +186,7 @@
|
|||||||
<groupId>org.xerial</groupId>
|
<groupId>org.xerial</groupId>
|
||||||
<artifactId>sqlite-jdbc</artifactId>
|
<artifactId>sqlite-jdbc</artifactId>
|
||||||
<version>3.8.10.1</version>
|
<version>3.8.10.1</version>
|
||||||
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Java Email API -->
|
<!-- Java Email API -->
|
||||||
@ -192,13 +194,16 @@
|
|||||||
<groupId>com.sun.mail</groupId>
|
<groupId>com.sun.mail</groupId>
|
||||||
<artifactId>javax.mail</artifactId>
|
<artifactId>javax.mail</artifactId>
|
||||||
<version>1.5.4</version>
|
<version>1.5.4</version>
|
||||||
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<!-- Maxmind GeoIp API -->
|
<!-- Maxmind GeoIp API -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.maxmind.geoip</groupId>
|
<groupId>com.maxmind.geoip</groupId>
|
||||||
<artifactId>geoip-api</artifactId>
|
<artifactId>geoip-api</artifactId>
|
||||||
<version>1.2.14</version>
|
<version>1.2.14</version>
|
||||||
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -224,6 +229,7 @@
|
|||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot-api</artifactId>
|
<artifactId>spigot-api</artifactId>
|
||||||
<version>${bukkitVersion}</version>
|
<version>${bukkitVersion}</version>
|
||||||
|
<scope>provided</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<artifactId>bungeecord-chat</artifactId>
|
<artifactId>bungeecord-chat</artifactId>
|
||||||
@ -237,6 +243,7 @@
|
|||||||
<groupId>com.comphenix.attribute</groupId>
|
<groupId>com.comphenix.attribute</groupId>
|
||||||
<artifactId>AttributeStorage</artifactId>
|
<artifactId>AttributeStorage</artifactId>
|
||||||
<version>0.0.2-SNAPSHOT</version>
|
<version>0.0.2-SNAPSHOT</version>
|
||||||
|
<scope>compile</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
@ -272,6 +279,7 @@
|
|||||||
<groupId>net.citizensnpcs</groupId>
|
<groupId>net.citizensnpcs</groupId>
|
||||||
<artifactId>citizensapi</artifactId>
|
<artifactId>citizensapi</artifactId>
|
||||||
<version>2.0.16-SNAPSHOT</version>
|
<version>2.0.16-SNAPSHOT</version>
|
||||||
|
<scope>provided</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
@ -290,7 +298,7 @@
|
|||||||
<artifactId>Multiverse-Core</artifactId>
|
<artifactId>Multiverse-Core</artifactId>
|
||||||
<version>2.5</version>
|
<version>2.5</version>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
<scope>compile</scope>
|
<scope>provided</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
@ -320,6 +328,7 @@
|
|||||||
<groupId>net.ess3</groupId>
|
<groupId>net.ess3</groupId>
|
||||||
<artifactId>Essentials</artifactId>
|
<artifactId>Essentials</artifactId>
|
||||||
<version>2.14-SNAPSHOT</version>
|
<version>2.14-SNAPSHOT</version>
|
||||||
|
<scope>provided</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
@ -337,6 +346,7 @@
|
|||||||
<groupId>net.minelink</groupId>
|
<groupId>net.minelink</groupId>
|
||||||
<artifactId>CombatTagPlus</artifactId>
|
<artifactId>CombatTagPlus</artifactId>
|
||||||
<version>1.2.1-SNAPSHOT</version>
|
<version>1.2.1-SNAPSHOT</version>
|
||||||
|
<scope>provided</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
@ -410,6 +420,7 @@
|
|||||||
<groupId>com.trc202</groupId>
|
<groupId>com.trc202</groupId>
|
||||||
<artifactId>CombatTag</artifactId>
|
<artifactId>CombatTag</artifactId>
|
||||||
<version>6.2.1-SNAPSHOT</version>
|
<version>6.2.1-SNAPSHOT</version>
|
||||||
|
<scope>provided</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
@ -427,6 +438,7 @@
|
|||||||
<groupId>de.luricos.bukkit</groupId>
|
<groupId>de.luricos.bukkit</groupId>
|
||||||
<artifactId>xAuth</artifactId>
|
<artifactId>xAuth</artifactId>
|
||||||
<version>2.6</version>
|
<version>2.6</version>
|
||||||
|
<scope>provided</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
@ -464,6 +476,7 @@
|
|||||||
<groupId>com.acrobot.chestshop</groupId>
|
<groupId>com.acrobot.chestshop</groupId>
|
||||||
<artifactId>chestshop</artifactId>
|
<artifactId>chestshop</artifactId>
|
||||||
<version>3.8.12</version>
|
<version>3.8.12</version>
|
||||||
|
<scope>provided</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
|
|||||||
@ -49,7 +49,6 @@ import fr.xephi.authme.commands.ConverterCommand;
|
|||||||
import fr.xephi.authme.commands.EmailCommand;
|
import fr.xephi.authme.commands.EmailCommand;
|
||||||
import fr.xephi.authme.commands.LoginCommand;
|
import fr.xephi.authme.commands.LoginCommand;
|
||||||
import fr.xephi.authme.commands.LogoutCommand;
|
import fr.xephi.authme.commands.LogoutCommand;
|
||||||
import fr.xephi.authme.commands.PasspartuCommand;
|
|
||||||
import fr.xephi.authme.commands.RegisterCommand;
|
import fr.xephi.authme.commands.RegisterCommand;
|
||||||
import fr.xephi.authme.commands.UnregisterCommand;
|
import fr.xephi.authme.commands.UnregisterCommand;
|
||||||
import fr.xephi.authme.converter.Converter;
|
import fr.xephi.authme.converter.Converter;
|
||||||
@ -243,7 +242,6 @@ public class AuthMe extends JavaPlugin {
|
|||||||
this.getCommand("changepassword").setExecutor(new ChangePasswordCommand(this));
|
this.getCommand("changepassword").setExecutor(new ChangePasswordCommand(this));
|
||||||
this.getCommand("logout").setExecutor(new LogoutCommand(this));
|
this.getCommand("logout").setExecutor(new LogoutCommand(this));
|
||||||
this.getCommand("unregister").setExecutor(new UnregisterCommand(this));
|
this.getCommand("unregister").setExecutor(new UnregisterCommand(this));
|
||||||
this.getCommand("passpartu").setExecutor(new PasspartuCommand(this));
|
|
||||||
this.getCommand("email").setExecutor(new EmailCommand(this));
|
this.getCommand("email").setExecutor(new EmailCommand(this));
|
||||||
this.getCommand("captcha").setExecutor(new CaptchaCommand(this));
|
this.getCommand("captcha").setExecutor(new CaptchaCommand(this));
|
||||||
this.getCommand("converter").setExecutor(new ConverterCommand(this));
|
this.getCommand("converter").setExecutor(new ConverterCommand(this));
|
||||||
@ -251,8 +249,12 @@ public class AuthMe extends JavaPlugin {
|
|||||||
if (!Settings.isForceSingleSessionEnabled) {
|
if (!Settings.isForceSingleSessionEnabled) {
|
||||||
ConsoleLogger.showError("WARNING!!! By disabling ForceSingleSession, your server protection is inadequate!");
|
ConsoleLogger.showError("WARNING!!! By disabling ForceSingleSession, your server protection is inadequate!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Settings.getSessionTimeout == 0 && Settings.isSessionsEnabled) {
|
||||||
|
ConsoleLogger.showError("WARNING!!! You set session timeout to 0, this may cause security issues!");
|
||||||
|
}
|
||||||
|
|
||||||
if (Settings.reloadSupport)
|
if (Settings.reloadSupport) {
|
||||||
try {
|
try {
|
||||||
int playersOnline = 0;
|
int playersOnline = 0;
|
||||||
try {
|
try {
|
||||||
@ -277,9 +279,9 @@ public class AuthMe extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (Settings.usePurge)
|
autoPurge();
|
||||||
autoPurge();
|
|
||||||
|
|
||||||
// Download GeoIp.dat file
|
// Download GeoIp.dat file
|
||||||
downloadGeoIp();
|
downloadGeoIp();
|
||||||
@ -543,13 +545,13 @@ public class AuthMe extends JavaPlugin {
|
|||||||
return;
|
return;
|
||||||
ConsoleLogger.info("AutoPurging the Database: " + cleared.size() + " accounts removed!");
|
ConsoleLogger.info("AutoPurging the Database: " + cleared.size() + " accounts removed!");
|
||||||
if (Settings.purgeEssentialsFile && this.ess != null)
|
if (Settings.purgeEssentialsFile && this.ess != null)
|
||||||
dataManager.purgeEssentials(cleared);
|
dataManager.purgeEssentials(cleared); // name to UUID convertion needed with latest versions
|
||||||
if (Settings.purgePlayerDat)
|
if (Settings.purgePlayerDat)
|
||||||
dataManager.purgeDat(cleared);
|
dataManager.purgeDat(cleared); // name to UUID convertion needed with latest versions of MC
|
||||||
if (Settings.purgeLimitedCreative)
|
if (Settings.purgeLimitedCreative)
|
||||||
dataManager.purgeLimitedCreative(cleared);
|
dataManager.purgeLimitedCreative(cleared);
|
||||||
if (Settings.purgeAntiXray)
|
if (Settings.purgeAntiXray)
|
||||||
dataManager.purgeAntiXray(cleared);
|
dataManager.purgeAntiXray(cleared); // IDK if it uses UUID or names... (Actually it purges only names!)
|
||||||
if (Settings.purgePermissions)
|
if (Settings.purgePermissions)
|
||||||
dataManager.purgePermissions(cleared, permission);
|
dataManager.purgePermissions(cleared, permission);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -109,6 +109,12 @@ public class DataManager {
|
|||||||
if (playerFile.exists()) {
|
if (playerFile.exists()) {
|
||||||
playerFile.delete();
|
playerFile.delete();
|
||||||
i++;
|
i++;
|
||||||
|
} else {
|
||||||
|
playerFile = new File(plugin.getServer().getWorldContainer() + File.separator + Settings.defaultWorld + File.separator + "players" + File.separator + player.getUniqueId() + ".dat");
|
||||||
|
if (playerFile.exists()) {
|
||||||
|
playerFile.delete();
|
||||||
|
i++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
@ -116,6 +122,7 @@ public class DataManager {
|
|||||||
ConsoleLogger.info("AutoPurgeDatabase : Remove " + i + " .dat Files");
|
ConsoleLogger.info("AutoPurgeDatabase : Remove " + i + " .dat Files");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public void purgeEssentials(List<String> cleared) {
|
public void purgeEssentials(List<String> cleared) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (String name : cleared) {
|
for (String name : cleared) {
|
||||||
@ -124,6 +131,12 @@ public class DataManager {
|
|||||||
if (playerFile.exists()) {
|
if (playerFile.exists()) {
|
||||||
playerFile.delete();
|
playerFile.delete();
|
||||||
i++;
|
i++;
|
||||||
|
} else {
|
||||||
|
playerFile = new File(plugin.ess.getDataFolder() + File.separator + "userdata" + File.separator + Bukkit.getOfflinePlayer(name).getUniqueId() + ".yml");
|
||||||
|
if (playerFile.exists()) {
|
||||||
|
playerFile.delete();
|
||||||
|
i++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
|
|||||||
@ -82,25 +82,40 @@ public class SendMailSSL {
|
|||||||
// Generate an image ?
|
// Generate an image ?
|
||||||
File file = null;
|
File file = null;
|
||||||
if (Settings.generateImage) {
|
if (Settings.generateImage) {
|
||||||
ImageGenerator gen = new ImageGenerator(newPass);
|
try {
|
||||||
file = new File(plugin.getDataFolder() + File.separator + auth.getNickname() + "_new_pass.jpg");
|
ImageGenerator gen = new ImageGenerator(newPass);
|
||||||
ImageIO.write(gen.generateImage(), "jpg", file);
|
file = new File(plugin.getDataFolder() + File.separator + auth.getNickname() + "_new_pass.jpg");
|
||||||
messageBodyPart = new MimeBodyPart();
|
ImageIO.write(gen.generateImage(), "jpg", file);
|
||||||
DataSource source = new FileDataSource(file);
|
messageBodyPart = new MimeBodyPart();
|
||||||
messageBodyPart.setDataHandler(new DataHandler(source));
|
DataSource source = new FileDataSource(file);
|
||||||
messageBodyPart.setFileName(auth.getNickname() + "_new_pass.jpg");
|
messageBodyPart.setDataHandler(new DataHandler(source));
|
||||||
multipart.addBodyPart(messageBodyPart);
|
messageBodyPart.setFileName(auth.getNickname() + "_new_pass.jpg");
|
||||||
|
multipart.addBodyPart(messageBodyPart);
|
||||||
|
} catch (Exception e) {
|
||||||
|
ConsoleLogger.showError("Unable to send new password as image! Using normal text! Dest: " + mail);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
message.setContent(multipart);
|
|
||||||
Transport transport = session.getTransport("smtp");
|
Transport transport = session.getTransport("smtp");
|
||||||
transport.connect(smtp, acc, password);
|
message.setContent(multipart);
|
||||||
|
|
||||||
|
try {
|
||||||
|
transport.connect(smtp, acc, password);
|
||||||
|
} catch (Exception e) {
|
||||||
|
ConsoleLogger.showError("Can't connect to your SMTP server! Aborting! Can't send recorvery email to " + mail);
|
||||||
|
if (file != null)
|
||||||
|
file.delete();
|
||||||
|
return;
|
||||||
|
}
|
||||||
transport.sendMessage(message, message.getAllRecipients());
|
transport.sendMessage(message, message.getAllRecipients());
|
||||||
|
|
||||||
if (file != null)
|
if (file != null)
|
||||||
file.delete();
|
file.delete();
|
||||||
|
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
ConsoleLogger.showError("Some error occured while trying to send a email to " + mail);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
ConsoleLogger.showError("Some error occured while trying to send a mail to " + mail);
|
ConsoleLogger.showError("Some error occured while trying to send a email to " + mail);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
package fr.xephi.authme;
|
package fr.xephi.authme;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.io.File;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
@ -13,7 +12,6 @@ import org.bukkit.entity.Player;
|
|||||||
import fr.xephi.authme.cache.limbo.LimboCache;
|
import fr.xephi.authme.cache.limbo.LimboCache;
|
||||||
import fr.xephi.authme.cache.limbo.LimboPlayer;
|
import fr.xephi.authme.cache.limbo.LimboPlayer;
|
||||||
import fr.xephi.authme.events.AuthMeTeleportEvent;
|
import fr.xephi.authme.events.AuthMeTeleportEvent;
|
||||||
import fr.xephi.authme.security.RandomString;
|
|
||||||
import fr.xephi.authme.settings.Settings;
|
import fr.xephi.authme.settings.Settings;
|
||||||
|
|
||||||
public class Utils {
|
public class Utils {
|
||||||
@ -22,7 +20,6 @@ public class Utils {
|
|||||||
private static Utils singleton;
|
private static Utils singleton;
|
||||||
int id;
|
int id;
|
||||||
public AuthMe plugin;
|
public AuthMe plugin;
|
||||||
private static List<String> tokens = new ArrayList<String>();
|
|
||||||
|
|
||||||
public Utils(AuthMe plugin) {
|
public Utils(AuthMe plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
@ -160,40 +157,6 @@ public class Utils {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Random Token for passpartu
|
|
||||||
*/
|
|
||||||
public boolean obtainToken() {
|
|
||||||
try {
|
|
||||||
final String token = new RandomString(10).nextString();
|
|
||||||
tokens.add(token);
|
|
||||||
ConsoleLogger.info("[AuthMe] Security passpartu token: " + token);
|
|
||||||
Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, new Runnable() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
tokens.remove(token);
|
|
||||||
}
|
|
||||||
|
|
||||||
}, 600);
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Read Token
|
|
||||||
*/
|
|
||||||
public boolean readToken(String inputToken) {
|
|
||||||
boolean ret = false;
|
|
||||||
if (tokens.contains(inputToken))
|
|
||||||
ret = true;
|
|
||||||
tokens.remove(inputToken);
|
|
||||||
return (ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Used for force player GameMode
|
* Used for force player GameMode
|
||||||
*/
|
*/
|
||||||
@ -208,5 +171,19 @@ public class Utils {
|
|||||||
NOTLOGGEDIN,
|
NOTLOGGEDIN,
|
||||||
LOGGEDIN
|
LOGGEDIN
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void purgeDirectory(File file){
|
||||||
|
String files[] = file.list();
|
||||||
|
if (files != null && files.length != 0){
|
||||||
|
for (String temp : files) {
|
||||||
|
File fileDelete = new File(file, temp);
|
||||||
|
if (fileDelete.isDirectory()){
|
||||||
|
purgeDirectory(fileDelete);
|
||||||
|
fileDelete.delete();
|
||||||
|
} else {
|
||||||
|
fileDelete.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,6 +24,7 @@ import fr.xephi.authme.AuthMe;
|
|||||||
import fr.xephi.authme.ConsoleLogger;
|
import fr.xephi.authme.ConsoleLogger;
|
||||||
import fr.xephi.authme.api.API;
|
import fr.xephi.authme.api.API;
|
||||||
import fr.xephi.authme.settings.Settings;
|
import fr.xephi.authme.settings.Settings;
|
||||||
|
import fr.xephi.authme.Utils;
|
||||||
|
|
||||||
public class FileCache {
|
public class FileCache {
|
||||||
|
|
||||||
@ -44,9 +45,9 @@ public class FileCache {
|
|||||||
try {
|
try {
|
||||||
path = player.getUniqueId().toString();
|
path = player.getUniqueId().toString();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
path = player.getName();
|
path = player.getName().toLowerCase();
|
||||||
} catch (Error e) {
|
} catch (Error e) {
|
||||||
path = player.getName();
|
path = player.getName().toLowerCase();
|
||||||
}
|
}
|
||||||
File file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path + File.separator + "playerdatas.cache");
|
File file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path + File.separator + "playerdatas.cache");
|
||||||
|
|
||||||
@ -197,9 +198,9 @@ public class FileCache {
|
|||||||
try {
|
try {
|
||||||
path = player.getUniqueId().toString();
|
path = player.getUniqueId().toString();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
path = player.getName();
|
path = player.getName().toLowerCase();
|
||||||
} catch (Error e) {
|
} catch (Error e) {
|
||||||
path = player.getName();
|
path = player.getName().toLowerCase();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
File file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path + File.separator + "playerdatas.cache");
|
File file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path + File.separator + "playerdatas.cache");
|
||||||
@ -536,30 +537,25 @@ public class FileCache {
|
|||||||
try {
|
try {
|
||||||
path = player.getUniqueId().toString();
|
path = player.getUniqueId().toString();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
path = player.getName();
|
path = player.getName().toLowerCase();
|
||||||
} catch (Error e) {
|
} catch (Error e) {
|
||||||
path = player.getName();
|
path = player.getName().toLowerCase();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
File file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path);
|
File file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path);
|
||||||
if (!file.exists()) {
|
if (file.list() != null) {
|
||||||
file = new File("cache/" + player.getName().toLowerCase() + ".cache");
|
Utils.purgeDirectory(file);
|
||||||
}
|
file.delete();
|
||||||
if (file.exists()) {
|
} else {
|
||||||
if (file.isDirectory() && file.listFiles() != null) {
|
file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + player.getName().toLowerCase() + ".cache");
|
||||||
for (File f : file.listFiles()) {
|
if(file.isFile()){
|
||||||
if (f.isDirectory() && f.listFiles() != null) {
|
|
||||||
for (File a : f.listFiles()) {
|
|
||||||
a.delete();
|
|
||||||
}
|
|
||||||
f.delete();
|
|
||||||
} else f.delete();
|
|
||||||
}
|
|
||||||
file.delete();
|
file.delete();
|
||||||
} else file.delete();
|
} else {
|
||||||
|
ConsoleLogger.showError("Failed to remove" + player.getName() + "cache, it doesn't exist!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
ConsoleLogger.showError("File cannot be removed correctly :/");
|
ConsoleLogger.showError("Failed to remove" + player.getName() + "cache :/");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -568,9 +564,9 @@ public class FileCache {
|
|||||||
try {
|
try {
|
||||||
path = player.getUniqueId().toString();
|
path = player.getUniqueId().toString();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
path = player.getName();
|
path = player.getName().toLowerCase();
|
||||||
} catch (Error e) {
|
} catch (Error e) {
|
||||||
path = player.getName();
|
path = player.getName().toLowerCase();
|
||||||
}
|
}
|
||||||
File file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path + File.separator + "playerdatas.cache");
|
File file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path + File.separator + "playerdatas.cache");
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
|
|||||||
@ -15,7 +15,6 @@ import org.bukkit.OfflinePlayer;
|
|||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.command.ConsoleCommandSender;
|
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.potion.PotionEffect;
|
||||||
@ -71,7 +70,6 @@ public class AdminCommand implements CommandExecutor {
|
|||||||
sender.sendMessage("/authme firstspawn - Teleport yourself to the first spawn point");
|
sender.sendMessage("/authme firstspawn - Teleport yourself to the first spawn point");
|
||||||
sender.sendMessage("/authme switchantibot on/off - Enable/Disable AntiBot feature");
|
sender.sendMessage("/authme switchantibot on/off - Enable/Disable AntiBot feature");
|
||||||
sender.sendMessage("/authme forcelogin <playername> - Enforce the login of a connected player");
|
sender.sendMessage("/authme forcelogin <playername> - Enforce the login of a connected player");
|
||||||
sender.sendMessage("/authme passpartutoken - Generate a timed token to login with every player's account (CONSOLE ONLY)");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,19 +78,6 @@ public class AdminCommand implements CommandExecutor {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((sender instanceof ConsoleCommandSender) && args[0].equalsIgnoreCase("passpartutoken")) {
|
|
||||||
if (args.length > 1) {
|
|
||||||
ConsoleLogger.info("[AuthMe] command usage: /authme passpartutoken");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (Utils.getInstance().obtainToken()) {
|
|
||||||
ConsoleLogger.info("[AuthMe] You have 30s to insert this token ingame with /passpartu <token>");
|
|
||||||
} else {
|
|
||||||
ConsoleLogger.info("[AuthMe] Security error on passpartu token, please redo the command.");
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (args[0].equalsIgnoreCase("version")) {
|
if (args[0].equalsIgnoreCase("version")) {
|
||||||
sender.sendMessage("AuthMe Version: " + AuthMe.getInstance().getDescription().getVersion());
|
sender.sendMessage("AuthMe Version: " + AuthMe.getInstance().getDescription().getVersion());
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -1,52 +0,0 @@
|
|||||||
package fr.xephi.authme.commands;
|
|
||||||
|
|
||||||
import org.bukkit.command.Command;
|
|
||||||
import org.bukkit.command.CommandExecutor;
|
|
||||||
import org.bukkit.command.CommandSender;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import fr.xephi.authme.AuthMe;
|
|
||||||
import fr.xephi.authme.Utils;
|
|
||||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
|
||||||
import fr.xephi.authme.settings.Messages;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author stefano
|
|
||||||
*/
|
|
||||||
public class PasspartuCommand implements CommandExecutor {
|
|
||||||
|
|
||||||
private Utils utils = Utils.getInstance();
|
|
||||||
public AuthMe plugin;
|
|
||||||
private Messages m = Messages.getInstance();
|
|
||||||
|
|
||||||
public PasspartuCommand(AuthMe plugin) {
|
|
||||||
this.plugin = plugin;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onCommand(CommandSender sender, Command cmnd, String label,
|
|
||||||
String[] args) {
|
|
||||||
|
|
||||||
if (!plugin.authmePermissible(sender, "authme." + label.toLowerCase())) {
|
|
||||||
m.send(sender, "no_perm");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (PlayerCache.getInstance().isAuthenticated(sender.getName().toLowerCase())) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((sender instanceof Player) && args.length == 1) {
|
|
||||||
if (utils.readToken(args[0])) {
|
|
||||||
// bypass login!
|
|
||||||
plugin.management.performLogin((Player) sender, "dontneed", true);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
sender.sendMessage("Time is expired or Token is Wrong!");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
sender.sendMessage("usage: /passpartu token");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -84,7 +84,7 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
String cmd = msg.split(" ")[0];
|
String cmd = msg.split(" ")[0];
|
||||||
if (cmd.equalsIgnoreCase("/login") || cmd.equalsIgnoreCase("/register") || cmd.equalsIgnoreCase("/passpartu") || cmd.equalsIgnoreCase("/l") || cmd.equalsIgnoreCase("/reg") || cmd.equalsIgnoreCase("/email") || cmd.equalsIgnoreCase("/captcha"))
|
if (cmd.equalsIgnoreCase("/login") || cmd.equalsIgnoreCase("/register") || cmd.equalsIgnoreCase("/l") || cmd.equalsIgnoreCase("/reg") || cmd.equalsIgnoreCase("/email") || cmd.equalsIgnoreCase("/captcha"))
|
||||||
return;
|
return;
|
||||||
if (Settings.useEssentialsMotd && cmd.equalsIgnoreCase("/motd"))
|
if (Settings.useEssentialsMotd && cmd.equalsIgnoreCase("/motd"))
|
||||||
return;
|
return;
|
||||||
@ -411,7 +411,7 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
if (event.getResult() != PlayerLoginEvent.Result.ALLOWED)
|
if (event.getResult() != PlayerLoginEvent.Result.ALLOWED)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Settings.enablePasspartu && !Settings.countriesBlacklist.isEmpty()) {
|
if (!Settings.countriesBlacklist.isEmpty()) {
|
||||||
String code = plugin.getCountryCode(event.getAddress().getHostAddress());
|
String code = plugin.getCountryCode(event.getAddress().getHostAddress());
|
||||||
if (((code == null) || (Settings.countriesBlacklist.contains(code) && !isAuthAvailable)) && !plugin.authmePermissible(player, "authme.bypassantibot")) {
|
if (((code == null) || (Settings.countriesBlacklist.contains(code) && !isAuthAvailable)) && !plugin.authmePermissible(player, "authme.bypassantibot")) {
|
||||||
event.setKickMessage(m.send("country_banned")[0]);
|
event.setKickMessage(m.send("country_banned")[0]);
|
||||||
@ -428,13 +428,21 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Settings.isKickNonRegisteredEnabled) {
|
if (Settings.isKickNonRegisteredEnabled && !Settings.antiBotInAction){
|
||||||
if (!plugin.database.isAuthAvailable(name)) {
|
if (!plugin.database.isAuthAvailable(name)) {
|
||||||
event.setKickMessage(m.send("reg_only")[0]);
|
event.setKickMessage(m.send("reg_only")[0]);
|
||||||
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
|
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Settings.antiBotInAction){
|
||||||
|
if (!plugin.database.isAuthAvailable(name)) {
|
||||||
|
event.setKickMessage("AntiBot service in action! Non registered players can't connect until the bot attack stops!"); //Need to add string to messages
|
||||||
|
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check if forceSingleSession is set to true, so kick player that has
|
// Check if forceSingleSession is set to true, so kick player that has
|
||||||
// joined with same nick of online player
|
// joined with same nick of online player
|
||||||
|
|||||||
@ -13,6 +13,7 @@ public interface Module {
|
|||||||
public enum ModuleType {
|
public enum ModuleType {
|
||||||
MANAGER,
|
MANAGER,
|
||||||
MYSQL,
|
MYSQL,
|
||||||
|
REDIS,
|
||||||
ACTIONS,
|
ACTIONS,
|
||||||
CONVERTERS,
|
CONVERTERS,
|
||||||
EMAILS,
|
EMAILS,
|
||||||
|
|||||||
@ -141,7 +141,7 @@ public class AsyncronousJoin {
|
|||||||
SpawnTeleportEvent tpEvent = new SpawnTeleportEvent(player, player.getLocation(), spawnLoc, PlayerCache.getInstance().isAuthenticated(name));
|
SpawnTeleportEvent tpEvent = new SpawnTeleportEvent(player, player.getLocation(), spawnLoc, PlayerCache.getInstance().isAuthenticated(name));
|
||||||
plugin.getServer().getPluginManager().callEvent(tpEvent);
|
plugin.getServer().getPluginManager().callEvent(tpEvent);
|
||||||
if (!tpEvent.isCancelled()) {
|
if (!tpEvent.isCancelled()) {
|
||||||
if (player != null && player.isOnline() && tpEvent.getTo() != null) {
|
if (player.isOnline() && tpEvent.getTo() != null) {
|
||||||
if (tpEvent.getTo().getWorld() != null)
|
if (tpEvent.getTo().getWorld() != null)
|
||||||
player.teleport(tpEvent.getTo());
|
player.teleport(tpEvent.getTo());
|
||||||
}
|
}
|
||||||
@ -185,7 +185,7 @@ public class AsyncronousJoin {
|
|||||||
SpawnTeleportEvent tpEvent = new SpawnTeleportEvent(player, player.getLocation(), spawnLoc, PlayerCache.getInstance().isAuthenticated(name));
|
SpawnTeleportEvent tpEvent = new SpawnTeleportEvent(player, player.getLocation(), spawnLoc, PlayerCache.getInstance().isAuthenticated(name));
|
||||||
plugin.getServer().getPluginManager().callEvent(tpEvent);
|
plugin.getServer().getPluginManager().callEvent(tpEvent);
|
||||||
if (!tpEvent.isCancelled()) {
|
if (!tpEvent.isCancelled()) {
|
||||||
if (player != null && player.isOnline() && tpEvent.getTo() != null) {
|
if (player.isOnline() && tpEvent.getTo() != null) {
|
||||||
if (tpEvent.getTo().getWorld() != null)
|
if (tpEvent.getTo().getWorld() != null)
|
||||||
player.teleport(tpEvent.getTo());
|
player.teleport(tpEvent.getTo());
|
||||||
}
|
}
|
||||||
@ -291,7 +291,7 @@ public class AsyncronousJoin {
|
|||||||
FirstSpawnTeleportEvent tpEvent = new FirstSpawnTeleportEvent(player, player.getLocation(), loc);
|
FirstSpawnTeleportEvent tpEvent = new FirstSpawnTeleportEvent(player, player.getLocation(), loc);
|
||||||
plugin.getServer().getPluginManager().callEvent(tpEvent);
|
plugin.getServer().getPluginManager().callEvent(tpEvent);
|
||||||
if (!tpEvent.isCancelled()) {
|
if (!tpEvent.isCancelled()) {
|
||||||
if (player != null && player.isOnline() && tpEvent.getTo() != null && tpEvent.getTo().getWorld() != null) {
|
if (player.isOnline() && tpEvent.getTo() != null && tpEvent.getTo().getWorld() != null) {
|
||||||
player.teleport(tpEvent.getTo());
|
player.teleport(tpEvent.getTo());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -78,18 +78,20 @@ public class AsyncronousQuit {
|
|||||||
LimboCache.getInstance().deleteLimboPlayer(name);
|
LimboCache.getInstance().deleteLimboPlayer(name);
|
||||||
}
|
}
|
||||||
if (Settings.isSessionsEnabled && !isKick) {
|
if (Settings.isSessionsEnabled && !isKick) {
|
||||||
BukkitTask task = plugin.getServer().getScheduler().runTaskLaterAsynchronously(plugin, new Runnable() {
|
if (Settings.getSessionTimeout != 0){
|
||||||
|
BukkitTask task = plugin.getServer().getScheduler().runTaskLaterAsynchronously(plugin, new Runnable() {
|
||||||
@Override
|
|
||||||
public void run() {
|
@Override
|
||||||
PlayerCache.getInstance().removePlayer(name);
|
public void run() {
|
||||||
if (database.isLogged(name))
|
PlayerCache.getInstance().removePlayer(name);
|
||||||
database.setUnlogged(name);
|
if (database.isLogged(name))
|
||||||
plugin.sessions.remove(name);
|
database.setUnlogged(name);
|
||||||
}
|
plugin.sessions.remove(name);
|
||||||
|
}
|
||||||
}, Settings.getSessionTimeout * 20 * 60);
|
|
||||||
plugin.sessions.put(name, task);
|
}, Settings.getSessionTimeout * 20 * 60);
|
||||||
|
plugin.sessions.put(name, task);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
PlayerCache.getInstance().removePlayer(name);
|
PlayerCache.getInstance().removePlayer(name);
|
||||||
database.setUnlogged(name);
|
database.setUnlogged(name);
|
||||||
|
|||||||
@ -1,13 +1,14 @@
|
|||||||
package fr.xephi.authme.process.register;
|
package fr.xephi.authme.process.register;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.scheduler.BukkitScheduler;
|
||||||
import org.bukkit.scheduler.BukkitTask;
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
|
|
||||||
import fr.xephi.authme.AuthMe;
|
import fr.xephi.authme.AuthMe;
|
||||||
import fr.xephi.authme.ConsoleLogger;
|
import fr.xephi.authme.ConsoleLogger;
|
||||||
import fr.xephi.authme.Utils;
|
import fr.xephi.authme.Utils;
|
||||||
import fr.xephi.authme.cache.limbo.LimboCache;
|
import fr.xephi.authme.cache.limbo.LimboCache;
|
||||||
|
import fr.xephi.authme.cache.limbo.LimboPlayer;
|
||||||
import fr.xephi.authme.settings.Messages;
|
import fr.xephi.authme.settings.Messages;
|
||||||
import fr.xephi.authme.settings.Settings;
|
import fr.xephi.authme.settings.Settings;
|
||||||
import fr.xephi.authme.task.MessageTask;
|
import fr.xephi.authme.task.MessageTask;
|
||||||
@ -28,21 +29,26 @@ public class ProcessSyncronousEmailRegister implements Runnable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
LimboPlayer limbo = LimboCache.getInstance().getLimboPlayer(name);
|
||||||
if (!Settings.getRegisteredGroup.isEmpty()) {
|
if (!Settings.getRegisteredGroup.isEmpty()) {
|
||||||
Utils.getInstance().setGroup(player, Utils.groupType.REGISTERED);
|
Utils.getInstance().setGroup(player, Utils.groupType.REGISTERED);
|
||||||
}
|
}
|
||||||
m.send(player, "vb_nonActiv");
|
m.send(player, "vb_nonActiv");
|
||||||
int time = Settings.getRegistrationTimeout * 20;
|
int time = Settings.getRegistrationTimeout * 20;
|
||||||
int msgInterval = Settings.getWarnMessageInterval;
|
int msgInterval = Settings.getWarnMessageInterval;
|
||||||
if (time != 0) {
|
|
||||||
LimboCache.getInstance().getLimboPlayer(name).getTimeoutTaskId().cancel();
|
BukkitScheduler sched = plugin.getServer().getScheduler();
|
||||||
BukkitTask id = Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, new TimeoutTask(plugin, name, player), time);
|
if (time != 0 && limbo != null) {
|
||||||
LimboCache.getInstance().getLimboPlayer(name).setTimeoutTaskId(id);
|
limbo.getTimeoutTaskId().cancel();
|
||||||
|
BukkitTask id = sched.runTaskLaterAsynchronously(plugin, new TimeoutTask(plugin, name, player), time);
|
||||||
|
limbo.setTimeoutTaskId(id);
|
||||||
|
}
|
||||||
|
if (limbo != null){
|
||||||
|
limbo.getMessageTaskId().cancel();
|
||||||
|
BukkitTask nwMsg = sched.runTaskAsynchronously(plugin, new MessageTask(plugin, name, m.send("login_msg"), msgInterval));
|
||||||
|
limbo.setMessageTaskId(nwMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
LimboCache.getInstance().getLimboPlayer(name).getMessageTaskId().cancel();
|
|
||||||
BukkitTask nwMsg = Bukkit.getScheduler().runTaskAsynchronously(plugin, new MessageTask(plugin, name, m.send("login_msg"), msgInterval));
|
|
||||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(nwMsg);
|
|
||||||
player.saveData();
|
player.saveData();
|
||||||
if (!Settings.noConsoleSpam)
|
if (!Settings.noConsoleSpam)
|
||||||
ConsoleLogger.info(player.getName() + " registered " + plugin.getIP(player));
|
ConsoleLogger.info(player.getName() + " registered " + plugin.getIP(player));
|
||||||
|
|||||||
@ -22,6 +22,9 @@ import fr.xephi.authme.security.HashAlgorithm;
|
|||||||
|
|
||||||
public final class Settings extends YamlConfiguration {
|
public final class Settings extends YamlConfiguration {
|
||||||
|
|
||||||
|
//This is not an option!
|
||||||
|
public static Boolean antiBotInAction = false;
|
||||||
|
|
||||||
public static String PLUGIN_FOLDER = "." + File.separator + "plugins" + File.separator + "AuthMe";
|
public static String PLUGIN_FOLDER = "." + File.separator + "plugins" + File.separator + "AuthMe";
|
||||||
public static final String CACHE_FOLDER = Settings.PLUGIN_FOLDER + File.separator + "cache";
|
public static final String CACHE_FOLDER = Settings.PLUGIN_FOLDER + File.separator + "cache";
|
||||||
public static final String AUTH_FILE = Settings.PLUGIN_FOLDER + File.separator + "auths.db";
|
public static final String AUTH_FILE = Settings.PLUGIN_FOLDER + File.separator + "auths.db";
|
||||||
@ -59,7 +62,7 @@ public final class Settings extends YamlConfiguration {
|
|||||||
isResetInventoryIfCreative, isCachingEnabled,
|
isResetInventoryIfCreative, isCachingEnabled,
|
||||||
isKickOnWrongPasswordEnabled, getEnablePasswordVerifier,
|
isKickOnWrongPasswordEnabled, getEnablePasswordVerifier,
|
||||||
protectInventoryBeforeLogInEnabled, isBackupActivated,
|
protectInventoryBeforeLogInEnabled, isBackupActivated,
|
||||||
isBackupOnStart, isBackupOnStop, enablePasspartu, isStopEnabled,
|
isBackupOnStart, isBackupOnStop, isStopEnabled,
|
||||||
reloadSupport, rakamakUseIp, noConsoleSpam, removePassword,
|
reloadSupport, rakamakUseIp, noConsoleSpam, removePassword,
|
||||||
displayOtherAccounts, useCaptcha, emailRegistration, multiverse,
|
displayOtherAccounts, useCaptcha, emailRegistration, multiverse,
|
||||||
chestshop, bungee, banUnsafeIp, doubleEmailCheck,
|
chestshop, bungee, banUnsafeIp, doubleEmailCheck,
|
||||||
@ -184,7 +187,6 @@ public final class Settings extends YamlConfiguration {
|
|||||||
isBackupOnStart = configFile.getBoolean("BackupSystem.OnServerStart", false);
|
isBackupOnStart = configFile.getBoolean("BackupSystem.OnServerStart", false);
|
||||||
isBackupOnStop = configFile.getBoolean("BackupSystem.OnServeStop", false);
|
isBackupOnStop = configFile.getBoolean("BackupSystem.OnServeStop", false);
|
||||||
backupWindowsPath = configFile.getString("BackupSystem.MysqlWindowsPath", "C:\\Program Files\\MySQL\\MySQL Server 5.1\\");
|
backupWindowsPath = configFile.getString("BackupSystem.MysqlWindowsPath", "C:\\Program Files\\MySQL\\MySQL Server 5.1\\");
|
||||||
enablePasspartu = configFile.getBoolean("Passpartu.enablePasspartu", false);
|
|
||||||
isStopEnabled = configFile.getBoolean("Security.SQLProblem.stopServer", true);
|
isStopEnabled = configFile.getBoolean("Security.SQLProblem.stopServer", true);
|
||||||
reloadSupport = configFile.getBoolean("Security.ReloadCommand.useReloadCommandSupport", true);
|
reloadSupport = configFile.getBoolean("Security.ReloadCommand.useReloadCommandSupport", true);
|
||||||
allowCommands = (List<String>) configFile.getList("settings.restrictions.allowCommands");
|
allowCommands = (List<String>) configFile.getList("settings.restrictions.allowCommands");
|
||||||
@ -197,8 +199,6 @@ public final class Settings extends YamlConfiguration {
|
|||||||
allowCommands.add("/l");
|
allowCommands.add("/l");
|
||||||
if (!allowCommands.contains("/reg"))
|
if (!allowCommands.contains("/reg"))
|
||||||
allowCommands.add("/reg");
|
allowCommands.add("/reg");
|
||||||
if (!allowCommands.contains("/passpartu"))
|
|
||||||
allowCommands.add("/passpartu");
|
|
||||||
if (!allowCommands.contains("/email"))
|
if (!allowCommands.contains("/email"))
|
||||||
allowCommands.add("/email");
|
allowCommands.add("/email");
|
||||||
if (!allowCommands.contains("/captcha"))
|
if (!allowCommands.contains("/captcha"))
|
||||||
@ -417,8 +417,16 @@ public final class Settings extends YamlConfiguration {
|
|||||||
}
|
}
|
||||||
if (contains("Performances.useMultiThreading"))
|
if (contains("Performances.useMultiThreading"))
|
||||||
set("Performances.useMultiThreading", null);
|
set("Performances.useMultiThreading", null);
|
||||||
|
|
||||||
if (contains("Performances"))
|
if (contains("Performances"))
|
||||||
set("Performances", null);
|
set("Performances", null);
|
||||||
|
|
||||||
|
if (contains("Passpartu.enablePasspartu"))
|
||||||
|
set("Passpartu.enablePasspartu", null);
|
||||||
|
|
||||||
|
if (contains("Passpartu"))
|
||||||
|
set("Passpartu", null);
|
||||||
|
|
||||||
if (!contains("Email.emailWhitelisted")) {
|
if (!contains("Email.emailWhitelisted")) {
|
||||||
set("Email.emailWhitelisted", new ArrayList<String>());
|
set("Email.emailWhitelisted", new ArrayList<String>());
|
||||||
changes = true;
|
changes = true;
|
||||||
@ -606,9 +614,13 @@ public final class Settings extends YamlConfiguration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void switchAntiBotMod(boolean mode) {
|
public static void switchAntiBotMod(boolean mode) {
|
||||||
if (mode)
|
if (mode){
|
||||||
isKickNonRegisteredEnabled = true;
|
isKickNonRegisteredEnabled = true;
|
||||||
else isKickNonRegisteredEnabled = configFile.getBoolean("settings.restrictions.kickNonRegistered", false);
|
antiBotInAction = true;
|
||||||
|
}else{
|
||||||
|
isKickNonRegisteredEnabled = configFile.getBoolean("settings.restrictions.kickNonRegistered", false);
|
||||||
|
antiBotInAction = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void getWelcomeMessage() {
|
private static void getWelcomeMessage() {
|
||||||
|
|||||||
@ -84,7 +84,6 @@ settings:
|
|||||||
- /register
|
- /register
|
||||||
- /l
|
- /l
|
||||||
- /reg
|
- /reg
|
||||||
- /passpartu
|
|
||||||
- /email
|
- /email
|
||||||
- /captcha
|
- /captcha
|
||||||
# Maximum Registration per IP default: 1
|
# Maximum Registration per IP default: 1
|
||||||
@ -305,13 +304,6 @@ BackupSystem:
|
|||||||
OnServerStop: true
|
OnServerStop: true
|
||||||
# Windows only mysql installation Path
|
# Windows only mysql installation Path
|
||||||
MysqlWindowsPath: 'C:\\Program Files\\MySQL\\MySQL Server 5.1\\'
|
MysqlWindowsPath: 'C:\\Program Files\\MySQL\\MySQL Server 5.1\\'
|
||||||
Passpartu:
|
|
||||||
# Enable or Disable Passpartu Feature,
|
|
||||||
# this feature let Admin Login with all registered
|
|
||||||
# Account they need, for example inspecting Player that
|
|
||||||
# is doing shit, they can login without know any
|
|
||||||
# Player password! More info on How TO
|
|
||||||
enablePasspartu: false
|
|
||||||
Security:
|
Security:
|
||||||
SQLProblem:
|
SQLProblem:
|
||||||
# Stop the server if we can't contact the sql database
|
# Stop the server if we can't contact the sql database
|
||||||
|
|||||||
@ -22,10 +22,7 @@ commands:
|
|||||||
usage: /logout
|
usage: /logout
|
||||||
unregister:
|
unregister:
|
||||||
description: unregister your account
|
description: unregister your account
|
||||||
usage: /unregister password
|
usage: /unregister password
|
||||||
passpartu:
|
|
||||||
description: compare passpartu token
|
|
||||||
usage: /passpartu token
|
|
||||||
authme:
|
authme:
|
||||||
description: AuthMe op commands
|
description: AuthMe op commands
|
||||||
usage: '/authme reload|register playername password|changepassword playername password|unregister playername|version'
|
usage: '/authme reload|register playername password|changepassword playername password|unregister playername|version'
|
||||||
@ -48,7 +45,6 @@ permissions:
|
|||||||
authme.changepassword: true
|
authme.changepassword: true
|
||||||
authme.logout: true
|
authme.logout: true
|
||||||
authme.unregister: true
|
authme.unregister: true
|
||||||
authme.passpartu: true
|
|
||||||
authme.l: true
|
authme.l: true
|
||||||
authme.reg: true
|
authme.reg: true
|
||||||
authme.email: true
|
authme.email: true
|
||||||
@ -87,9 +83,6 @@ permissions:
|
|||||||
authme.email:
|
authme.email:
|
||||||
description: Email
|
description: Email
|
||||||
default: true
|
default: true
|
||||||
authme.passpartu:
|
|
||||||
description: passpartu
|
|
||||||
default: true
|
|
||||||
authme.allow2accounts:
|
authme.allow2accounts:
|
||||||
description: allow more accounts for same ip
|
description: allow more accounts for same ip
|
||||||
default: false
|
default: false
|
||||||
|
|||||||
9
team.txt
9
team.txt
@ -2,9 +2,10 @@ AuthMe-Team:
|
|||||||
|
|
||||||
Xephi (Xephi59) - Leader, Main developer
|
Xephi (Xephi59) - Leader, Main developer
|
||||||
darkwarriors (d4rkwarriors) - Old AuthMe Reloaded Author
|
darkwarriors (d4rkwarriors) - Old AuthMe Reloaded Author
|
||||||
|
Kloudy - Main developer
|
||||||
Gabriele C. (sgdc3) - Ticket Manager, Project Page and Structure Manager, Contributor
|
Gabriele C. (sgdc3) - Ticket Manager, Project Page and Structure Manager, Contributor
|
||||||
Maxetto (maxetto) - Ticket Manager, Italian Translator, Basic Developer
|
Maxetto - Ticket Manager, Italian Translator, Basic Developer, Contributor
|
||||||
Trojaner25 (Trojaner25) - Ticket manager, Basic Developer
|
Trojaner25 - Ticket manager, Basic Developer
|
||||||
irobin591 (irobin591) - DE Translator
|
irobin591 - DE Translator
|
||||||
WaterCXubic (WaterXCubic) - ZHHK Translator
|
WaterCXubic - ZHHK Translator
|
||||||
Bodyash - Russian/Ukrainian translator
|
Bodyash - Russian/Ukrainian translator
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user