Update 3.3 + fix permission error

This commit is contained in:
Xephi 2014-01-27 20:33:34 +01:00
parent 90ae238c15
commit 2e5da58aca
36 changed files with 616 additions and 314 deletions

View File

@ -24,12 +24,12 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<version>3.2.1-DEV-2</version> <version>3.3.1-DEV-1</version>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId> <artifactId>craftbukkit</artifactId>
<version>1.7.2-R0.2</version> <version>1.7.2-R0.3-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.milkbowl.vault</groupId> <groupId>net.milkbowl.vault</groupId>

View File

@ -15,26 +15,22 @@ import java.util.Random;
import java.util.logging.Logger; import java.util.logging.Logger;
import java.util.zip.GZIPInputStream; import java.util.zip.GZIPInputStream;
import com.earth2me.essentials.Essentials;
import org.apache.logging.log4j.LogManager;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;
import me.muizers.Notifications.Notifications; import me.muizers.Notifications.Notifications;
import net.citizensnpcs.Citizens; import net.citizensnpcs.Citizens;
import net.milkbowl.vault.permission.Permission; import net.milkbowl.vault.permission.Permission;
import org.apache.logging.log4j.LogManager;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;
import com.earth2me.essentials.Essentials;
import com.maxmind.geoip.LookupService; import com.maxmind.geoip.LookupService;
import com.onarandombox.MultiverseCore.MultiverseCore; import com.onarandombox.MultiverseCore.MultiverseCore;
@ -63,6 +59,7 @@ import fr.xephi.authme.listener.AuthMeBungeeCordListener;
import fr.xephi.authme.listener.AuthMeChestShopListener; import fr.xephi.authme.listener.AuthMeChestShopListener;
import fr.xephi.authme.listener.AuthMeEntityListener; import fr.xephi.authme.listener.AuthMeEntityListener;
import fr.xephi.authme.listener.AuthMePlayerListener; import fr.xephi.authme.listener.AuthMePlayerListener;
import fr.xephi.authme.listener.AuthMeServerListener;
import fr.xephi.authme.listener.AuthMeSpoutListener; import fr.xephi.authme.listener.AuthMeSpoutListener;
import fr.xephi.authme.plugin.manager.BungeeCordMessage; import fr.xephi.authme.plugin.manager.BungeeCordMessage;
import fr.xephi.authme.plugin.manager.CitizensCommunicator; import fr.xephi.authme.plugin.manager.CitizensCommunicator;
@ -85,8 +82,8 @@ public class AuthMe extends JavaPlugin {
private PlayersLogs pllog; private PlayersLogs pllog;
public static Server server; public static Server server;
public static Logger authmeLogger = Logger.getLogger("AuthMe"); public static Logger authmeLogger = Logger.getLogger("AuthMe");
public static Plugin authme; public static AuthMe authme;
public static Permission permission; public Permission permission;
private static AuthMe instance; private static AuthMe instance;
private Utils utils = Utils.getInstance(); private Utils utils = Utils.getInstance();
private JavaPlugin plugin; private JavaPlugin plugin;
@ -149,10 +146,15 @@ public class AuthMe extends JavaPlugin {
Bukkit.getLogger().setFilter(new ConsoleFilter()); Bukkit.getLogger().setFilter(new ConsoleFilter());
Logger.getLogger("Minecraft").setFilter(new ConsoleFilter()); Logger.getLogger("Minecraft").setFilter(new ConsoleFilter());
authmeLogger.setFilter(new ConsoleFilter()); authmeLogger.setFilter(new ConsoleFilter());
// Set Log4J Filter // Set Log4J Filter
org.apache.logging.log4j.core.Logger coreLogger = (org.apache.logging.log4j.core.Logger) LogManager.getRootLogger(); try {
coreLogger.addFilter(new Log4JFilter()); Class.forName("org.apache.logging.log4j.core.Filter");
setLog4JFilter();
} catch (ClassNotFoundException e) {
ConsoleLogger.info("You're using Minecraft 1.6.x or older, Log4J support is disabled");
} catch (NoClassDefFoundError e) {
ConsoleLogger.info("You're using Minecraft 1.6.x or older, Log4J support is disabled");
}
} }
//Load MailApi //Load MailApi
@ -271,11 +273,12 @@ public class AuthMe extends JavaPlugin {
Bukkit.getMessenger().registerOutgoingPluginChannel(this, "BungeeCord"); Bukkit.getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
Bukkit.getMessenger().registerIncomingPluginChannel(this, "BungeeCord", new BungeeCordMessage(this)); Bukkit.getMessenger().registerIncomingPluginChannel(this, "BungeeCord", new BungeeCordMessage(this));
try { try {
if (Class.forName("net.md_5.bungee.api.event.ChatEvent") != null) if (Class.forName("net.md_5.bungee.api.event.ChatEvent") != null) {
pm.registerEvents(new AuthMeBungeeCordListener(database, this), this); pm.registerEvents(new AuthMeBungeeCordListener(database, this), this);
ConsoleLogger.info("Successfully hook with BungeeCord!");
}
} catch (ClassNotFoundException e) { } catch (ClassNotFoundException e) {
} }
ConsoleLogger.info("Successfully hook with BungeeCord!");
} }
if (pm.isPluginEnabled("Spout")) { if (pm.isPluginEnabled("Spout")) {
pm.registerEvents(new AuthMeSpoutListener(database), this); pm.registerEvents(new AuthMeSpoutListener(database), this);
@ -284,23 +287,14 @@ public class AuthMe extends JavaPlugin {
pm.registerEvents(new AuthMePlayerListener(this,database),this); pm.registerEvents(new AuthMePlayerListener(this,database),this);
pm.registerEvents(new AuthMeBlockListener(database, this),this); pm.registerEvents(new AuthMeBlockListener(database, this),this);
pm.registerEvents(new AuthMeEntityListener(database, this),this); pm.registerEvents(new AuthMeEntityListener(database, this),this);
pm.registerEvents(new AuthMeServerListener(this), this);
if (ChestShop != 0) { if (ChestShop != 0) {
pm.registerEvents(new AuthMeChestShopListener(database, this), this); pm.registerEvents(new AuthMeChestShopListener(database, this), this);
ConsoleLogger.info("Successfully hook with ChestShop!"); ConsoleLogger.info("Successfully hook with ChestShop!");
} }
//Find Permissions //Find Permissions
if (pm.getPlugin("Vault") != null) { checkVault();
RegisteredServiceProvider<Permission> permissionProvider =
getServer().getServicesManager().getRegistration(net.milkbowl.vault.permission.Permission.class);
if (permissionProvider != null) {
permission = permissionProvider.getProvider();
ConsoleLogger.info("Vault plugin detected, hook with " + permission.getName() + " system");
}
else {
ConsoleLogger.showError("Vault plugin is detected but not the permissions plugin!");
}
}
this.getCommand("authme").setExecutor(new AdminCommand(this, database)); this.getCommand("authme").setExecutor(new AdminCommand(this, database));
this.getCommand("register").setExecutor(new RegisterCommand(database, this)); this.getCommand("register").setExecutor(new RegisterCommand(database, this));
@ -331,23 +325,51 @@ public class AuthMe extends JavaPlugin {
} }
} catch (NullPointerException ex) { } catch (NullPointerException ex) {
} }
if (Settings.enableProtection)
enableProtection();
if (Settings.usePurge) if (Settings.usePurge)
autoPurge(); autoPurge();
// Download GeoIp.dat file
downloadGeoIp();
// Start Email recall task if needed // Start Email recall task if needed
recallEmail(); recallEmail();
ConsoleLogger.info("Authme " + this.getDescription().getVersion() + " enabled"); ConsoleLogger.info("Authme " + this.getDescription().getVersion() + " enabled");
} }
private void checkChestShop() { private void setLog4JFilter() {
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
@Override
public void run() {
org.apache.logging.log4j.core.Logger coreLogger = (org.apache.logging.log4j.core.Logger) LogManager.getRootLogger();
coreLogger.addFilter(new Log4JFilter());
}
});
}
public void checkVault() {
if (this.getServer().getPluginManager().getPlugin("Vault") != null && this.getServer().getPluginManager().getPlugin("Vault").isEnabled()) {
RegisteredServiceProvider<Permission> permissionProvider =
getServer().getServicesManager().getRegistration(net.milkbowl.vault.permission.Permission.class);
if (permissionProvider != null) {
permission = permissionProvider.getProvider();
ConsoleLogger.info("Vault plugin detected, hook with " + permission.getName() + " system");
}
else {
ConsoleLogger.showError("Vault plugin is detected but not the permissions plugin!");
}
} else {
permission = null;
}
}
public void checkChestShop() {
if (!Settings.chestshop) { if (!Settings.chestshop) {
this.ChestShop = 0; this.ChestShop = 0;
return; return;
} }
if (this.getServer().getPluginManager().isPluginEnabled("ChestShop")) { if (this.getServer().getPluginManager().getPlugin("ChestShop") != null && this.getServer().getPluginManager().getPlugin("ChestShop").isEnabled()) {
try { try {
String ver = com.Acrobot.ChestShop.ChestShop.getVersion(); String ver = com.Acrobot.ChestShop.ChestShop.getVersion();
try { try {
@ -369,10 +391,12 @@ public class AuthMe extends JavaPlugin {
} }
} }
} catch (Exception e) {} } catch (Exception e) {}
} else {
this.ChestShop = 0;
} }
} }
private void checkMultiverse() { public void checkMultiverse() {
if(!Settings.multiverse) { if(!Settings.multiverse) {
multiverse = null; multiverse = null;
return; return;
@ -388,10 +412,12 @@ public class AuthMe extends JavaPlugin {
} catch (NoClassDefFoundError ncdfe) { } catch (NoClassDefFoundError ncdfe) {
multiverse = null; multiverse = null;
} }
} else {
multiverse = null;
} }
} }
private void checkEssentials() { public void checkEssentials() {
if (this.getServer().getPluginManager().getPlugin("Essentials") != null && this.getServer().getPluginManager().getPlugin("Essentials").isEnabled()) { if (this.getServer().getPluginManager().getPlugin("Essentials") != null && this.getServer().getPluginManager().getPlugin("Essentials").isEnabled()) {
try { try {
ess = (Essentials) this.getServer().getPluginManager().getPlugin("Essentials"); ess = (Essentials) this.getServer().getPluginManager().getPlugin("Essentials");
@ -403,14 +429,18 @@ public class AuthMe extends JavaPlugin {
} catch (NoClassDefFoundError ncdfe) { } catch (NoClassDefFoundError ncdfe) {
ess = null; ess = null;
} }
} else {
ess = null;
} }
if (this.getServer().getPluginManager().getPlugin("EssentialsSpawn") != null && this.getServer().getPluginManager().getPlugin("EssentialsSpawn").isEnabled()) { if (this.getServer().getPluginManager().getPlugin("EssentialsSpawn") != null && this.getServer().getPluginManager().getPlugin("EssentialsSpawn").isEnabled()) {
this.essentialsSpawn = new EssSpawn().getLocation(); this.essentialsSpawn = new EssSpawn().getLocation();
ConsoleLogger.info("Hook with EssentialsSpawn plugin"); ConsoleLogger.info("Hook with EssentialsSpawn plugin");
} else {
ess = null;
} }
} }
private void checkNotifications() { public void checkNotifications() {
if (!Settings.notifications) { if (!Settings.notifications) {
this.notifications = null; this.notifications = null;
return; return;
@ -423,7 +453,7 @@ public class AuthMe extends JavaPlugin {
} }
} }
private void combatTag() { public void combatTag() {
if (this.getServer().getPluginManager().getPlugin("CombatTag") != null && this.getServer().getPluginManager().getPlugin("CombatTag").isEnabled()) { if (this.getServer().getPluginManager().getPlugin("CombatTag") != null && this.getServer().getPluginManager().getPlugin("CombatTag").isEnabled()) {
this.CombatTag = 1; this.CombatTag = 1;
} else { } else {
@ -431,7 +461,7 @@ public class AuthMe extends JavaPlugin {
} }
} }
private void citizensVersion() { public void citizensVersion() {
if (this.getServer().getPluginManager().getPlugin("Citizens") != null && this.getServer().getPluginManager().getPlugin("Citizens").isEnabled()) { if (this.getServer().getPluginManager().getPlugin("Citizens") != null && this.getServer().getPluginManager().getPlugin("Citizens").isEnabled()) {
Citizens cit = (Citizens) this.getServer().getPluginManager().getPlugin("Citizens"); Citizens cit = (Citizens) this.getServer().getPluginManager().getPlugin("Citizens");
String ver = cit.getDescription().getVersion(); String ver = cit.getDescription().getVersion();
@ -710,7 +740,7 @@ public class AuthMe extends JavaPlugin {
return spawnLoc; return spawnLoc;
} }
private void enableProtection() { public void downloadGeoIp() {
ConsoleLogger.info(" This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com"); ConsoleLogger.info(" This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com");
File file = new File(getDataFolder(), "GeoIP.dat"); File file = new File(getDataFolder(), "GeoIP.dat");
if (!file.exists()) { if (!file.exists()) {
@ -747,6 +777,17 @@ public class AuthMe extends JavaPlugin {
return null; return null;
} }
public String getCountryName(InetAddress ip) {
try {
if (ls == null)
ls = new LookupService(new File(getDataFolder(), "GeoIP.dat"));
String code = ls.getCountry(ip).getName();
if (code != null && !code.isEmpty())
return code;
} catch (Exception e) {}
return null;
}
public void switchAntiBotMod(boolean mode) { public void switchAntiBotMod(boolean mode) {
this.antibotMod = mode; this.antibotMod = mode;
Settings.switchAntiBotMod(mode); Settings.switchAntiBotMod(mode);
@ -773,4 +814,17 @@ public class AuthMe extends JavaPlugin {
}, 1, 1200 * Settings.delayRecall); }, 1, 1200 * Settings.delayRecall);
} }
public String replaceAllInfos(String message, Player player) {
message = message.replace("&", "\u00a7");
message = message.replace("{PLAYER}", player.getName());
message = message.replace("{ONLINE}", ""+this.getServer().getOnlinePlayers().length);
message = message.replace("{MAXPLAYERS}", ""+this.getServer().getMaxPlayers());
message = message.replace("{IP}", player.getAddress().getAddress().getHostAddress());
message = message.replace("{LOGINS}", ""+PlayerCache.getInstance().getLogged());
message = message.replace("{WORLD}", player.getWorld().getName());
message = message.replace("{SERVER}", this.getServer().getServerName());
message = message.replace("{VERSION}", this.getServer().getBukkitVersion());
message = message.replace("{COUNTRY}", this.getCountryName(player.getAddress().getAddress()));
return message;
}
} }

View File

@ -35,7 +35,7 @@ public class ConsoleLogger {
public static void showError(String message) { public static void showError(String message) {
if (AuthMe.getInstance().isEnabled()) { if (AuthMe.getInstance().isEnabled()) {
log.severe(" ERROR: " + message); log.warning(" ERROR: " + message);
if (Settings.useLogging) { if (Settings.useLogging) {
Calendar date = Calendar.getInstance(); Calendar date = Calendar.getInstance();
final String actually = "[" + DateFormat.getDateInstance().format(date.getTime()) + ", " + date.get(Calendar.HOUR_OF_DAY) + ":" + date.get(Calendar.MINUTE) + ":" + date.get(Calendar.SECOND) + "] ERROR : " + message; final String actually = "[" + DateFormat.getDateInstance().format(date.getTime()) + ", " + date.get(Calendar.HOUR_OF_DAY) + ":" + date.get(Calendar.MINUTE) + ":" + date.get(Calendar.SECOND) + "] ERROR : " + message;
@ -52,8 +52,7 @@ public class ConsoleLogger {
public static void writeLog(String string) { public static void writeLog(String string) {
try { try {
FileWriter fw = new FileWriter(AuthMe.getInstance().getDataFolder() + File.separator + "authme.log", true); FileWriter fw = new FileWriter(AuthMe.getInstance().getDataFolder() + File.separator + "authme.log", true);
BufferedWriter w = null; BufferedWriter w = new BufferedWriter(fw);
w = new BufferedWriter(fw);
w.write(string); w.write(string);
w.newLine(); w.newLine();
w.close(); w.close();

View File

@ -1,7 +1,5 @@
package fr.xephi.authme; package fr.xephi.authme;
import java.util.logging.LogRecord;
import org.apache.logging.log4j.Level; import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.Marker; import org.apache.logging.log4j.Marker;
import org.apache.logging.log4j.core.LogEvent; import org.apache.logging.log4j.core.LogEvent;
@ -12,26 +10,10 @@ import org.apache.logging.log4j.message.Message;
* *
* @author Xephi59 * @author Xephi59
*/ */
public class Log4JFilter implements java.util.logging.Filter, org.apache.logging.log4j.core.Filter { public class Log4JFilter implements org.apache.logging.log4j.core.Filter {
public Log4JFilter() {} public Log4JFilter() {}
@Override
public boolean isLoggable(LogRecord record) {
try {
if (record == null || record.getMessage() == null) return true;
String logM = record.getMessage().toLowerCase();
if (!logM.contains("issued server command:")) return true;
if (!logM.contains("/login ") && !logM.contains("/l ") && !logM.contains("/reg ") && !logM.contains("/changepassword ") && !logM.contains("/unregister ")
&& !logM.contains("/authme register ") && !logM.contains("/authme changepassword ")&& !logM.contains("/authme reg ")&& !logM.contains("/authme cp ") && !logM.contains("/register ")) return true;
String playername = record.getMessage().split(" ")[0];
record.setMessage(playername + " issued an AuthMe command!");
return true;
} catch (NullPointerException npe) {
return true;
}
}
@Override @Override
public Result filter(LogEvent record) { public Result filter(LogEvent record) {
try { try {

View File

@ -11,6 +11,7 @@ import org.bukkit.Location;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.PluginManager;
import fr.xephi.authme.Utils.groupType;
import fr.xephi.authme.api.API; import fr.xephi.authme.api.API;
import fr.xephi.authme.cache.auth.PlayerAuth; import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.cache.auth.PlayerCache; import fr.xephi.authme.cache.auth.PlayerCache;
@ -96,7 +97,9 @@ public class Management extends Thread {
} }
if (plugin.captcha.containsKey(name) && plugin.captcha.get(name) >= Settings.maxLoginTry) { if (plugin.captcha.containsKey(name) && plugin.captcha.get(name) >= Settings.maxLoginTry) {
plugin.cap.put(name, rdm.nextString()); plugin.cap.put(name, rdm.nextString());
player.sendMessage(m._("need_captcha").replace("THE_CAPTCHA", plugin.cap.get(name)).replace("<theCaptcha>", plugin.cap.get(name))); for (String s : m._("need_captcha")) {
player.sendMessage(s.replace("THE_CAPTCHA", plugin.cap.get(name)).replace("<theCaptcha>", plugin.cap.get(name)));
}
return true; return true;
} else if (plugin.captcha.containsKey(name) && plugin.captcha.get(name) >= Settings.maxLoginTry) { } else if (plugin.captcha.containsKey(name) && plugin.captcha.get(name) >= Settings.maxLoginTry) {
try { try {
@ -153,18 +156,6 @@ public class Management extends Thread {
PlayerAuth auth = new PlayerAuth(name, hash, getIP(), new Date().getTime(), email, realName); PlayerAuth auth = new PlayerAuth(name, hash, getIP(), new Date().getTime(), email, realName);
database.updateSession(auth); database.updateSession(auth);
/*
* Little Work Around under Registration Group Switching for
* admins that add Registration thru a web Scripts.
*/
if (Settings.isPermissionCheckEnabled
&& AuthMe.permission.playerInGroup(player, Settings.unRegisteredGroup)
&& !Settings.unRegisteredGroup.isEmpty()) {
AuthMe.permission
.playerRemoveGroup(player.getWorld(), player.getName(), Settings.unRegisteredGroup);
AuthMe.permission.playerAddGroup(player.getWorld(), player.getName(), Settings.getRegisteredGroup);
}
pllog.addPlayer(player); pllog.addPlayer(player);
if (Settings.useCaptcha) { if (Settings.useCaptcha) {
@ -209,7 +200,7 @@ public class Management extends Thread {
if (AuthMePlayerListener.gameMode != null && AuthMePlayerListener.gameMode.containsKey(name)) { if (AuthMePlayerListener.gameMode != null && AuthMePlayerListener.gameMode.containsKey(name)) {
player.setGameMode(AuthMePlayerListener.gameMode.get(name)); player.setGameMode(AuthMePlayerListener.gameMode.get(name));
} }
player.kickPlayer(m._("wrong_pwd")); player.kickPlayer(m._("wrong_pwd")[0]);
} }
}); });
} else { } else {
@ -238,18 +229,6 @@ public class Management extends Thread {
PlayerAuth auth = new PlayerAuth(name, hash, getIP(), new Date().getTime(), email, realName); PlayerAuth auth = new PlayerAuth(name, hash, getIP(), new Date().getTime(), email, realName);
database.updateSession(auth); database.updateSession(auth);
/*
* Little Work Around under Registration Group Switching for
* admins that add Registration thru a web Scripts.
*/
if (Settings.isPermissionCheckEnabled
&& AuthMe.permission.playerInGroup(player, Settings.unRegisteredGroup)
&& !Settings.unRegisteredGroup.isEmpty()) {
AuthMe.permission
.playerRemoveGroup(player.getWorld(), player.getName(), Settings.unRegisteredGroup);
AuthMe.permission.playerAddGroup(player.getWorld(), player.getName(), Settings.getRegisteredGroup);
}
pllog.addPlayer(player); pllog.addPlayer(player);
if (Settings.useCaptcha) { if (Settings.useCaptcha) {
@ -381,6 +360,23 @@ public class Management extends Thread {
player.setGameMode(GameMode.SURVIVAL); player.setGameMode(GameMode.SURVIVAL);
} }
// Teleport the player
if(Settings.isForceSpawnLocOnJoinEnabled && Settings.getForcedWorlds.contains(player.getWorld().getName())) {
// If we have force the spawn location on join
teleportToSpawn();
} else {
if (Settings.isTeleportToSpawnEnabled) {
// If and only if teleport unauthed to spawn is activate
teleportBackFromSpawn();
} else {
if (Settings.isSaveQuitLocationEnabled && auth.getQuitLocY() != 0) {
// Teleport the player on the saved location
packQuitLocation();
} else {
// Do not move the player from his position
}
}
}
// Teleport // Teleport
if (Settings.isTeleportToSpawnEnabled && !Settings.isForceSpawnLocOnJoinEnabled && Settings.getForcedWorlds.contains(player.getWorld().getName())) { if (Settings.isTeleportToSpawnEnabled && !Settings.isForceSpawnLocOnJoinEnabled && Settings.getForcedWorlds.contains(player.getWorld().getName())) {
if (Settings.isSaveQuitLocationEnabled && auth.getQuitLocY() != 0) { if (Settings.isSaveQuitLocationEnabled && auth.getQuitLocY() != 0) {
@ -400,6 +396,9 @@ public class Management extends Thread {
if (Settings.isForceSurvivalModeEnabled) if (Settings.isForceSurvivalModeEnabled)
Utils.forceGM(player); Utils.forceGM(player);
// Restore Permission Group
utils.setGroup(player, groupType.LOGGEDIN);
// Cleanup no longer used temporary data // Cleanup no longer used temporary data
LimboCache.getInstance().deleteLimboPlayer(name); LimboCache.getInstance().deleteLimboPlayer(name);
if (playerCache.doesCacheExist(name)) { if (playerCache.doesCacheExist(name)) {
@ -408,7 +407,7 @@ public class Management extends Thread {
} }
// We can now display the join message // We can now display the join message
if (AuthMePlayerListener.joinMessage.containsKey(name) && AuthMePlayerListener.joinMessage.get(name) != null) { if (AuthMePlayerListener.joinMessage.containsKey(name) && AuthMePlayerListener.joinMessage.get(name) != null && !AuthMePlayerListener.joinMessage.get(name).isEmpty()) {
for (Player p : Bukkit.getServer().getOnlinePlayers()) { for (Player p : Bukkit.getServer().getOnlinePlayers()) {
if (p.isOnline()) if (p.isOnline())
p.sendMessage(AuthMePlayerListener.joinMessage.get(name)); p.sendMessage(AuthMePlayerListener.joinMessage.get(name));
@ -420,6 +419,10 @@ public class Management extends Thread {
Bukkit.getServer().getPluginManager().callEvent(new LoginEvent(player, true)); Bukkit.getServer().getPluginManager().callEvent(new LoginEvent(player, true));
player.saveData(); player.saveData();
// Login is finish, display welcome message
for (String s : Settings.welcomeMsg)
player.sendMessage(plugin.replaceAllInfos(s, player));
// Login is now finish , we can force all commands // Login is now finish , we can force all commands
forceCommands(); forceCommands();
} }

View File

@ -13,90 +13,103 @@ import org.bukkit.World;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import fr.xephi.authme.api.API; import fr.xephi.authme.api.API;
import fr.xephi.authme.cache.limbo.LimboCache;
import fr.xephi.authme.cache.limbo.LimboPlayer;
import fr.xephi.authme.events.AuthMeTeleportEvent; import fr.xephi.authme.events.AuthMeTeleportEvent;
import fr.xephi.authme.settings.Settings; import fr.xephi.authme.settings.Settings;
public class Utils { public class Utils {
private String currentGroup; private String currentGroup;
private static Utils singleton; private static Utils singleton;
private String unLoggedGroup = Settings.getUnloggedinGroup;
int id; int id;
public AuthMe plugin;
public void setGroup(Player player, groupType group) { public Utils(AuthMe plugin) {
if (!player.isOnline()) this.plugin = plugin;
return; }
if(!Settings.isPermissionCheckEnabled)
return;
switch(group) { public void setGroup(Player player, groupType group) {
case UNREGISTERED: { if (!player.isOnline())
currentGroup = AuthMe.permission.getPrimaryGroup(player); return;
AuthMe.permission.playerRemoveGroup(player, currentGroup); if(!Settings.isPermissionCheckEnabled)
AuthMe.permission.playerAddGroup(player, Settings.unRegisteredGroup); return;
break; if(plugin.permission == null)
} return;
case REGISTERED: { currentGroup = plugin.permission.getPrimaryGroup(player);
currentGroup = AuthMe.permission.getPrimaryGroup(player); World world = null;
AuthMe.permission.playerRemoveGroup(player, currentGroup); String name = player.getName();
AuthMe.permission.playerAddGroup(player, Settings.getRegisteredGroup); switch(group) {
break; case UNREGISTERED: {
} plugin.permission.playerRemoveGroup(world, name, currentGroup);
} plugin.permission.playerAddGroup(world, name, Settings.unRegisteredGroup);
return; break;
} }
case REGISTERED: {
plugin.permission.playerRemoveGroup(world, name, currentGroup);
plugin.permission.playerAddGroup(world, name, Settings.getRegisteredGroup);
break;
}
case NOTLOGGEDIN: {
if(!useGroupSystem()) break;
plugin.permission.playerRemoveGroup(world, name, currentGroup);
plugin.permission.playerAddGroup(world, name, Settings.getUnloggedinGroup);
break;
}
case LOGGEDIN: {
if(!useGroupSystem()) break;
LimboPlayer limbo = LimboCache.getInstance().getLimboPlayer(player.getName().toLowerCase());
if (limbo == null) break;
String realGroup = limbo.getGroup();
plugin.permission.playerRemoveGroup(world, name, currentGroup);
plugin.permission.playerAddGroup(world, name, realGroup);
break;
}
}
return;
}
public String removeAll(Player player) { public boolean addNormal(Player player, String group) {
if(!Utils.getInstance().useGroupSystem()){ if(!Utils.getInstance().useGroupSystem()){
return null; return false;
} }
if( !Settings.getJoinPermissions.isEmpty() ) { if(plugin.permission == null) return false;
hasPermOnJoin(player); World world = null;
} if(plugin.permission.playerRemoveGroup(world,player.getName().toString(),Settings.getUnloggedinGroup) && plugin.permission.playerAddGroup(world,player.getName().toString(),group)) {
this.currentGroup = AuthMe.permission.getPrimaryGroup(player.getWorld(),player.getName().toString()); return true;
if(AuthMe.permission.playerRemoveGroup(player.getWorld(),player.getName().toString(), currentGroup) && AuthMe.permission.playerAddGroup(player.getWorld(),player.getName().toString(),this.unLoggedGroup)) { }
return currentGroup; return false;
} }
return null;
}
public boolean addNormal(Player player, String group) { public void hasPermOnJoin(Player player) {
if(!Utils.getInstance().useGroupSystem()){ if (plugin.permission == null) return;
return false; Iterator<String> iter = Settings.getJoinPermissions.iterator();
} while (iter.hasNext()) {
if(AuthMe.permission.playerRemoveGroup(player.getWorld(),player.getName().toString(),this.unLoggedGroup) && AuthMe.permission.playerAddGroup(player.getWorld(),player.getName().toString(),group)) { String permission = iter.next();
return true; if(plugin.permission.playerHas(player, permission)){
} plugin.permission.playerAddTransient(player, permission);
return false; }
} }
}
private String hasPermOnJoin(Player player) { public boolean isUnrestricted(Player player) {
Iterator<String> iter = Settings.getJoinPermissions.iterator(); if(!Settings.isAllowRestrictedIp)
while (iter.hasNext()) { return false;
String permission = iter.next(); if(Settings.getUnrestrictedName.isEmpty() || Settings.getUnrestrictedName == null)
if(AuthMe.permission.playerHas(player, permission)){ return false;
AuthMe.permission.playerAddTransient(player, permission); if(Settings.getUnrestrictedName.contains(player.getName()))
} return true;
} return false;
return null;
}
public boolean isUnrestricted(Player player) {
if(Settings.getUnrestrictedName.isEmpty() || Settings.getUnrestrictedName == null)
return false;
if(Settings.getUnrestrictedName.contains(player.getName()))
return true;
return false;
} }
public static Utils getInstance() { public static Utils getInstance() {
singleton = new Utils(); singleton = new Utils(AuthMe.getInstance());
return singleton; return singleton;
} }
private boolean useGroupSystem() { private boolean useGroupSystem() {
if(Settings.isPermissionCheckEnabled && !Settings.getUnloggedinGroup.isEmpty()) { if(Settings.isPermissionCheckEnabled && !Settings.getUnloggedinGroup.isEmpty())
return true; return true;
} return false; return false;
} }
public void packCoords(double x, double y, double z, String w, final Player pl) public void packCoords(double x, double y, double z, String w, final Player pl)
@ -112,11 +125,11 @@ public class Utils {
final World world = theWorld; final World world = theWorld;
final Location locat = new Location(world, x, y, z); final Location locat = new Location(world, x, y, z);
Bukkit.getScheduler().scheduleSyncDelayedTask(AuthMe.getInstance(), new Runnable() { Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
@Override @Override
public void run() { public void run() {
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(pl, locat); AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(pl, locat);
AuthMe.getInstance().getServer().getPluginManager().callEvent(tpEvent); plugin.getServer().getPluginManager().callEvent(tpEvent);
if(!tpEvent.isCancelled()) { if(!tpEvent.isCancelled()) {
if (!tpEvent.getTo().getChunk().isLoaded()) if (!tpEvent.getTo().getChunk().isLoaded())
tpEvent.getTo().getChunk().load(); tpEvent.getTo().getChunk().load();

View File

@ -39,4 +39,8 @@ public class PlayerCache {
return singleton; return singleton;
} }
public int getLogged() {
return cache.size();
}
} }

View File

@ -134,7 +134,7 @@ public class FileCache {
if (!in[0].equals("i") && !in[0].equals("w")) { if (!in[0].equals("i") && !in[0].equals("w")) {
continue; continue;
} }
// can enchant item? size ofstring in file - 4 all / 2 = number of enchant // can enchant item? size ofstring in file - 4 all / 2 = number of enchant
if (in[0].equals("i")) { if (in[0].equals("i")) {
stacki[i] = new ItemStack(Material.getMaterial(in[1]), stacki[i] = new ItemStack(Material.getMaterial(in[1]),
Integer.parseInt(in[2]), Short.parseShort((in[3]))); Integer.parseInt(in[2]), Short.parseShort((in[3])));

View File

@ -30,7 +30,6 @@ public class LimboCache {
public void addLimboPlayer(Player player) { public void addLimboPlayer(Player player) {
String name = player.getName().toLowerCase(); String name = player.getName().toLowerCase();
Location loc = player.getLocation(); Location loc = player.getLocation();
loc.setY(loc.getY() + 0.4D);
GameMode gameMode = player.getGameMode(); GameMode gameMode = player.getGameMode();
ItemStack[] arm; ItemStack[] arm;
ItemStack[] inv; ItemStack[] inv;
@ -67,6 +66,8 @@ public class LimboCache {
if(player.isFlying()) if(player.isFlying())
flying = true; flying = true;
else flying = false; else flying = false;
if (plugin.permission != null)
playerGroup = plugin.permission.getPrimaryGroup(player);
} }
if(Settings.isForceSurvivalModeEnabled) { if(Settings.isForceSurvivalModeEnabled) {
@ -83,13 +84,6 @@ public class LimboCache {
if(player.isDead()) { if(player.isDead()) {
loc = plugin.getSpawnLocation(player.getWorld()); loc = plugin.getSpawnLocation(player.getWorld());
} }
try {
if(cache.containsKey(name) && playerGroup.isEmpty()) {
LimboPlayer groupLimbo = cache.get(name);
playerGroup = groupLimbo.getGroup();
}
} catch (NullPointerException ex) {
}
cache.put(player.getName().toLowerCase(), new LimboPlayer(name, loc, inv, arm, gameMode, operator, playerGroup, flying)); cache.put(player.getName().toLowerCase(), new LimboPlayer(name, loc, inv, arm, gameMode, operator, playerGroup, flying));
} }

View File

@ -32,6 +32,7 @@ import fr.xephi.authme.cache.auth.PlayerCache;
import fr.xephi.authme.converter.FlatToSql; import fr.xephi.authme.converter.FlatToSql;
import fr.xephi.authme.converter.FlatToSqlite; import fr.xephi.authme.converter.FlatToSqlite;
import fr.xephi.authme.converter.RakamakConverter; import fr.xephi.authme.converter.RakamakConverter;
import fr.xephi.authme.converter.RoyalAuthConverter;
import fr.xephi.authme.converter.newxAuthToFlat; import fr.xephi.authme.converter.newxAuthToFlat;
import fr.xephi.authme.converter.oldxAuthToFlat; import fr.xephi.authme.converter.oldxAuthToFlat;
import fr.xephi.authme.datasource.DataSource; import fr.xephi.authme.datasource.DataSource;
@ -435,17 +436,20 @@ public class AdminCommand implements CommandExecutor {
auth = PlayerCache.getInstance().getAuth(name); auth = PlayerCache.getInstance().getAuth(name);
} else if (database.isAuthAvailable(name)) { } else if (database.isAuthAvailable(name)) {
auth = database.getAuth(name); auth = database.getAuth(name);
} else { }
if (auth == null) {
m._(sender, "unknown_user"); m._(sender, "unknown_user");
return true; return true;
} }
auth.setHash(hash); auth.setHash(hash);
auth.setSalt(PasswordSecurity.userSalt.get(name)); if (PasswordSecurity.userSalt.containsKey(name)) {
auth.setSalt(PasswordSecurity.userSalt.get(name));
database.updateSalt(auth);
}
if (!database.updatePassword(auth)) { if (!database.updatePassword(auth)) {
m._(sender, "error"); m._(sender, "error");
return true; return true;
} }
database.updateSalt(auth);
sender.sendMessage("pwd_changed"); sender.sendMessage("pwd_changed");
ConsoleLogger.info(args[1] + "'s password changed"); ConsoleLogger.info(args[1] + "'s password changed");
} catch (NoSuchAlgorithmException ex) { } catch (NoSuchAlgorithmException ex) {
@ -509,6 +513,10 @@ public class AdminCommand implements CommandExecutor {
} }
sender.sendMessage("Usage : /authme switchantibot on/off"); sender.sendMessage("Usage : /authme switchantibot on/off");
return true; return true;
} else if (args[0].equalsIgnoreCase("royalauth")) {
new RoyalAuthConverter(plugin);
sender.sendMessage("[AuthMe] RoyalAuth database has been imported correctly");
return true;
} else { } else {
sender.sendMessage("Usage: /authme reload|register playername password|changepassword playername password|unregister playername"); sender.sendMessage("Usage: /authme reload|register playername password|changepassword playername password|unregister playername");
} }

View File

@ -61,7 +61,9 @@ public class CaptchaCommand implements CommandExecutor {
if(Settings.useCaptcha && !args[0].equals(plugin.cap.get(name))) { if(Settings.useCaptcha && !args[0].equals(plugin.cap.get(name))) {
plugin.cap.remove(name); plugin.cap.remove(name);
plugin.cap.put(name, rdm.nextString()); plugin.cap.put(name, rdm.nextString());
player.sendMessage(m._("wrong_captcha").replaceAll("THE_CAPTCHA", plugin.cap.get(name))); for (String s : m._("wrong_captcha")) {
player.sendMessage(s.replace("THE_CAPTCHA", plugin.cap.get(name)));
}
return true; return true;
} }
try { try {

View File

@ -8,11 +8,11 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitScheduler; import org.bukkit.scheduler.BukkitScheduler;
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.Utils.groupType;
import fr.xephi.authme.cache.auth.PlayerAuth; import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.cache.auth.PlayerCache; import fr.xephi.authme.cache.auth.PlayerCache;
import fr.xephi.authme.cache.backup.DataFileCache; import fr.xephi.authme.cache.backup.DataFileCache;
@ -91,8 +91,8 @@ public class LogoutCommand implements CommandExecutor {
if (LimboCache.getInstance().hasLimboPlayer(name)) if (LimboCache.getInstance().hasLimboPlayer(name))
LimboCache.getInstance().deleteLimboPlayer(name); LimboCache.getInstance().deleteLimboPlayer(name);
LimboCache.getInstance().addLimboPlayer(player , utils.removeAll(player));
LimboCache.getInstance().addLimboPlayer(player); LimboCache.getInstance().addLimboPlayer(player);
utils.setGroup(player, groupType.NOTLOGGEDIN);
if(Settings.protectInventoryBeforeLogInEnabled) { if(Settings.protectInventoryBeforeLogInEnabled) {
player.getInventory().clear(); player.getInventory().clear();
// create cache file for handling lost of inventories on unlogged in status // create cache file for handling lost of inventories on unlogged in status
@ -104,11 +104,11 @@ public class LogoutCommand implements CommandExecutor {
int interval = Settings.getWarnMessageInterval; int interval = Settings.getWarnMessageInterval;
BukkitScheduler sched = sender.getServer().getScheduler(); BukkitScheduler sched = sender.getServer().getScheduler();
if (delay != 0) { if (delay != 0) {
BukkitTask id = sched.runTaskLater(plugin, new TimeoutTask(plugin, name), delay); int id = sched.scheduleSyncDelayedTask(plugin, new TimeoutTask(plugin, name), delay);
LimboCache.getInstance().getLimboPlayer(name).setTimeoutTaskId(id.getTaskId()); LimboCache.getInstance().getLimboPlayer(name).setTimeoutTaskId(id);
} }
BukkitTask msgT = sched.runTask(plugin, new MessageTask(plugin, name, m._("login_msg"), interval)); int msgT = sched.scheduleSyncDelayedTask(plugin, new MessageTask(plugin, name, m._("login_msg"), interval));
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(msgT.getTaskId()); LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(msgT);
try { try {
if (PlayersLogs.players.contains(player.getName())) { if (PlayersLogs.players.contains(player.getName())) {
PlayersLogs.players.remove(player.getName()); PlayersLogs.players.remove(player.getName());

View File

@ -16,7 +16,7 @@ import fr.xephi.authme.settings.Messages;
* @author stefano * @author stefano
*/ */
public class PasspartuCommand implements CommandExecutor { public class PasspartuCommand implements CommandExecutor {
private Utils utils = new Utils(); private Utils utils = Utils.getInstance();
public AuthMe plugin; public AuthMe plugin;
private Messages m = Messages.getInstance(); private Messages m = Messages.getInstance();

View File

@ -38,13 +38,11 @@ public class RegisterCommand implements CommandExecutor {
private Messages m = Messages.getInstance(); private Messages m = Messages.getInstance();
private PlayersLogs pllog = PlayersLogs.getInstance(); private PlayersLogs pllog = PlayersLogs.getInstance();
private DataSource database; private DataSource database;
public boolean isFirstTimeJoin;
public PlayerAuth auth; public PlayerAuth auth;
public AuthMe plugin; public AuthMe plugin;
public RegisterCommand(DataSource database, AuthMe plugin) { public RegisterCommand(DataSource database, AuthMe plugin) {
this.database = database; this.database = database;
this.isFirstTimeJoin = false;
this.plugin = plugin; this.plugin = plugin;
} }
@ -153,7 +151,6 @@ public class RegisterCommand implements CommandExecutor {
Utils.getInstance().setGroup(player, Utils.groupType.REGISTERED); Utils.getInstance().setGroup(player, Utils.groupType.REGISTERED);
} }
m._(player, "vb_nonActiv"); m._(player, "vb_nonActiv");
String msg = m._("login_msg");
int time = Settings.getRegistrationTimeout * 20; int time = Settings.getRegistrationTimeout * 20;
int msgInterval = Settings.getWarnMessageInterval; int msgInterval = Settings.getWarnMessageInterval;
if (time != 0) { if (time != 0) {
@ -163,10 +160,9 @@ public class RegisterCommand implements CommandExecutor {
} }
Bukkit.getScheduler().cancelTask(LimboCache.getInstance().getLimboPlayer(name).getMessageTaskId()); Bukkit.getScheduler().cancelTask(LimboCache.getInstance().getLimboPlayer(name).getMessageTaskId());
int nwMsg = Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new MessageTask(plugin, name, msg, msgInterval)); int nwMsg = Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new MessageTask(plugin, name, m._("login_msg"), msgInterval));
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(nwMsg); LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(nwMsg);
LimboCache.getInstance().deleteLimboPlayer(name);
if (Settings.isTeleportToSpawnEnabled) { if (Settings.isTeleportToSpawnEnabled) {
World world = player.getWorld(); World world = player.getWorld();
Location loca = plugin.getSpawnLocation(world); Location loca = plugin.getSpawnLocation(world);
@ -179,7 +175,6 @@ public class RegisterCommand implements CommandExecutor {
player.teleport(tpEvent.getTo()); player.teleport(tpEvent.getTo());
} }
} }
this.isFirstTimeJoin = true;
if (player.getGameMode() != GameMode.CREATIVE && !Settings.isMovementAllowed) { if (player.getGameMode() != GameMode.CREATIVE && !Settings.isMovementAllowed) {
player.setAllowFlight(false); player.setAllowFlight(false);
player.setFlying(false); player.setFlying(false);
@ -188,7 +183,7 @@ public class RegisterCommand implements CommandExecutor {
if (!Settings.noConsoleSpam) if (!Settings.noConsoleSpam)
ConsoleLogger.info(player.getName() + " registered "+player.getAddress().getAddress().getHostAddress()); ConsoleLogger.info(player.getName() + " registered "+player.getAddress().getAddress().getHostAddress());
if(plugin.notifications != null) { if(plugin.notifications != null) {
plugin.notifications.showNotification(new Notification("[AuthMe] " + player.getName() + " has registered!")); plugin.notifications.showNotification(new Notification("[AuthMe] " + player.getName() + " has registered by email!"));
} }
return true; return true;
} }
@ -203,6 +198,13 @@ public class RegisterCommand implements CommandExecutor {
m._(player, "pass_len"); m._(player, "pass_len");
return true; return true;
} }
if(!Settings.unsafePasswords.isEmpty()) {
if (Settings.unsafePasswords.contains(args[0].toLowerCase())) {
m._(player, "password_error");
return true;
}
}
try { try {
String hash; String hash;
if(Settings.getEnablePasswordVerifier) { if(Settings.getEnablePasswordVerifier) {
@ -251,7 +253,6 @@ public class RegisterCommand implements CommandExecutor {
m._(player, "registered"); m._(player, "registered");
if (!Settings.getmailAccount.isEmpty()) if (!Settings.getmailAccount.isEmpty())
m._(player, "add_email"); m._(player, "add_email");
this.isFirstTimeJoin = true;
if (player.getGameMode() != GameMode.CREATIVE && !Settings.isMovementAllowed) { if (player.getGameMode() != GameMode.CREATIVE && !Settings.isMovementAllowed) {
player.setAllowFlight(false); player.setAllowFlight(false);
player.setFlying(false); player.setFlying(false);
@ -260,6 +261,10 @@ public class RegisterCommand implements CommandExecutor {
Bukkit.getServer().getPluginManager().callEvent(new LoginEvent(player, true)); Bukkit.getServer().getPluginManager().callEvent(new LoginEvent(player, true));
player.saveData(); player.saveData();
// Register is finish and player is logged, display welcome message
for (String s : Settings.welcomeMsg)
player.sendMessage(plugin.replaceAllInfos(s, player));
// Register is now finish , we can force all commands // Register is now finish , we can force all commands
forceCommands(player); forceCommands(player);
if (!Settings.noConsoleSpam) if (!Settings.noConsoleSpam)

View File

@ -11,11 +11,11 @@ import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitScheduler; import org.bukkit.scheduler.BukkitScheduler;
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.Utils.groupType;
import fr.xephi.authme.cache.auth.PlayerCache; import fr.xephi.authme.cache.auth.PlayerCache;
import fr.xephi.authme.cache.backup.FileCache; import fr.xephi.authme.cache.backup.FileCache;
import fr.xephi.authme.cache.limbo.LimboCache; import fr.xephi.authme.cache.limbo.LimboCache;
@ -77,12 +77,13 @@ public class UnregisterCommand implements CommandExecutor {
player.saveData(); player.saveData();
PlayerCache.getInstance().removePlayer(player.getName().toLowerCase()); PlayerCache.getInstance().removePlayer(player.getName().toLowerCase());
LimboCache.getInstance().addLimboPlayer(player); LimboCache.getInstance().addLimboPlayer(player);
Utils.getInstance().setGroup(player, groupType.UNREGISTERED);
int delay = Settings.getRegistrationTimeout * 20; int delay = Settings.getRegistrationTimeout * 20;
int interval = Settings.getWarnMessageInterval; int interval = Settings.getWarnMessageInterval;
BukkitScheduler sched = sender.getServer().getScheduler(); BukkitScheduler sched = sender.getServer().getScheduler();
if (delay != 0) { if (delay != 0) {
BukkitTask id = sched.runTaskLater(plugin, new TimeoutTask(plugin, name), delay); int id = sched.scheduleSyncDelayedTask(plugin, new TimeoutTask(plugin, name), delay);
LimboCache.getInstance().getLimboPlayer(name).setTimeoutTaskId(id.getTaskId()); LimboCache.getInstance().getLimboPlayer(name).setTimeoutTaskId(id);
} }
sched.scheduleSyncDelayedTask(plugin, new MessageTask(plugin, name, m._("reg_msg"), interval)); sched.scheduleSyncDelayedTask(plugin, new MessageTask(plugin, name, m._("reg_msg"), interval));
if(!Settings.unRegisteredGroup.isEmpty()){ if(!Settings.unRegisteredGroup.isEmpty()){

View File

@ -0,0 +1,43 @@
package fr.xephi.authme.converter;
import java.io.File;
import org.bukkit.OfflinePlayer;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.datasource.DataSource;
public class RoyalAuthConverter extends Thread {
public AuthMe plugin;
private DataSource data;
public RoyalAuthConverter(AuthMe plugin) {
this.plugin = plugin;
this.data = plugin.database;
this.start();
}
public void run() {
for (OfflinePlayer o : plugin.getServer().getOfflinePlayers()) {
try {
String name = o.getName().toLowerCase();
String separator = File.separator;
File file = new File("." + separator + "plugins" + separator + "RoyalAuth" + separator + "userdata" + separator + name + ".yml");
if (data.isAuthAvailable(name))
continue;
if (!file.exists())
continue;
RoyalAuthYamlReader ra = new RoyalAuthYamlReader(file);
PlayerAuth auth = new PlayerAuth(name, ra.getHash(), "127.0.0.1", ra.getLastLogin(), "your@email.com", o.getName());
data.saveAuth(auth);
} catch (Exception e) {
ConsoleLogger.showError("Error while trying to import "+ o.getName() + " RoyalAuth datas");
}
}
this.interrupt();
}
}

View File

@ -0,0 +1,22 @@
package fr.xephi.authme.converter;
import java.io.File;
import fr.xephi.authme.settings.CustomConfiguration;
public class RoyalAuthYamlReader extends CustomConfiguration {
public RoyalAuthYamlReader(File file) {
super(file);
load();
save();
}
public long getLastLogin() {
return getLong("timestamps.quit");
}
public String getHash() {
return getString("login.password");
}
}

View File

@ -329,11 +329,9 @@ public class FileDataSource implements DataSource {
if (Long.parseLong(args[3]) >= until) { if (Long.parseLong(args[3]) >= until) {
lines.add(line); lines.add(line);
continue; continue;
} else {
cleared.add(args[0]);
} }
} }
cleared.add(args[0]);
} }
bw = new BufferedWriter(new FileWriter(source)); bw = new BufferedWriter(new FileWriter(source));
for (String l : lines) { for (String l : lines) {

View File

@ -112,13 +112,6 @@ public class SqliteDataSource implements DataSource {
if (!rs.next()) { if (!rs.next()) {
st.executeUpdate("ALTER TABLE " + tableName + " ADD COLUMN " + columnEmail + " VARCHAR(255) DEFAULT 'your@email.com';"); st.executeUpdate("ALTER TABLE " + tableName + " ADD COLUMN " + columnEmail + " VARCHAR(255) DEFAULT 'your@email.com';");
} }
rs.close();
rs = con.getMetaData().getColumns(null, null, tableName, lastlocX);
if (rs.next()) {
st.executeUpdate("ALTER TABLE " + tableName + " MODIFY " + lastlocX + " DOUBLE NOT NULL DEFAULT '0.0';");
st.executeUpdate("ALTER TABLE " + tableName + " MODIFY " + lastlocY + " DOUBLE NOT NULL DEFAULT '0.0';");
st.executeUpdate("ALTER TABLE " + tableName + " MODIFY " + lastlocZ + " DOUBLE NOT NULL DEFAULT '0.0';");
}
} finally { } finally {
close(rs); close(rs);
close(st); close(st);

View File

@ -40,6 +40,7 @@ import org.bukkit.scheduler.BukkitScheduler;
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.Utils.groupType;
import fr.xephi.authme.api.API; import fr.xephi.authme.api.API;
import fr.xephi.authme.cache.auth.PlayerAuth; import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.cache.auth.PlayerCache; import fr.xephi.authme.cache.auth.PlayerCache;
@ -387,41 +388,46 @@ public class AuthMePlayerListener implements Listener {
return; return;
} }
if (!Settings.countriesBlacklist.isEmpty()) {
String code = plugin.getCountryCode(event.getAddress());
if (((code == null) || (Settings.countriesBlacklist.contains(code) && !API.isRegistered(name))) && !plugin.authmePermissible(player, "authme.bypassantibot")) {
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, m._("country_banned")[0]);
return;
}
}
if (Settings.enableProtection && !Settings.countries.isEmpty()) { if (Settings.enableProtection && !Settings.countries.isEmpty()) {
String code = plugin.getCountryCode(event.getAddress()); String code = plugin.getCountryCode(event.getAddress());
if (((code == null) || (!Settings.countries.contains(code) && !API.isRegistered(name))) && !plugin.authmePermissible(player, "authme.bypassantibot")) { if (((code == null) || (!Settings.countries.contains(code) && !API.isRegistered(name))) && !plugin.authmePermissible(player, "authme.bypassantibot")) {
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, m._("country_banned")); event.disallow(PlayerLoginEvent.Result.KICK_OTHER, m._("country_banned")[0]);
return; return;
} }
} }
if (Settings.isKickNonRegisteredEnabled) { if (Settings.isKickNonRegisteredEnabled) {
if (!data.isAuthAvailable(name)) { if (!data.isAuthAvailable(name)) {
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, m._("reg_only")); event.disallow(PlayerLoginEvent.Result.KICK_OTHER, m._("reg_only")[0]);
return; return;
} }
} }
if (player.isOnline() && Settings.isForceSingleSessionEnabled) { if (player.isOnline() && Settings.isForceSingleSessionEnabled) {
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, m._("same_nick")); event.disallow(PlayerLoginEvent.Result.KICK_OTHER, m._("same_nick")[0]);
return; return;
} }
if(data.isAuthAvailable(name) && !LimboCache.getInstance().hasLimboPlayer(name)) { if(data.isAuthAvailable(name) && !LimboCache.getInstance().hasLimboPlayer(name)) {
if(!Settings.isSessionsEnabled) { if(!Settings.isSessionsEnabled) {
LimboCache.getInstance().addLimboPlayer(player , utils.removeAll(player));
} else if(PlayerCache.getInstance().isAuthenticated(name)) { } else if(PlayerCache.getInstance().isAuthenticated(name)) {
if(!Settings.sessionExpireOnIpChange) if(!Settings.sessionExpireOnIpChange)
if(LimboCache.getInstance().hasLimboPlayer(player.getName().toLowerCase())) { if(LimboCache.getInstance().hasLimboPlayer(player.getName().toLowerCase())) {
LimboCache.getInstance().deleteLimboPlayer(name); LimboCache.getInstance().deleteLimboPlayer(name);
} }
LimboCache.getInstance().addLimboPlayer(player , utils.removeAll(player));
} }
} }
//Check if forceSingleSession is set to true, so kick player that has joined with same nick of online player //Check if forceSingleSession is set to true, so kick player that has joined with same nick of online player
if(player.isOnline() && Settings.isForceSingleSessionEnabled ) { if(player.isOnline() && Settings.isForceSingleSessionEnabled ) {
LimboPlayer limbo = LimboCache.getInstance().getLimboPlayer(player.getName().toLowerCase()); LimboPlayer limbo = LimboCache.getInstance().getLimboPlayer(player.getName().toLowerCase());
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, m._("same_nick")); event.disallow(PlayerLoginEvent.Result.KICK_OTHER, m._("same_nick")[0]);
if(PlayerCache.getInstance().isAuthenticated(player.getName().toLowerCase())) { if(PlayerCache.getInstance().isAuthenticated(player.getName().toLowerCase())) {
utils.addNormal(player, limbo.getGroup()); utils.addNormal(player, limbo.getGroup());
LimboCache.getInstance().deleteLimboPlayer(player.getName().toLowerCase()); LimboCache.getInstance().deleteLimboPlayer(player.getName().toLowerCase());
@ -435,14 +441,14 @@ public class AuthMePlayerListener implements Listener {
if (name.length() > max || name.length() < min) { if (name.length() > max || name.length() < min) {
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, m._("name_len")); event.disallow(PlayerLoginEvent.Result.KICK_OTHER, m._("name_len")[0]);
return; return;
} }
try { try {
if (!player.getName().matches(regex) || name.equals("Player")) { if (!player.getName().matches(regex) || name.equals("Player")) {
try { try {
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, m._("regex").replaceAll("REG_EX", regex)); event.disallow(PlayerLoginEvent.Result.KICK_OTHER, m._("regex")[0].replace("REG_EX", regex));
} catch (StringIndexOutOfBoundsException exc) { } catch (Exception exc) {
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "allowed char : " + regex); event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "allowed char : " + regex);
} }
return; return;
@ -453,8 +459,8 @@ public class AuthMePlayerListener implements Listener {
return; return;
} }
try { try {
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, m._("regex").replaceAll("REG_EX", regex)); event.disallow(PlayerLoginEvent.Result.KICK_OTHER, m._("regex")[0].replace("REG_EX", regex));
} catch (StringIndexOutOfBoundsException exc) { } catch (Exception exc) {
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "allowed char : " + regex); event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "allowed char : " + regex);
} }
return; return;
@ -477,7 +483,7 @@ public class AuthMePlayerListener implements Listener {
if (event.getResult() != PlayerLoginEvent.Result.KICK_FULL) return; if (event.getResult() != PlayerLoginEvent.Result.KICK_FULL) return;
if (player.isBanned()) return; if (player.isBanned()) return;
if (!plugin.authmePermissible(player, "authme.vip")) { if (!plugin.authmePermissible(player, "authme.vip")) {
event.disallow(Result.KICK_FULL, m._("kick_fullserver")); event.disallow(Result.KICK_FULL, m._("kick_fullserver")[0]);
return; return;
} }
@ -487,12 +493,12 @@ public class AuthMePlayerListener implements Listener {
} else { } else {
final Player pl = plugin.generateKickPlayer(plugin.getServer().getOnlinePlayers()); final Player pl = plugin.generateKickPlayer(plugin.getServer().getOnlinePlayers());
if (pl != null) { if (pl != null) {
pl.kickPlayer(m._("kick_forvip")); pl.kickPlayer(m._("kick_forvip")[0]);
event.allow(); event.allow();
return; return;
} else { } else {
ConsoleLogger.info("The player " + player.getName() + " wants to join, but the server is full"); ConsoleLogger.info("The player " + player.getName() + " wants to join, but the server is full");
event.disallow(Result.KICK_FULL, m._("kick_fullserver")); event.disallow(Result.KICK_FULL, m._("kick_fullserver")[0]);
return; return;
} }
} }
@ -505,14 +511,16 @@ public class AuthMePlayerListener implements Listener {
return; return;
if (antibot.keySet().size() > Settings.antiBotSensibility) { if (antibot.keySet().size() > Settings.antiBotSensibility) {
plugin.switchAntiBotMod(true); plugin.switchAntiBotMod(true);
Bukkit.broadcastMessage(m._("antibot_auto_enabled")); for (String s : m._("antibot_auto_enabled"))
Bukkit.broadcastMessage(s);
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){ Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
@Override @Override
public void run() { public void run() {
if (plugin.antibotMod) { if (plugin.antibotMod) {
plugin.switchAntiBotMod(false); plugin.switchAntiBotMod(false);
antibot.clear(); antibot.clear();
Bukkit.broadcastMessage(m._("antibot_auto_disabled").replace("%m", "" + Settings.antiBotDuration)); for (String s : m._("antibot_auto_disabled"))
Bukkit.broadcastMessage(s.replace("%m", "" + Settings.antiBotDuration));
} }
} }
}, Settings.antiBotDuration * 1200); }, Settings.antiBotDuration * 1200);
@ -532,7 +540,6 @@ public class AuthMePlayerListener implements Listener {
if (event.getPlayer() == null) { if (event.getPlayer() == null) {
return; return;
} }
Player player = event.getPlayer(); Player player = event.getPlayer();
World world = player.getWorld(); World world = player.getWorld();
Location spawnLoc = plugin.getSpawnLocation(world); Location spawnLoc = plugin.getSpawnLocation(world);
@ -587,7 +594,7 @@ public class AuthMePlayerListener implements Listener {
this.causeByAuthMe = true; this.causeByAuthMe = true;
player.setGameMode(gM); player.setGameMode(gM);
this.causeByAuthMe = false; this.causeByAuthMe = false;
player.kickPlayer(m._("unvalid_session")); player.kickPlayer(m._("unvalid_session")[0]);
return; return;
} else if (auth.getNickname().equalsIgnoreCase(name)){ } else if (auth.getNickname().equalsIgnoreCase(name)){
if (Settings.isForceSurvivalModeEnabled && !Settings.forceOnlyAfterLogin) { if (Settings.isForceSurvivalModeEnabled && !Settings.forceOnlyAfterLogin) {
@ -597,19 +604,17 @@ public class AuthMePlayerListener implements Listener {
} }
//Player change his IP between 2 relog-in //Player change his IP between 2 relog-in
PlayerCache.getInstance().removePlayer(name); PlayerCache.getInstance().removePlayer(name);
LimboCache.getInstance().addLimboPlayer(player , utils.removeAll(player));
} else { } else {
GameMode gM = gameMode.get(name); GameMode gM = gameMode.get(name);
this.causeByAuthMe = true; this.causeByAuthMe = true;
player.setGameMode(gM); player.setGameMode(gM);
this.causeByAuthMe = false; this.causeByAuthMe = false;
player.kickPlayer(m._("unvalid_session")); player.kickPlayer(m._("unvalid_session")[0]);
return; return;
} }
} else { } else {
//Session is ended correctly //Session is ended correctly
PlayerCache.getInstance().removePlayer(name); PlayerCache.getInstance().removePlayer(name);
LimboCache.getInstance().addLimboPlayer(player , utils.removeAll(player));
} }
} }
// isent in session or session was ended correctly // isent in session or session was ended correctly
@ -659,7 +664,7 @@ public class AuthMePlayerListener implements Listener {
} catch (NullPointerException ex) { } catch (NullPointerException ex) {
} }
} }
String msg = ""; String[] msg;
if(Settings.emailRegistration) { if(Settings.emailRegistration) {
msg = data.isAuthAvailable(name) ? m._("login_msg") : m._("reg_email_msg"); msg = data.isAuthAvailable(name) ? m._("login_msg") : m._("reg_email_msg");
} else { } else {
@ -675,6 +680,11 @@ public class AuthMePlayerListener implements Listener {
} }
if(!LimboCache.getInstance().hasLimboPlayer(name)) if(!LimboCache.getInstance().hasLimboPlayer(name))
LimboCache.getInstance().addLimboPlayer(player); LimboCache.getInstance().addLimboPlayer(player);
if (data.isAuthAvailable(name)) {
utils.setGroup(player, groupType.NOTLOGGEDIN);
} else {
utils.setGroup(player, groupType.UNREGISTERED);
}
if(player.isOp()) if(player.isOp())
player.setOp(false); player.setOp(false);
if (!Settings.isMovementAllowed) { if (!Settings.isMovementAllowed) {
@ -712,8 +722,6 @@ public class AuthMePlayerListener implements Listener {
Player player = event.getPlayer(); Player player = event.getPlayer();
String name = player.getName().toLowerCase(); String name = player.getName().toLowerCase();
Location loc = player.getLocation(); Location loc = player.getLocation();
if (loc.getY() % 1 != 0)
loc.add(0, 0.5, 0);
if (plugin.getCitizensCommunicator().isNPC(player, plugin) || Utils.getInstance().isUnrestricted(player) || CombatTagComunicator.isNPC(player)) { if (plugin.getCitizensCommunicator().isNPC(player, plugin) || Utils.getInstance().isUnrestricted(player) || CombatTagComunicator.isNPC(player)) {
return; return;
@ -723,22 +731,14 @@ public class AuthMePlayerListener implements Listener {
if(Settings.isSaveQuitLocationEnabled && data.isAuthAvailable(name)) { if(Settings.isSaveQuitLocationEnabled && data.isAuthAvailable(name)) {
final PlayerAuth auth = new PlayerAuth(name,loc.getX(),loc.getY(),loc.getZ(),loc.getWorld().getName()); final PlayerAuth auth = new PlayerAuth(name,loc.getX(),loc.getY(),loc.getZ(),loc.getWorld().getName());
try { try {
if (data instanceof Thread) { data.updateQuitLoc(auth);
data.updateQuitLoc(auth);
} else {
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
@Override
public void run() {
data.updateQuitLoc(auth);
}
});
}
} catch (NullPointerException npe) { } } catch (NullPointerException npe) { }
} }
} else {
event.setQuitMessage(null);
} }
if (data.getAuth(name) != null && !PlayerCache.getInstance().isAuthenticated(name))
event.setQuitMessage(null);
if (LimboCache.getInstance().hasLimboPlayer(name)) { if (LimboCache.getInstance().hasLimboPlayer(name)) {
LimboPlayer limbo = LimboCache.getInstance().getLimboPlayer(name); LimboPlayer limbo = LimboCache.getInstance().getLimboPlayer(name);
if(Settings.protectInventoryBeforeLogInEnabled && player.hasPlayedBefore()) { if(Settings.protectInventoryBeforeLogInEnabled && player.hasPlayedBefore()) {
@ -757,7 +757,7 @@ public class AuthMePlayerListener implements Listener {
this.plugin.getServer().getScheduler().cancelTask(limbo.getTimeoutTaskId()); this.plugin.getServer().getScheduler().cancelTask(limbo.getTimeoutTaskId());
LimboCache.getInstance().deleteLimboPlayer(name); LimboCache.getInstance().deleteLimboPlayer(name);
if(playerBackup.doesCacheExist(name)) { if(playerBackup.doesCacheExist(name)) {
playerBackup.removeCache(name); playerBackup.removeCache(name);
} }
} }
try { try {
@ -782,8 +782,6 @@ public class AuthMePlayerListener implements Listener {
Player player = event.getPlayer(); Player player = event.getPlayer();
Location loc = player.getLocation(); Location loc = player.getLocation();
if (loc.getY() % 1 != 0)
loc.add(0, 0.5, 0);
if ((plugin.getCitizensCommunicator().isNPC(player, plugin)) || (Utils.getInstance().isUnrestricted(player)) || (CombatTagComunicator.isNPC(player))) { if ((plugin.getCitizensCommunicator().isNPC(player, plugin)) || (Utils.getInstance().isUnrestricted(player)) || (CombatTagComunicator.isNPC(player))) {
return; return;
@ -800,21 +798,13 @@ public class AuthMePlayerListener implements Listener {
(Settings.isSaveQuitLocationEnabled) && data.isAuthAvailable(name)) { (Settings.isSaveQuitLocationEnabled) && data.isAuthAvailable(name)) {
final PlayerAuth auth = new PlayerAuth(name, loc.getX(), loc.getY(), loc.getZ(),loc.getWorld().getName()); final PlayerAuth auth = new PlayerAuth(name, loc.getX(), loc.getY(), loc.getZ(),loc.getWorld().getName());
try { try {
if (data instanceof Thread) { data.updateQuitLoc(auth);
data.updateQuitLoc(auth);
} else {
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
@Override
public void run() {
data.updateQuitLoc(auth);
}
});
}
} catch (NullPointerException npe) { } } catch (NullPointerException npe) { }
} else if (!PlayerCache.getInstance().isAuthenticated(name)){
event.setLeaveMessage(null);
} }
if (data.getAuth(name) != null && !PlayerCache.getInstance().isAuthenticated(name))
event.setLeaveMessage(null);
if (LimboCache.getInstance().hasLimboPlayer(name)) if (LimboCache.getInstance().hasLimboPlayer(name))
{ {
LimboPlayer limbo = LimboCache.getInstance().getLimboPlayer(name); LimboPlayer limbo = LimboCache.getInstance().getLimboPlayer(name);

View File

@ -0,0 +1,97 @@
package fr.xephi.authme.listener;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.server.PluginDisableEvent;
import org.bukkit.event.server.PluginEnableEvent;
import org.bukkit.event.server.ServerListPingEvent;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.settings.Messages;
import fr.xephi.authme.settings.Settings;
public class AuthMeServerListener implements Listener {
public AuthMe plugin;
private Messages m = Messages.getInstance();
public AuthMeServerListener(AuthMe plugin) {
this.plugin = plugin;
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onServerPing(ServerListPingEvent event) {
if (!Settings.enableProtection) return;
if (Settings.countries.isEmpty()) return;
if (!Settings.countriesBlacklist.isEmpty()) {
if(Settings.countriesBlacklist.contains(plugin.getCountryCode(event.getAddress())))
event.setMotd(m._("country_banned")[0]);
}
if(Settings.countries.contains(plugin.getCountryCode(event.getAddress()))) {
event.setMotd(plugin.getServer().getMotd());
} else {
event.setMotd(m._("country_banned")[0]);
}
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onPluginDisable(PluginDisableEvent event) {
String pluginName = event.getPlugin().getName();
if(pluginName.equalsIgnoreCase("Essentials")) {
plugin.ess = null;
ConsoleLogger.info("Essentials has been disabled, unhook!");
return;
}
if(pluginName.equalsIgnoreCase("EssentialsSpawn")) {
plugin.essentialsSpawn = null;
ConsoleLogger.info("EssentialsSpawn has been disabled, unhook!");
return;
}
if(pluginName.equalsIgnoreCase("Multiverse-Core")) {
plugin.multiverse = null;
ConsoleLogger.info("Multiverse-Core has been disabled, unhook!");
return;
}
if(pluginName.equalsIgnoreCase("Notifications")) {
plugin.notifications = null;
ConsoleLogger.info("Notifications has been disabled, unhook!");
}
if(pluginName.equalsIgnoreCase("ChestShop")) {
plugin.ChestShop = 0;
ConsoleLogger.info("ChestShop has been disabled, unhook!");
}
if(pluginName.equalsIgnoreCase("CombatTag")) {
plugin.CombatTag = 0;
ConsoleLogger.info("CombatTag has been disabled, unhook!");
}
if(pluginName.equalsIgnoreCase("Citizens")) {
plugin.CitizensVersion = 0;
ConsoleLogger.info("Citizens has been disabled, unhook!");
}
if(pluginName.equalsIgnoreCase("Vault")) {
plugin.permission = null;
ConsoleLogger.showError("Vault has been disabled, unhook permissions!");
}
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onPluginEnable(PluginEnableEvent event) {
String pluginName = event.getPlugin().getName();
if(pluginName.equalsIgnoreCase("Essentials") || pluginName.equalsIgnoreCase("EssentialsSpawn"))
plugin.checkEssentials();
if(pluginName.equalsIgnoreCase("Multiverse-Core"))
plugin.checkMultiverse();
if(pluginName.equalsIgnoreCase("Notifications"))
plugin.checkNotifications();
if(pluginName.equalsIgnoreCase("ChestShop"))
plugin.checkChestShop();
if(pluginName.equalsIgnoreCase("CombatTag"))
plugin.combatTag();
if(pluginName.equalsIgnoreCase("Citizens"))
plugin.citizensVersion();
if(pluginName.equalsIgnoreCase("Vault"))
plugin.checkVault();
}
}

View File

@ -25,6 +25,7 @@ public enum HashAlgorithm {
DOUBLEMD5(fr.xephi.authme.security.crypts.DOUBLEMD5.class), DOUBLEMD5(fr.xephi.authme.security.crypts.DOUBLEMD5.class),
PBKDF2(fr.xephi.authme.security.crypts.CryptPBKDF2.class), PBKDF2(fr.xephi.authme.security.crypts.CryptPBKDF2.class),
WORDPRESS(fr.xephi.authme.security.crypts.WORDPRESS.class), WORDPRESS(fr.xephi.authme.security.crypts.WORDPRESS.class),
ROYALAUTH(fr.xephi.authme.security.crypts.ROYALAUTH.class),
CUSTOM(Null.class); CUSTOM(Null.class);
Class<?> classe; Class<?> classe;

View File

@ -0,0 +1,25 @@
package fr.xephi.authme.security.crypts;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class ROYALAUTH implements EncryptionMethod {
@Override
public String getHash(String password, String salt)
throws NoSuchAlgorithmException {
MessageDigest md = MessageDigest.getInstance("SHA-512");
md.update(password.getBytes());
byte byteData[] = md.digest();
StringBuilder sb = new StringBuilder();
for (byte aByteData : byteData) sb.append(Integer.toString((aByteData & 0xff) + 0x100, 16).substring(1));
return sb.toString();
}
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
return hash.equalsIgnoreCase(getHash(password, ""));
}
}

View File

@ -5,6 +5,7 @@ import java.io.InputStream;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;
import fr.xephi.authme.AuthMe; import fr.xephi.authme.AuthMe;
import fr.xephi.authme.ConsoleLogger;
public class Messages extends CustomConfiguration { public class Messages extends CustomConfiguration {
@ -66,31 +67,28 @@ public class Messages extends CustomConfiguration {
} }
public void _(CommandSender sender, String msg) { public void _(CommandSender sender, String msg) {
String loc = (String) this.get(msg, this.getDefault(msg)); String loc = (String) this.get(msg);
if (loc == null && !contains(msg)) { if (loc == null) {
set(msg, this.getDefault(msg)); loc = "Error with Translation files; Please contact the admin for verify or update translation";
save(); ConsoleLogger.showError("Error with the " + msg + " translation, verify in your " + Settings.MESSAGE_FILE + "_" + Settings.messagesLanguage + ".yml !");
load();
loc = (String) this.get(msg, this.getDefault(msg));
} }
if (loc == null)
loc = "Error with Translation files; Please contact the admin ";
for (String l : loc.split("&n")) { for (String l : loc.split("&n")) {
sender.sendMessage(l.replace("&", "\u00a7")); sender.sendMessage(l.replace("&", "\u00a7"));
} }
} }
public String _(String msg) { public String[] _(String msg) {
String loc = (String) this.get(msg, this.getDefault(msg)); int i = ((String) this.get(msg)).split("&n").length;
if (loc == null && !contains(msg)) { String[] loc = new String[i];
set(msg, this.getDefault(msg)); int a;
save(); for (a = 0 ; a < i ; a++) {
load(); loc[a] = ((String) this.get(msg)).split("&n")[a].replace("&", "\u00a7");
loc = (String) this.get(msg, this.getDefault(msg));
} }
if (loc == null) if (loc == null || loc.length == 0) {
loc = "Error with Translation files; Please contact the admin "; loc[0] = "Error with " + msg + " translation; Please contact the admin for verify or update translation files";
return loc.replace("&", "\u00a7"); ConsoleLogger.showError("Error with the " + msg + " translation, verify in your " + Settings.MESSAGE_FILE + "_" + Settings.messagesLanguage + ".yml !");
}
return loc;
} }
public static Messages getInstance() { public static Messages getInstance() {

View File

@ -1,6 +1,12 @@
package fr.xephi.authme.settings; package fr.xephi.authme.settings;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
@ -8,8 +14,8 @@ import java.util.List;
import org.bukkit.configuration.MemoryConfiguration; import org.bukkit.configuration.MemoryConfiguration;
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.ConsoleLogger; import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.datasource.DataSource; import fr.xephi.authme.datasource.DataSource;
import fr.xephi.authme.datasource.DataSource.DataSourceType; import fr.xephi.authme.datasource.DataSource.DataSourceType;
@ -30,13 +36,17 @@ public final class Settings extends YamlConfiguration {
public static List<String> getMySQLOtherUsernameColumn = null; public static List<String> getMySQLOtherUsernameColumn = null;
public static List<String> getForcedWorlds = null; public static List<String> getForcedWorlds = null;
public static List<String> countries = null; public static List<String> countries = null;
public static List<String> countriesBlacklist = null;
public static List<String> forceCommands = null; public static List<String> forceCommands = null;
public final Plugin plugin; private AuthMe plugin;
private final File file; private final File file;
public static DataSourceType getDataSource; public static DataSourceType getDataSource;
public static HashAlgorithm getPasswordHash; public static HashAlgorithm getPasswordHash;
public static HashAlgorithm rakamakHash; public static HashAlgorithm rakamakHash;
public static Boolean useLogging = false; public static Boolean useLogging = false;
public static int purgeDelay = 60;
public static List<String> welcomeMsg = null;
public static List<String> unsafePasswords;
public static Boolean isPermissionCheckEnabled, isRegistrationEnabled, isForcedRegistrationEnabled, public static Boolean isPermissionCheckEnabled, isRegistrationEnabled, isForcedRegistrationEnabled,
isTeleportToSpawnEnabled, isSessionsEnabled, isChatAllowed, isAllowRestrictedIp, isTeleportToSpawnEnabled, isSessionsEnabled, isChatAllowed, isAllowRestrictedIp,
@ -48,7 +58,7 @@ public final class Settings extends YamlConfiguration {
useCaptcha, emailRegistration, multiverse, notifications, chestshop, bungee, banUnsafeIp, doubleEmailCheck, sessionExpireOnIpChange, useCaptcha, emailRegistration, multiverse, notifications, chestshop, bungee, banUnsafeIp, doubleEmailCheck, sessionExpireOnIpChange,
disableSocialSpy, useMultiThreading, forceOnlyAfterLogin, useEssentialsMotd, disableSocialSpy, useMultiThreading, forceOnlyAfterLogin, useEssentialsMotd,
usePurge, purgePlayerDat, purgeEssentialsFile, supportOldPassword, purgeLimitedCreative, usePurge, purgePlayerDat, purgeEssentialsFile, supportOldPassword, purgeLimitedCreative,
purgeAntiXray, purgePermissions, enableProtection, enableAntiBot, recallEmail; purgeAntiXray, purgePermissions, enableProtection, enableAntiBot, recallEmail, useWelcomeMessage;
public static String getNickRegex, getUnloggedinGroup, getMySQLHost, getMySQLPort, public static String getNickRegex, getUnloggedinGroup, getMySQLHost, getMySQLPort,
getMySQLUsername, getMySQLPassword, getMySQLDatabase, getMySQLTablename, getMySQLUsername, getMySQLPassword, getMySQLDatabase, getMySQLTablename,
@ -62,11 +72,11 @@ public final class Settings extends YamlConfiguration {
public static int getWarnMessageInterval, getSessionTimeout, getRegistrationTimeout, getMaxNickLength, public static int getWarnMessageInterval, getSessionTimeout, getRegistrationTimeout, getMaxNickLength,
getMinNickLength, getPasswordMinLen, getMovementRadius, getmaxRegPerIp, getNonActivatedGroup, getMinNickLength, getPasswordMinLen, getMovementRadius, getmaxRegPerIp, getNonActivatedGroup,
passwordMaxLength, getRecoveryPassLength, getMailPort, maxLoginTry, captchaLength, saltLength, getmaxRegPerEmail, passwordMaxLength, getRecoveryPassLength, getMailPort, maxLoginTry, captchaLength, saltLength, getmaxRegPerEmail,
bCryptLog2Rounds, purgeDelay, getPhpbbGroup, antiBotSensibility, antiBotDuration, delayRecall; bCryptLog2Rounds, getPhpbbGroup, antiBotSensibility, antiBotDuration, delayRecall;
protected static YamlConfiguration configFile; protected static YamlConfiguration configFile;
public Settings(Plugin plugin) { public Settings(AuthMe plugin) {
this.file = new File(plugin.getDataFolder(),"config.yml"); this.file = new File(plugin.getDataFolder(),"config.yml");
this.plugin = plugin; this.plugin = plugin;
if(exists()) { if(exists()) {
@ -220,6 +230,12 @@ public void loadConfigOptions() {
forceCommands = (List<String>) configFile.getList("settings.forceCommands", new ArrayList<String>()); forceCommands = (List<String>) configFile.getList("settings.forceCommands", new ArrayList<String>());
recallEmail = configFile.getBoolean("Email.recallPlayers", false); recallEmail = configFile.getBoolean("Email.recallPlayers", false);
delayRecall = configFile.getInt("Email.delayRecall", 5); delayRecall = configFile.getInt("Email.delayRecall", 5);
useWelcomeMessage = configFile.getBoolean("settings.useWelcomeMessage", true);
unsafePasswords = (List<String>) configFile.getList("settings.security.unsafePasswords", new ArrayList<String>());
countriesBlacklist = (List<String>) configFile.getList("Protection.countriesBlacklist", new ArrayList<String>());
// Load the welcome message
getWelcomeMessage(plugin);
saveDefaults(); saveDefaults();
} }
@ -364,6 +380,13 @@ public static void reloadConfigOptions(YamlConfiguration newConfig) {
forceCommands = (List<String>) configFile.getList("settings.forceCommands", new ArrayList<String>()); forceCommands = (List<String>) configFile.getList("settings.forceCommands", new ArrayList<String>());
recallEmail = configFile.getBoolean("Email.recallPlayers", false); recallEmail = configFile.getBoolean("Email.recallPlayers", false);
delayRecall = configFile.getInt("Email.delayRecall", 5); delayRecall = configFile.getInt("Email.delayRecall", 5);
useWelcomeMessage = configFile.getBoolean("settings.useWelcomeMessage", true);
unsafePasswords = (List<String>) configFile.getList("settings.security.unsafePasswords", new ArrayList<String>());
countriesBlacklist = (List<String>) configFile.getList("Protection.countriesBlacklist", new ArrayList<String>());
// Reload the welcome message
getWelcomeMessage(AuthMe.getInstance());
} }
public void mergeConfig() { public void mergeConfig() {
@ -484,6 +507,15 @@ public void mergeConfig() {
set("Email.recallPlayers", false); set("Email.recallPlayers", false);
if(!contains("Email.delayRecall")) if(!contains("Email.delayRecall"))
set("Email.delayRecall", 5); set("Email.delayRecall", 5);
if(!contains("settings.useWelcomeMessage"))
set("settings.useWelcomeMessage", true);
if(!contains("settings.security.unsafePasswords"))
set("settings.security.unsafePasswords", new ArrayList<String>());
if(!contains("Protection.countriesBlacklist")) {
countriesBlacklist = new ArrayList<String>();
countriesBlacklist.add("A1");
set("Protection.countriesBlacklist", countriesBlacklist);
}
plugin.getLogger().warning("Merge new Config Options if needed.."); plugin.getLogger().warning("Merge new Config Options if needed..");
plugin.getLogger().warning("Please check your config.yml file!"); plugin.getLogger().warning("Please check your config.yml file!");
@ -663,6 +695,35 @@ public void mergeConfig() {
isKickNonRegisteredEnabled = configFile.getBoolean("settings.restrictions.kickNonRegistered",false); isKickNonRegisteredEnabled = configFile.getBoolean("settings.restrictions.kickNonRegistered",false);
} }
private static void getWelcomeMessage(AuthMe plugin) {
if (!(new File(plugin.getDataFolder() + File.separator + "welcome.txt").exists())) {
try {
FileWriter fw = new FileWriter(plugin.getDataFolder() + File.separator + "welcome.txt", true);
BufferedWriter w = new BufferedWriter(fw);
w.write("Welcome {PLAYER} on {SERVER} server");
w.newLine();
w.write("This server use AuthMe protection!");
w.close();
} catch (IOException e) {
e.printStackTrace();
}
}
List<String> msg = new ArrayList<String>();
try {
FileReader fr = new FileReader(plugin.getDataFolder() + File.separator + "welcome.txt");
BufferedReader br = new BufferedReader(fr);
String line = "";
while((line = br.readLine()) != null) {
msg.add(line);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
welcomeMsg = msg;
}
public enum messagesLang { public enum messagesLang {
en, de, br, cz, pl, fr, uk, ru, hu, sk, es, fi, zhtw, zhhk, zhcn, lt, it, ko, pt, nl en, de, br, cz, pl, fr, uk, ru, hu, sk, es, fi, zhtw, zhhk, zhcn, lt, it, ko, pt, nl
} }

View File

@ -12,13 +12,13 @@ public class MessageTask implements Runnable {
private AuthMe plugin; private AuthMe plugin;
private String name; private String name;
private String msg; private String[] msg;
private int interval; private int interval;
public MessageTask(AuthMe plugin, String name, String msg, int interval) { public MessageTask(AuthMe plugin, String name, String[] strings, int interval) {
this.plugin = plugin; this.plugin = plugin;
this.name = name; this.name = name;
this.msg = msg; this.msg = strings;
this.interval = interval; this.interval = interval;
} }
@ -29,7 +29,7 @@ public class MessageTask implements Runnable {
for (Player player : plugin.getServer().getOnlinePlayers()) { for (Player player : plugin.getServer().getOnlinePlayers()) {
if (player.getName().toLowerCase().equals(name)) { if (player.getName().toLowerCase().equals(name)) {
for (String ms : msg.split("\u00a7n")) { for (String ms : msg) {
player.sendMessage(ms); player.sendMessage(ms);
} }
BukkitScheduler sched = plugin.getServer().getScheduler(); BukkitScheduler sched = plugin.getServer().getScheduler();

View File

@ -48,7 +48,7 @@ public class TimeoutTask implements Runnable {
GameMode gm = AuthMePlayerListener.gameMode.get(name); GameMode gm = AuthMePlayerListener.gameMode.get(name);
player.setGameMode(gm); player.setGameMode(gm);
ConsoleLogger.info("Set " + player.getName() + " to gamemode: " + gm.name()); ConsoleLogger.info("Set " + player.getName() + " to gamemode: " + gm.name());
player.kickPlayer(m._("timeout")); player.kickPlayer(m._("timeout")[0]);
break; break;
} }
} }

View File

@ -342,11 +342,9 @@ public class FlatFileThread extends Thread implements DataSource {
if (Long.parseLong(args[3]) >= until) { if (Long.parseLong(args[3]) >= until) {
lines.add(line); lines.add(line);
continue; continue;
} else {
cleared.add(args[0]);
} }
} }
cleared.add(args[0]);
} }
bw = new BufferedWriter(new FileWriter(source)); bw = new BufferedWriter(new FileWriter(source));
for (String l : lines) { for (String l : lines) {

View File

@ -134,13 +134,6 @@ public class SQLiteThread extends Thread implements DataSource {
if (!rs.next()) { if (!rs.next()) {
st.executeUpdate("ALTER TABLE " + tableName + " ADD COLUMN " + columnEmail + " VARCHAR(255) DEFAULT 'your@email.com';"); st.executeUpdate("ALTER TABLE " + tableName + " ADD COLUMN " + columnEmail + " VARCHAR(255) DEFAULT 'your@email.com';");
} }
rs.close();
rs = con.getMetaData().getColumns(null, null, tableName, lastlocX);
if (rs.next()) {
st.executeUpdate("ALTER TABLE " + tableName + " MODIFY " + lastlocX + " DOUBLE NOT NULL DEFAULT '0.0';");
st.executeUpdate("ALTER TABLE " + tableName + " MODIFY " + lastlocY + " DOUBLE NOT NULL DEFAULT '0.0';");
st.executeUpdate("ALTER TABLE " + tableName + " MODIFY " + lastlocZ + " DOUBLE NOT NULL DEFAULT '0.0';");
}
} finally { } finally {
close(rs); close(rs);
close(st); close(st);

View File

@ -190,7 +190,7 @@ settings:
# possible values: MD5, SHA1, SHA256, WHIRLPOOL, XAUTH, MD5VB, PHPBB, # possible values: MD5, SHA1, SHA256, WHIRLPOOL, XAUTH, MD5VB, PHPBB,
# PLAINTEXT ( unhashed password), # PLAINTEXT ( unhashed password),
# MYBB, IPB3, PHPFUSION, SMF, XENFORO, SALTED2MD5, JOOMLA, BCRYPT, WBB3, SHA512, # MYBB, IPB3, PHPFUSION, SMF, XENFORO, SALTED2MD5, JOOMLA, BCRYPT, WBB3, SHA512,
# DOUBLEMD5, PBKDF2, WORDPRESS, CUSTOM(for developpers only) # DOUBLEMD5, PBKDF2, WORDPRESS, ROYALAUTH, CUSTOM(for developpers only)
passwordHash: SHA256 passwordHash: SHA256
# salt length for the SALTED2MD5 MD5(MD5(password)+salt) # salt length for the SALTED2MD5 MD5(MD5(password)+salt)
doubleMD5SaltLength: 8 doubleMD5SaltLength: 8
@ -198,6 +198,11 @@ settings:
# other password algorithm to check an old password ? # other password algorithm to check an old password ?
# AuthMe will update the password to the new passwordHash ! # AuthMe will update the password to the new passwordHash !
supportOldPasswordHash: false supportOldPasswordHash: false
# Cancel unsafe passwords for being used, put them on lowercase!
unsafePasswords: []
#unsafePasswords:
#- '123456'
#- 'password'
registration: registration:
# enable registration on the server? # enable registration on the server?
enabled: true enabled: true
@ -224,8 +229,14 @@ settings:
UnrestrictedName: [] UnrestrictedName: []
# Message language, available : en, de, br, cz, pl, fr, ru, hu, sk, es, zhtw, fi, zhcn, lt, it, ko, pt # Message language, available : en, de, br, cz, pl, fr, ru, hu, sk, es, zhtw, fi, zhcn, lt, it, ko, pt
messagesLanguage: en messagesLanguage: en
#Force these commands after /login, without any '/', use %p for replace with player name # Force these commands after /login, without any '/', use %p for replace with player name
forceCommands: [] forceCommands: []
# Do we need to display the welcome message (welcome.txt) after a register or a login?
# You can use colors in this welcome.txt + some replaced strings :
# {PLAYER} : player name, {ONLINE} : display number of online players, {MAXPLAYERS} : display server slots,
# {IP} : player ip, {LOGINS} : number of players logged, {WORLD} : player current world, {SERVER} : server name
# {VERSION} : get current bukkit version, {COUNTRY} : player country
useWelcomeMessage: true
ExternalBoardOptions: ExternalBoardOptions:
# MySQL column for the salt , needed for some forum/cms support # MySQL column for the salt , needed for some forum/cms support
mySQLColumnSalt: '' mySQLColumnSalt: ''
@ -236,7 +247,7 @@ ExternalBoardOptions:
# u can put in this options the group number # u can put in this options the group number
# of unactivated user, needed for some forum/cms support # of unactivated user, needed for some forum/cms support
nonActivedUserGroup: -1 nonActivedUserGroup: -1
# Other MySQL columns where we need to put the Username # Other MySQL columns where we need to put the Username (case sensitive)
mySQLOtherUsernameColumns: [] mySQLOtherUsernameColumns: []
# How much Log to Round needed in BCrypt(do not change it if you do not know what's your doing) # How much Log to Round needed in BCrypt(do not change it if you do not know what's your doing)
bCryptLog2Round: 10 bCryptLog2Round: 10
@ -360,10 +371,13 @@ Purge:
Protection: Protection:
# Enable some servers protection ( country based login, antibot ) # Enable some servers protection ( country based login, antibot )
enableProtection: false enableProtection: false
# Countries allowed to join the server and register, see http://dev.maxmind.com/geoip/legacy/codes/iso3166/ for countries' codes # Countries allowed to join the server and register, see http://dev.bukkit.org/bukkit-plugins/authme-reloaded/pages/countries-codes/ for countries' codes
countries: countries:
- US - US
- GB - GB
# Countries blacklisted automatically ( without any needed to enable protection )
countriesBlacklist:
- A1
# Do we need to enable automatic antibot system? # Do we need to enable automatic antibot system?
enableAntiBot: false enableAntiBot: false
# Max number of player allowed to login in 5 secs before enable AntiBot system automatically # Max number of player allowed to login in 5 secs before enable AntiBot system automatically

View File

@ -51,6 +51,6 @@ email_added: '[AuthMe] 이메일 추가됨 !'
email_confirm: '[AuthMe] 이메일을 확인해주세요 !' email_confirm: '[AuthMe] 이메일을 확인해주세요 !'
email_changed: '[AuthMe] 이메일 변경됨 !' email_changed: '[AuthMe] 이메일 변경됨 !'
email_send: '[AuthMe] 복구 이메일 발송됨 !' email_send: '[AuthMe] 복구 이메일 발송됨 !'
country_banned: 'Your country is banned from this server' country_banned: '당신의 나라는 이 서버에서 차단되어 있습니다'
antibot_auto_enabled: '[AuthMe] AntiBotMod automatically enabled due to massive connections!' antibot_auto_enabled: '[AuthMe] 안티봇모드는 많은 양의 연결 때문에 자동적으로 활성화됩니다!'
antibot_auto_disabled: '[AuthMe] AntiBotMod automatically disabled after %m Minutes, hope invasion stopped' antibot_auto_disabled: '[AuthMe] 안티봇모드는 %m 분 후에 자동적으로 비활성화됩니다, 침입이 없습니다'

View File

@ -1,3 +1,4 @@
# Translate by AlexMerser / Перевод от AlexMerser
unknown_user: '&cТакой игрок не зарегестрирован' unknown_user: '&cТакой игрок не зарегестрирован'
unsafe_spawn: '&6Ваше расположение перед выходом было опасным - &aВы перенесены на спавн.' unsafe_spawn: '&6Ваше расположение перед выходом было опасным - &aВы перенесены на спавн.'
not_logged_in: '&cВы еще не вошли!' not_logged_in: '&cВы еще не вошли!'
@ -51,6 +52,6 @@ email_added: '[AuthMe] Email добавлен!'
email_confirm: '[AuthMe] Подтвердите ваш email!' email_confirm: '[AuthMe] Подтвердите ваш email!'
email_changed: '[AuthMe] Email изменен!' email_changed: '[AuthMe] Email изменен!'
email_send: '[AuthMe] Восстановительное письмо отправлено!' email_send: '[AuthMe] Восстановительное письмо отправлено!'
country_banned: 'Your country is banned from this server' country_banned: 'Ваша страна запрещена на этом сервере'
antibot_auto_enabled: '[AuthMe] AntiBotMod automatically enabled due to massive connections!' antibot_auto_enabled: '[AuthMe] AntiBot-режим автоматически включен из-за большого количества входов!'
antibot_auto_disabled: '[AuthMe] AntiBotMod automatically disabled after %m Minutes, hope invasion stopped' antibot_auto_disabled: '[AuthMe] AntiBot-режим автоматичски отключен после %m мин. Надеюсь, атака закончилась'

View File

@ -1,9 +1,9 @@
name: AuthMe name: AuthMe
author: Xephi59 author: Xephi59
website: http://dev.bukkit.org/bukkit-plugins/authme-recoded/ website: http://dev.bukkit.org/bukkit-plugins/authme-reloaded/
description: AuthMe prevents people, which aren't logged in, from doing stuff like placing blocks, moving, typing commands or seeing the inventory of the current player. description: AuthMe prevents people, which aren't logged in, from doing stuff like placing blocks, moving, typing commands or seeing the inventory of the current player.
main: fr.xephi.authme.AuthMe main: fr.xephi.authme.AuthMe
version: 3.2.1-DEV-2 version: 3.3.1
softdepend: [Vault, ChestShop, Spout, Multiverse-Core, Notifications, Citizens, CombatTag, Essentials, EssentialsSpawn] softdepend: [Vault, ChestShop, Spout, Multiverse-Core, Notifications, Citizens, CombatTag, Essentials, EssentialsSpawn]
commands: commands:
register: register:
@ -156,3 +156,6 @@ permissions:
authme.bypassantibot: authme.bypassantibot:
description: Bypass the AntiBot check description: Bypass the AntiBot check
default: op default: op
authme.admin.royalauth:
description: Import RoyalAuth database into AuthMe
default: op