mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-24 11:15:19 +01:00
commit
a05ca52d66
@ -17,9 +17,6 @@ sessionLogin:
|
||||
sessionExpireOnIpChange: true
|
||||
|
||||
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!
|
||||
forceSingleSession: true
|
||||
# Should we display all other accounts from a player when he joins?
|
||||
|
@ -1,7 +1,6 @@
|
||||
# Database AuthMeReloaded configuration file
|
||||
|
||||
# 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
|
||||
# Do you like to cache all the queries? (Performance Boost)
|
||||
caching: true
|
||||
@ -12,6 +11,7 @@ databaseName: authme
|
||||
tableName: authme
|
||||
|
||||
# MySql Database connection settings
|
||||
# Avariable only if the AuthMeReloaded-Mysql module is installed!
|
||||
mysql:
|
||||
port: '3306'
|
||||
host: 127.0.0.1
|
||||
@ -19,6 +19,7 @@ mysql:
|
||||
password: '12345'
|
||||
|
||||
# Redis Database connection settings
|
||||
# Avariable only if the AuthMeReloaded-Redis module is installed!
|
||||
redis:
|
||||
# Get Redis from http://redis.io/
|
||||
host: 127.0.0.1
|
||||
|
@ -67,8 +67,6 @@ password:
|
||||
# When it's true, registration require that kind of command:
|
||||
# /register <password> <confirmPassword>
|
||||
doublePasswordCheck: true
|
||||
# Should players can use their usernames as passwords?
|
||||
allowNameAsPassword: false
|
||||
# Deny unsafe passwords for being used, put them on lowercase!
|
||||
unsafePasswords:
|
||||
- '123456'
|
||||
|
@ -1,5 +1,4 @@
|
||||
<hr>
|
||||
<p align="center"><img src="http://i61.tinypic.com/fnfchs.png"></p>
|
||||
<p align="center"><img src="http://i61.tinypic.com/291dm49.png"></p>
|
||||
<p align="center"><strong>The most used authentication plugin for CraftBukkit/Spigot!</strong></p>
|
||||
<hr>
|
||||
#####Development tools:
|
||||
@ -14,7 +13,7 @@
|
||||
|
||||
- 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:
|
||||
|
||||
@ -39,7 +38,7 @@ McStats: http://mcstats.org/plugin/AuthMe
|
||||
|
||||
#####Running Requirements:
|
||||
>- Java 1.7 (should work also with Java 1.8)
|
||||
>- Spigot or CraftBukkit
|
||||
>- Spigot or CraftBukkit (1.7.10 or 1.8.X)
|
||||
|
||||
<hr>
|
||||
###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>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><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>Session Login!</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>
|
||||
|
||||
<!-- Change MC Version HERE! -->
|
||||
<bukkitVersion>1.8.7-R0.1-SNAPSHOT</bukkitVersion>
|
||||
<bukkitVersion>1.8.8-R0.1-SNAPSHOT</bukkitVersion>
|
||||
</properties>
|
||||
|
||||
<!-- Official Build Server -->
|
||||
@ -178,6 +178,7 @@
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>5.1.36</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- SQLite Library -->
|
||||
@ -185,6 +186,7 @@
|
||||
<groupId>org.xerial</groupId>
|
||||
<artifactId>sqlite-jdbc</artifactId>
|
||||
<version>3.8.10.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Java Email API -->
|
||||
@ -192,13 +194,16 @@
|
||||
<groupId>com.sun.mail</groupId>
|
||||
<artifactId>javax.mail</artifactId>
|
||||
<version>1.5.4</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Maxmind GeoIp API -->
|
||||
<dependency>
|
||||
<groupId>com.maxmind.geoip</groupId>
|
||||
<artifactId>geoip-api</artifactId>
|
||||
<version>1.2.14</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@ -224,6 +229,7 @@
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>${bukkitVersion}</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>bungeecord-chat</artifactId>
|
||||
@ -237,6 +243,7 @@
|
||||
<groupId>com.comphenix.attribute</groupId>
|
||||
<artifactId>AttributeStorage</artifactId>
|
||||
<version>0.0.2-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.bukkit</groupId>
|
||||
@ -272,6 +279,7 @@
|
||||
<groupId>net.citizensnpcs</groupId>
|
||||
<artifactId>citizensapi</artifactId>
|
||||
<version>2.0.16-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.bukkit</groupId>
|
||||
@ -290,7 +298,7 @@
|
||||
<artifactId>Multiverse-Core</artifactId>
|
||||
<version>2.5</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.bukkit</groupId>
|
||||
@ -320,6 +328,7 @@
|
||||
<groupId>net.ess3</groupId>
|
||||
<artifactId>Essentials</artifactId>
|
||||
<version>2.14-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.bukkit</groupId>
|
||||
@ -337,6 +346,7 @@
|
||||
<groupId>net.minelink</groupId>
|
||||
<artifactId>CombatTagPlus</artifactId>
|
||||
<version>1.2.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.bukkit</groupId>
|
||||
@ -410,6 +420,7 @@
|
||||
<groupId>com.trc202</groupId>
|
||||
<artifactId>CombatTag</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.bukkit</groupId>
|
||||
@ -427,6 +438,7 @@
|
||||
<groupId>de.luricos.bukkit</groupId>
|
||||
<artifactId>xAuth</artifactId>
|
||||
<version>2.6</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.bukkit</groupId>
|
||||
@ -464,6 +476,7 @@
|
||||
<groupId>com.acrobot.chestshop</groupId>
|
||||
<artifactId>chestshop</artifactId>
|
||||
<version>3.8.12</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<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.LoginCommand;
|
||||
import fr.xephi.authme.commands.LogoutCommand;
|
||||
import fr.xephi.authme.commands.PasspartuCommand;
|
||||
import fr.xephi.authme.commands.RegisterCommand;
|
||||
import fr.xephi.authme.commands.UnregisterCommand;
|
||||
import fr.xephi.authme.converter.Converter;
|
||||
@ -243,7 +242,6 @@ public class AuthMe extends JavaPlugin {
|
||||
this.getCommand("changepassword").setExecutor(new ChangePasswordCommand(this));
|
||||
this.getCommand("logout").setExecutor(new LogoutCommand(this));
|
||||
this.getCommand("unregister").setExecutor(new UnregisterCommand(this));
|
||||
this.getCommand("passpartu").setExecutor(new PasspartuCommand(this));
|
||||
this.getCommand("email").setExecutor(new EmailCommand(this));
|
||||
this.getCommand("captcha").setExecutor(new CaptchaCommand(this));
|
||||
this.getCommand("converter").setExecutor(new ConverterCommand(this));
|
||||
@ -252,7 +250,11 @@ public class AuthMe extends JavaPlugin {
|
||||
ConsoleLogger.showError("WARNING!!! By disabling ForceSingleSession, your server protection is inadequate!");
|
||||
}
|
||||
|
||||
if (Settings.reloadSupport)
|
||||
if (Settings.getSessionTimeout == 0 && Settings.isSessionsEnabled) {
|
||||
ConsoleLogger.showError("WARNING!!! You set session timeout to 0, this may cause security issues!");
|
||||
}
|
||||
|
||||
if (Settings.reloadSupport) {
|
||||
try {
|
||||
int playersOnline = 0;
|
||||
try {
|
||||
@ -277,8 +279,8 @@ public class AuthMe extends JavaPlugin {
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
}
|
||||
|
||||
if (Settings.usePurge)
|
||||
autoPurge();
|
||||
|
||||
// Download GeoIp.dat file
|
||||
@ -543,13 +545,13 @@ public class AuthMe extends JavaPlugin {
|
||||
return;
|
||||
ConsoleLogger.info("AutoPurging the Database: " + cleared.size() + " accounts removed!");
|
||||
if (Settings.purgeEssentialsFile && this.ess != null)
|
||||
dataManager.purgeEssentials(cleared);
|
||||
dataManager.purgeEssentials(cleared); // name to UUID convertion needed with latest versions
|
||||
if (Settings.purgePlayerDat)
|
||||
dataManager.purgeDat(cleared);
|
||||
dataManager.purgeDat(cleared); // name to UUID convertion needed with latest versions of MC
|
||||
if (Settings.purgeLimitedCreative)
|
||||
dataManager.purgeLimitedCreative(cleared);
|
||||
if (Settings.purgeAntiXray)
|
||||
dataManager.purgeAntiXray(cleared);
|
||||
dataManager.purgeAntiXray(cleared); // IDK if it uses UUID or names... (Actually it purges only names!)
|
||||
if (Settings.purgePermissions)
|
||||
dataManager.purgePermissions(cleared, permission);
|
||||
}
|
||||
|
@ -109,6 +109,12 @@ public class DataManager {
|
||||
if (playerFile.exists()) {
|
||||
playerFile.delete();
|
||||
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) {
|
||||
}
|
||||
@ -116,6 +122,7 @@ public class DataManager {
|
||||
ConsoleLogger.info("AutoPurgeDatabase : Remove " + i + " .dat Files");
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public void purgeEssentials(List<String> cleared) {
|
||||
int i = 0;
|
||||
for (String name : cleared) {
|
||||
@ -124,6 +131,12 @@ public class DataManager {
|
||||
if (playerFile.exists()) {
|
||||
playerFile.delete();
|
||||
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) {
|
||||
}
|
||||
|
@ -82,6 +82,7 @@ public class SendMailSSL {
|
||||
// Generate an image ?
|
||||
File file = null;
|
||||
if (Settings.generateImage) {
|
||||
try {
|
||||
ImageGenerator gen = new ImageGenerator(newPass);
|
||||
file = new File(plugin.getDataFolder() + File.separator + auth.getNickname() + "_new_pass.jpg");
|
||||
ImageIO.write(gen.generateImage(), "jpg", file);
|
||||
@ -90,17 +91,31 @@ public class SendMailSSL {
|
||||
messageBodyPart.setDataHandler(new DataHandler(source));
|
||||
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");
|
||||
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());
|
||||
|
||||
if (file != null)
|
||||
file.delete();
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
ConsoleLogger.showError("Some error occured while trying to send a email to " + mail);
|
||||
} 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;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
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.LimboPlayer;
|
||||
import fr.xephi.authme.events.AuthMeTeleportEvent;
|
||||
import fr.xephi.authme.security.RandomString;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
|
||||
public class Utils {
|
||||
@ -22,7 +20,6 @@ public class Utils {
|
||||
private static Utils singleton;
|
||||
int id;
|
||||
public AuthMe plugin;
|
||||
private static List<String> tokens = new ArrayList<String>();
|
||||
|
||||
public Utils(AuthMe 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
|
||||
*/
|
||||
@ -209,4 +172,18 @@ public class Utils {
|
||||
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.api.API;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.Utils;
|
||||
|
||||
public class FileCache {
|
||||
|
||||
@ -44,9 +45,9 @@ public class FileCache {
|
||||
try {
|
||||
path = player.getUniqueId().toString();
|
||||
} catch (Exception e) {
|
||||
path = player.getName();
|
||||
path = player.getName().toLowerCase();
|
||||
} 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");
|
||||
|
||||
@ -197,9 +198,9 @@ public class FileCache {
|
||||
try {
|
||||
path = player.getUniqueId().toString();
|
||||
} catch (Exception e) {
|
||||
path = player.getName();
|
||||
path = player.getName().toLowerCase();
|
||||
} catch (Error e) {
|
||||
path = player.getName();
|
||||
path = player.getName().toLowerCase();
|
||||
}
|
||||
try {
|
||||
File file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path + File.separator + "playerdatas.cache");
|
||||
@ -536,30 +537,25 @@ public class FileCache {
|
||||
try {
|
||||
path = player.getUniqueId().toString();
|
||||
} catch (Exception e) {
|
||||
path = player.getName();
|
||||
path = player.getName().toLowerCase();
|
||||
} catch (Error e) {
|
||||
path = player.getName();
|
||||
path = player.getName().toLowerCase();
|
||||
}
|
||||
try {
|
||||
File file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + path);
|
||||
if (!file.exists()) {
|
||||
file = new File("cache/" + player.getName().toLowerCase() + ".cache");
|
||||
}
|
||||
if (file.exists()) {
|
||||
if (file.isDirectory() && file.listFiles() != null) {
|
||||
for (File f : file.listFiles()) {
|
||||
if (f.isDirectory() && f.listFiles() != null) {
|
||||
for (File a : f.listFiles()) {
|
||||
a.delete();
|
||||
}
|
||||
f.delete();
|
||||
} else f.delete();
|
||||
}
|
||||
if (file.list() != null) {
|
||||
Utils.purgeDirectory(file);
|
||||
file.delete();
|
||||
} else file.delete();
|
||||
} else {
|
||||
file = new File(plugin.getDataFolder() + File.separator + "cache" + File.separator + player.getName().toLowerCase() + ".cache");
|
||||
if(file.isFile()){
|
||||
file.delete();
|
||||
} else {
|
||||
ConsoleLogger.showError("Failed to remove" + player.getName() + "cache, it doesn't exist!");
|
||||
}
|
||||
}
|
||||
} 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 {
|
||||
path = player.getUniqueId().toString();
|
||||
} catch (Exception e) {
|
||||
path = player.getName();
|
||||
path = player.getName().toLowerCase();
|
||||
} 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");
|
||||
if (!file.exists()) {
|
||||
|
@ -15,7 +15,6 @@ import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
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 switchantibot on/off - Enable/Disable AntiBot feature");
|
||||
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;
|
||||
}
|
||||
|
||||
@ -80,19 +78,6 @@ public class AdminCommand implements CommandExecutor {
|
||||
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")) {
|
||||
sender.sendMessage("AuthMe Version: " + AuthMe.getInstance().getDescription().getVersion());
|
||||
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;
|
||||
|
||||
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;
|
||||
if (Settings.useEssentialsMotd && cmd.equalsIgnoreCase("/motd"))
|
||||
return;
|
||||
@ -411,7 +411,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
if (event.getResult() != PlayerLoginEvent.Result.ALLOWED)
|
||||
return;
|
||||
|
||||
if (Settings.enablePasspartu && !Settings.countriesBlacklist.isEmpty()) {
|
||||
if (!Settings.countriesBlacklist.isEmpty()) {
|
||||
String code = plugin.getCountryCode(event.getAddress().getHostAddress());
|
||||
if (((code == null) || (Settings.countriesBlacklist.contains(code) && !isAuthAvailable)) && !plugin.authmePermissible(player, "authme.bypassantibot")) {
|
||||
event.setKickMessage(m.send("country_banned")[0]);
|
||||
@ -428,7 +428,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
if (Settings.isKickNonRegisteredEnabled) {
|
||||
if (Settings.isKickNonRegisteredEnabled && !Settings.antiBotInAction){
|
||||
if (!plugin.database.isAuthAvailable(name)) {
|
||||
event.setKickMessage(m.send("reg_only")[0]);
|
||||
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
|
||||
@ -436,6 +436,14 @@ public class AuthMePlayerListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
// joined with same nick of online player
|
||||
if (player.isOnline() && Settings.isForceSingleSessionEnabled) {
|
||||
|
@ -13,6 +13,7 @@ public interface Module {
|
||||
public enum ModuleType {
|
||||
MANAGER,
|
||||
MYSQL,
|
||||
REDIS,
|
||||
ACTIONS,
|
||||
CONVERTERS,
|
||||
EMAILS,
|
||||
|
@ -141,7 +141,7 @@ public class AsyncronousJoin {
|
||||
SpawnTeleportEvent tpEvent = new SpawnTeleportEvent(player, player.getLocation(), spawnLoc, PlayerCache.getInstance().isAuthenticated(name));
|
||||
plugin.getServer().getPluginManager().callEvent(tpEvent);
|
||||
if (!tpEvent.isCancelled()) {
|
||||
if (player != null && player.isOnline() && tpEvent.getTo() != null) {
|
||||
if (player.isOnline() && tpEvent.getTo() != null) {
|
||||
if (tpEvent.getTo().getWorld() != null)
|
||||
player.teleport(tpEvent.getTo());
|
||||
}
|
||||
@ -185,7 +185,7 @@ public class AsyncronousJoin {
|
||||
SpawnTeleportEvent tpEvent = new SpawnTeleportEvent(player, player.getLocation(), spawnLoc, PlayerCache.getInstance().isAuthenticated(name));
|
||||
plugin.getServer().getPluginManager().callEvent(tpEvent);
|
||||
if (!tpEvent.isCancelled()) {
|
||||
if (player != null && player.isOnline() && tpEvent.getTo() != null) {
|
||||
if (player.isOnline() && tpEvent.getTo() != null) {
|
||||
if (tpEvent.getTo().getWorld() != null)
|
||||
player.teleport(tpEvent.getTo());
|
||||
}
|
||||
@ -291,7 +291,7 @@ public class AsyncronousJoin {
|
||||
FirstSpawnTeleportEvent tpEvent = new FirstSpawnTeleportEvent(player, player.getLocation(), loc);
|
||||
plugin.getServer().getPluginManager().callEvent(tpEvent);
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
@ -78,6 +78,7 @@ public class AsyncronousQuit {
|
||||
LimboCache.getInstance().deleteLimboPlayer(name);
|
||||
}
|
||||
if (Settings.isSessionsEnabled && !isKick) {
|
||||
if (Settings.getSessionTimeout != 0){
|
||||
BukkitTask task = plugin.getServer().getScheduler().runTaskLaterAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
@ -90,6 +91,7 @@ public class AsyncronousQuit {
|
||||
|
||||
}, Settings.getSessionTimeout * 20 * 60);
|
||||
plugin.sessions.put(name, task);
|
||||
}
|
||||
} else {
|
||||
PlayerCache.getInstance().removePlayer(name);
|
||||
database.setUnlogged(name);
|
||||
|
@ -1,13 +1,14 @@
|
||||
package fr.xephi.authme.process.register;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitScheduler;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.Utils;
|
||||
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.Settings;
|
||||
import fr.xephi.authme.task.MessageTask;
|
||||
@ -28,21 +29,26 @@ public class ProcessSyncronousEmailRegister implements Runnable {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
LimboPlayer limbo = LimboCache.getInstance().getLimboPlayer(name);
|
||||
if (!Settings.getRegisteredGroup.isEmpty()) {
|
||||
Utils.getInstance().setGroup(player, Utils.groupType.REGISTERED);
|
||||
}
|
||||
m.send(player, "vb_nonActiv");
|
||||
int time = Settings.getRegistrationTimeout * 20;
|
||||
int msgInterval = Settings.getWarnMessageInterval;
|
||||
if (time != 0) {
|
||||
LimboCache.getInstance().getLimboPlayer(name).getTimeoutTaskId().cancel();
|
||||
BukkitTask id = Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, new TimeoutTask(plugin, name, player), time);
|
||||
LimboCache.getInstance().getLimboPlayer(name).setTimeoutTaskId(id);
|
||||
|
||||
BukkitScheduler sched = plugin.getServer().getScheduler();
|
||||
if (time != 0 && limbo != null) {
|
||||
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();
|
||||
if (!Settings.noConsoleSpam)
|
||||
ConsoleLogger.info(player.getName() + " registered " + plugin.getIP(player));
|
||||
|
@ -22,6 +22,9 @@ import fr.xephi.authme.security.HashAlgorithm;
|
||||
|
||||
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 final String CACHE_FOLDER = Settings.PLUGIN_FOLDER + File.separator + "cache";
|
||||
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,
|
||||
isKickOnWrongPasswordEnabled, getEnablePasswordVerifier,
|
||||
protectInventoryBeforeLogInEnabled, isBackupActivated,
|
||||
isBackupOnStart, isBackupOnStop, enablePasspartu, isStopEnabled,
|
||||
isBackupOnStart, isBackupOnStop, isStopEnabled,
|
||||
reloadSupport, rakamakUseIp, noConsoleSpam, removePassword,
|
||||
displayOtherAccounts, useCaptcha, emailRegistration, multiverse,
|
||||
chestshop, bungee, banUnsafeIp, doubleEmailCheck,
|
||||
@ -184,7 +187,6 @@ public final class Settings extends YamlConfiguration {
|
||||
isBackupOnStart = configFile.getBoolean("BackupSystem.OnServerStart", false);
|
||||
isBackupOnStop = configFile.getBoolean("BackupSystem.OnServeStop", false);
|
||||
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);
|
||||
reloadSupport = configFile.getBoolean("Security.ReloadCommand.useReloadCommandSupport", true);
|
||||
allowCommands = (List<String>) configFile.getList("settings.restrictions.allowCommands");
|
||||
@ -197,8 +199,6 @@ public final class Settings extends YamlConfiguration {
|
||||
allowCommands.add("/l");
|
||||
if (!allowCommands.contains("/reg"))
|
||||
allowCommands.add("/reg");
|
||||
if (!allowCommands.contains("/passpartu"))
|
||||
allowCommands.add("/passpartu");
|
||||
if (!allowCommands.contains("/email"))
|
||||
allowCommands.add("/email");
|
||||
if (!allowCommands.contains("/captcha"))
|
||||
@ -417,8 +417,16 @@ public final class Settings extends YamlConfiguration {
|
||||
}
|
||||
if (contains("Performances.useMultiThreading"))
|
||||
set("Performances.useMultiThreading", null);
|
||||
|
||||
if (contains("Performances"))
|
||||
set("Performances", null);
|
||||
|
||||
if (contains("Passpartu.enablePasspartu"))
|
||||
set("Passpartu.enablePasspartu", null);
|
||||
|
||||
if (contains("Passpartu"))
|
||||
set("Passpartu", null);
|
||||
|
||||
if (!contains("Email.emailWhitelisted")) {
|
||||
set("Email.emailWhitelisted", new ArrayList<String>());
|
||||
changes = true;
|
||||
@ -606,9 +614,13 @@ public final class Settings extends YamlConfiguration {
|
||||
}
|
||||
|
||||
public static void switchAntiBotMod(boolean mode) {
|
||||
if (mode)
|
||||
if (mode){
|
||||
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() {
|
||||
|
@ -84,7 +84,6 @@ settings:
|
||||
- /register
|
||||
- /l
|
||||
- /reg
|
||||
- /passpartu
|
||||
- /email
|
||||
- /captcha
|
||||
# Maximum Registration per IP default: 1
|
||||
@ -305,13 +304,6 @@ BackupSystem:
|
||||
OnServerStop: true
|
||||
# Windows only mysql installation Path
|
||||
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:
|
||||
SQLProblem:
|
||||
# Stop the server if we can't contact the sql database
|
||||
|
@ -23,9 +23,6 @@ commands:
|
||||
unregister:
|
||||
description: unregister your account
|
||||
usage: /unregister password
|
||||
passpartu:
|
||||
description: compare passpartu token
|
||||
usage: /passpartu token
|
||||
authme:
|
||||
description: AuthMe op commands
|
||||
usage: '/authme reload|register playername password|changepassword playername password|unregister playername|version'
|
||||
@ -48,7 +45,6 @@ permissions:
|
||||
authme.changepassword: true
|
||||
authme.logout: true
|
||||
authme.unregister: true
|
||||
authme.passpartu: true
|
||||
authme.l: true
|
||||
authme.reg: true
|
||||
authme.email: true
|
||||
@ -87,9 +83,6 @@ permissions:
|
||||
authme.email:
|
||||
description: Email
|
||||
default: true
|
||||
authme.passpartu:
|
||||
description: passpartu
|
||||
default: true
|
||||
authme.allow2accounts:
|
||||
description: allow more accounts for same ip
|
||||
default: false
|
||||
|
9
team.txt
9
team.txt
@ -2,9 +2,10 @@ AuthMe-Team:
|
||||
|
||||
Xephi (Xephi59) - Leader, Main developer
|
||||
darkwarriors (d4rkwarriors) - Old AuthMe Reloaded Author
|
||||
Kloudy - Main developer
|
||||
Gabriele C. (sgdc3) - Ticket Manager, Project Page and Structure Manager, Contributor
|
||||
Maxetto (maxetto) - Ticket Manager, Italian Translator, Basic Developer
|
||||
Trojaner25 (Trojaner25) - Ticket manager, Basic Developer
|
||||
irobin591 (irobin591) - DE Translator
|
||||
WaterCXubic (WaterXCubic) - ZHHK Translator
|
||||
Maxetto - Ticket Manager, Italian Translator, Basic Developer, Contributor
|
||||
Trojaner25 - Ticket manager, Basic Developer
|
||||
irobin591 - DE Translator
|
||||
WaterCXubic - ZHHK Translator
|
||||
Bodyash - Russian/Ukrainian translator
|
||||
|
Loading…
Reference in New Issue
Block a user