Update 3.1.1

//Changes 3.1.1://
* Do /login correctly in the correct thread
* Add a way to force some commands after /login
* Try a fix for bungeecord , let's see ...
* Fix Logout command ( pos + inventory )
* Fix PHPBB support + random salt
* Add a bypass antibot perm : authme.bypassantibot
* Translation file will automatically update now
* Some other fixes
This commit is contained in:
Xephi 2013-12-12 05:34:44 +01:00
parent 10b4eaeca7
commit bc8d11ebd6
63 changed files with 1424 additions and 501 deletions

Binary file not shown.

BIN
lib/bungeecord-api.jar Normal file

Binary file not shown.

BIN
lib/xAuth-2.4.4.jar Normal file

Binary file not shown.

15
pom.xml
View File

@ -24,12 +24,12 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<version>3.0</version> <version>3.1.1</version>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId> <artifactId>bukkit</artifactId>
<version>1.6.4-R0.1-SNAPSHOT</version> <version>1.7.2-R0.1-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.milkbowl.vault</groupId> <groupId>net.milkbowl.vault</groupId>
@ -107,6 +107,13 @@
<version>2.0.26</version> <version>2.0.26</version>
<scope>system</scope> <scope>system</scope>
<systemPath>${project.basedir}/lib/xAuth.jar</systemPath> <systemPath>${project.basedir}/lib/xAuth.jar</systemPath>
</dependency>
<dependency>
<groupId>de.luricos.bukkit</groupId>
<artifactId>xAuth</artifactId>
<version>2.4.4</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/xAuth-2.4.4.jar</systemPath>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.onarandombox</groupId> <groupId>com.onarandombox</groupId>
@ -125,9 +132,9 @@
<dependency> <dependency>
<groupId>net.md-5</groupId> <groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId> <artifactId>bungeecord-api</artifactId>
<version>1.6.4-SNAPSHOT</version> <version>1.7.2-SNAPSHOT</version>
<scope>system</scope> <scope>system</scope>
<systemPath>${project.basedir}/lib/BungeeCord.jar</systemPath> <systemPath>${project.basedir}/lib/bungeecord-api.jar</systemPath>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -1,10 +1,17 @@
package fr.xephi.authme; package fr.xephi.authme;
import java.io.File; import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.URL;
import java.net.URLConnection;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
import java.util.zip.GZIPInputStream;
import com.earth2me.essentials.Essentials; import com.earth2me.essentials.Essentials;
@ -25,6 +32,7 @@ import org.bukkit.Location;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.World; import org.bukkit.World;
import com.maxmind.geoip.LookupService;
import com.onarandombox.MultiverseCore.MultiverseCore; import com.onarandombox.MultiverseCore.MultiverseCore;
import fr.xephi.authme.api.API; import fr.xephi.authme.api.API;
@ -48,6 +56,7 @@ import fr.xephi.authme.datasource.FileDataSource;
import fr.xephi.authme.datasource.MySQLDataSource; import fr.xephi.authme.datasource.MySQLDataSource;
import fr.xephi.authme.datasource.SqliteDataSource; import fr.xephi.authme.datasource.SqliteDataSource;
import fr.xephi.authme.listener.AuthMeBlockListener; import fr.xephi.authme.listener.AuthMeBlockListener;
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;
@ -94,6 +103,9 @@ public class AuthMe extends JavaPlugin {
public MultiverseCore multiverse = null; public MultiverseCore multiverse = null;
public Location essentialsSpawn; public Location essentialsSpawn;
public Thread databaseThread = null; public Thread databaseThread = null;
public LookupService ls = null;
public boolean antibotMod = false;
public boolean delayedAntiBot = true;
@Override @Override
public void onEnable() { public void onEnable() {
@ -105,14 +117,34 @@ public class AuthMe extends JavaPlugin {
settings = new Settings(this); settings = new Settings(this);
settings.loadConfigOptions(); settings.loadConfigOptions();
if (Settings.enableAntiBot) {
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
@Override
public void run() {
delayedAntiBot = false;
}
}, 2400);
}
m = Messages.getInstance();
setMessages(Messages.getInstance()); setMessages(Messages.getInstance());
pllog = PlayersLogs.getInstance(); pllog = PlayersLogs.getInstance();
server = getServer(); server = getServer();
//Set Console Filter //Set Console Filter
if (Settings.removePassword) if (Settings.removePassword) {
Bukkit.getLogger().setFilter(new ConsoleFilter()); Bukkit.getLogger().setFilter(new ConsoleFilter());
/*// Check the log4j usage and apply a filter
try {
if (Class.forName("org.apache.logging.log4j.LogManager") != null) {
}
} catch (Exception e) {}
*/
}
//Load MailApi //Load MailApi
if(!Settings.getmailAccount.isEmpty() && !Settings.getmailPassword.isEmpty()) if(!Settings.getmailAccount.isEmpty() && !Settings.getmailPassword.isEmpty())
@ -137,7 +169,7 @@ public class AuthMe extends JavaPlugin {
checkEssentials(); checkEssentials();
/* /*
* Back style on start if avaible * Back style on start if avalaible
*/ */
if(Settings.isBackupActivated && Settings.isBackupOnStart) { if(Settings.isBackupActivated && Settings.isBackupOnStart) {
Boolean Backup = new PerformBackup(this).DoBackup(); Boolean Backup = new PerformBackup(this).DoBackup();
@ -164,7 +196,7 @@ public class AuthMe extends JavaPlugin {
if (Settings.isStopEnabled) { if (Settings.isStopEnabled) {
ConsoleLogger.showError("Can't use FLAT FILE... SHUTDOWN..."); ConsoleLogger.showError("Can't use FLAT FILE... SHUTDOWN...");
server.shutdown(); server.shutdown();
} }
if (!Settings.isStopEnabled) if (!Settings.isStopEnabled)
this.getServer().getPluginManager().disablePlugin(this); this.getServer().getPluginManager().disablePlugin(this);
return; return;
@ -185,7 +217,7 @@ public class AuthMe extends JavaPlugin {
if (Settings.isStopEnabled) { if (Settings.isStopEnabled) {
ConsoleLogger.showError("Can't use MySQL... Please input correct MySQL informations ! SHUTDOWN..."); ConsoleLogger.showError("Can't use MySQL... Please input correct MySQL informations ! SHUTDOWN...");
server.shutdown(); server.shutdown();
} }
if (!Settings.isStopEnabled) if (!Settings.isStopEnabled)
this.getServer().getPluginManager().disablePlugin(this); this.getServer().getPluginManager().disablePlugin(this);
return; return;
@ -225,6 +257,16 @@ public class AuthMe extends JavaPlugin {
management = new Management(database, this); management = new Management(database, this);
PluginManager pm = getServer().getPluginManager(); PluginManager pm = getServer().getPluginManager();
if (Settings.bungee) {
Bukkit.getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
Bukkit.getMessenger().registerIncomingPluginChannel(this, "BungeeCord", new BungeeCordMessage(this));
try {
if (Class.forName("net.md_5.bungee.api.event.ChatEvent") != null)
pm.registerEvents(new AuthMeBungeeCordListener(database, this), this);
} 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);
ConsoleLogger.info("Successfully hook with Spout!"); ConsoleLogger.info("Successfully hook with Spout!");
@ -236,10 +278,6 @@ public class AuthMe extends JavaPlugin {
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!");
} }
if (Settings.bungee) {
Bukkit.getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
Bukkit.getMessenger().registerIncomingPluginChannel(this, "BungeeCord", new BungeeCordMessage(this));
}
//Find Permissions //Find Permissions
if (pm.getPlugin("Vault") != null) { if (pm.getPlugin("Vault") != null) {
@ -283,6 +321,8 @@ public class AuthMe extends JavaPlugin {
} }
} catch (NullPointerException ex) { } catch (NullPointerException ex) {
} }
if (Settings.enableProtection)
enableProtection();
if (Settings.usePurge) if (Settings.usePurge)
autoPurge(); autoPurge();
ConsoleLogger.info("Authme " + this.getDescription().getVersion() + " enabled"); ConsoleLogger.info("Authme " + this.getDescription().getVersion() + " enabled");
@ -338,7 +378,7 @@ public class AuthMe extends JavaPlugin {
} }
} }
} }
private void checkEssentials() { private 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 {
@ -405,7 +445,7 @@ public class AuthMe extends JavaPlugin {
if (database != null) { if (database != null) {
database.close(); database.close();
} }
if (databaseThread != null) { if (databaseThread != null) {
databaseThread.interrupt(); databaseThread.interrupt();
} }
@ -414,7 +454,7 @@ public class AuthMe extends JavaPlugin {
Boolean Backup = new PerformBackup(this).DoBackup(); Boolean Backup = new PerformBackup(this).DoBackup();
if(Backup) ConsoleLogger.info("Backup Complete"); if(Backup) ConsoleLogger.info("Backup Complete");
else ConsoleLogger.showError("Error while making Backup"); else ConsoleLogger.showError("Error while making Backup");
} }
ConsoleLogger.info("Authme " + this.getDescription().getVersion() + " disabled"); ConsoleLogger.info("Authme " + this.getDescription().getVersion() + " disabled");
} }
@ -427,7 +467,7 @@ public class AuthMe extends JavaPlugin {
PlayerAuth pAuth = database.getAuth(name); PlayerAuth pAuth = database.getAuth(name);
if(pAuth == null) if(pAuth == null)
break; break;
PlayerAuth auth = new PlayerAuth(name, pAuth.getHash(), pAuth.getIp(), new Date().getTime()); PlayerAuth auth = new PlayerAuth(name, pAuth.getHash(), pAuth.getIp(), new Date().getTime(), pAuth.getEmail(), player.getName());
database.updateSession(auth); database.updateSession(auth);
PlayerCache.getInstance().addPlayer(auth); PlayerCache.getInstance().addPlayer(auth);
} }
@ -519,7 +559,7 @@ public class AuthMe extends JavaPlugin {
} }
return player; return player;
} }
public boolean authmePermissible(Player player, String perm) { public boolean authmePermissible(Player player, String perm) {
if (player.hasPermission(perm)) if (player.hasPermission(perm))
return true; return true;
@ -536,7 +576,7 @@ public class AuthMe extends JavaPlugin {
} }
return false; return false;
} }
private void autoPurge() { private void autoPurge() {
if (!Settings.usePurge) { if (!Settings.usePurge) {
return; return;
@ -551,9 +591,68 @@ public class AuthMe extends JavaPlugin {
purgeEssentials(cleared); purgeEssentials(cleared);
if (Settings.purgePlayerDat) if (Settings.purgePlayerDat)
purgeDat(cleared); purgeDat(cleared);
if (Settings.purgeLimitedCreative)
purgeLimitedCreative(cleared);
if (Settings.purgeAntiXray)
purgeAntiXray(cleared);
//if (Settings.purgePermissions && permission != null)
//purgePerms(cleared);
} }
private void purgeDat(List<String> cleared) { /* private void purgePerms(List<String> cleared) {
int i = 0;
for (String name : cleared) {
org.bukkit.OfflinePlayer player = Bukkit.getOfflinePlayer(name);
if (player == null) continue;
String playerName = player.getName();
for (String group : permission.getPlayerGroups((String) null, playerName)) {
permission.playerRemoveGroup((String) null, playerName, group);
}
}
ConsoleLogger.info("AutoPurgeDatabase : Remove " + i + " players permissions");
} */
public void purgeAntiXray(List<String> cleared) {
int i = 0;
for (String name : cleared) {
org.bukkit.OfflinePlayer player = Bukkit.getOfflinePlayer(name);
if (player == null) continue;
String playerName = player.getName();
File playerFile = new File("." + File.separator + "plugins" + File.separator + "AntiXRayData" + File.separator + "PlayerData" + File.separator + playerName);
if (playerFile.exists()) {
playerFile.delete();
i++;
}
}
ConsoleLogger.info("AutoPurgeDatabase : Remove " + i + " AntiXRayData Files");
}
public void purgeLimitedCreative(List<String> cleared) {
int i = 0;
for (String name : cleared) {
org.bukkit.OfflinePlayer player = Bukkit.getOfflinePlayer(name);
if (player == null) continue;
String playerName = player.getName();
File playerFile = new File("." + File.separator + "plugins" + File.separator + "LimitedCreative" + File.separator + "inventories" + File.separator + playerName + ".yml");
if (playerFile.exists()) {
playerFile.delete();
i++;
}
playerFile = new File("." + File.separator + "plugins" + File.separator + "LimitedCreative" + File.separator + "inventories" + File.separator + playerName + "_creative.yml");
if (playerFile.exists()) {
playerFile.delete();
i++;
}
playerFile = new File("." + File.separator + "plugins" + File.separator + "LimitedCreative" + File.separator + "inventories" + File.separator + playerName + "_adventure.yml");
if (playerFile.exists()) {
playerFile.delete();
i++;
}
}
ConsoleLogger.info("AutoPurgeDatabase : Remove " + i + " LimitedCreative Survival, Creative and Adventure files");
}
public void purgeDat(List<String> cleared) {
int i = 0; int i = 0;
for (String name : cleared) { for (String name : cleared) {
org.bukkit.OfflinePlayer player = Bukkit.getOfflinePlayer(name); org.bukkit.OfflinePlayer player = Bukkit.getOfflinePlayer(name);
@ -568,7 +667,7 @@ public class AuthMe extends JavaPlugin {
ConsoleLogger.info("AutoPurgeDatabase : Remove " + i + " .dat Files"); ConsoleLogger.info("AutoPurgeDatabase : Remove " + i + " .dat Files");
} }
private void purgeEssentials(List<String> cleared) { public void purgeEssentials(List<String> cleared) {
int i = 0; int i = 0;
for (String name : cleared) { for (String name : cleared) {
File playerFile = new File(this.ess.getDataFolder() + File.separator + "userdata" + File.separator + name + ".yml"); File playerFile = new File(this.ess.getDataFolder() + File.separator + "userdata" + File.separator + name + ".yml");
@ -582,7 +681,7 @@ public class AuthMe extends JavaPlugin {
public Location getSpawnLocation(World world) { public Location getSpawnLocation(World world) {
Location spawnLoc = world.getSpawnLocation(); Location spawnLoc = world.getSpawnLocation();
if (multiverse != null) { if (multiverse != null && Settings.multiverse) {
try { try {
spawnLoc = multiverse.getMVWorldManager().getMVWorld(world).getSpawnLocation(); spawnLoc = multiverse.getMVWorldManager().getMVWorld(world).getSpawnLocation();
} catch (NullPointerException npe) { } catch (NullPointerException npe) {
@ -597,4 +696,47 @@ public class AuthMe extends JavaPlugin {
spawnLoc = Spawn.getInstance().getLocation(); spawnLoc = Spawn.getInstance().getLocation();
return spawnLoc; return spawnLoc;
} }
private void enableProtection() {
ConsoleLogger.info(" This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com");
File file = new File(getDataFolder(), "GeoIP.dat");
if (!file.exists()) {
try {
String url = "http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz";
URL downloadUrl = new URL(url);
URLConnection conn = downloadUrl.openConnection();
conn.setConnectTimeout(10000);
conn.connect();
InputStream input = conn.getInputStream();
if (url.endsWith(".gz"))
input = new GZIPInputStream(input);
OutputStream output = new FileOutputStream(file);
byte[] buffer = new byte[2048];
int length = input.read(buffer);
while (length >= 0) {
output.write(buffer, 0, length);
length = input.read(buffer);
}
output.close();
input.close();
} catch (Exception e) {}
}
}
public String getCountryCode(InetAddress ip) {
try {
if (ls == null)
ls = new LookupService(new File(getDataFolder(), "GeoIP.dat"));
String code = ls.getCountry(ip).getCode();
if (code != null && !code.isEmpty())
return code;
} catch (Exception e) {}
return null;
}
public void switchAntiBotMod(boolean mode) {
this.antibotMod = mode;
Settings.switchAntiBotMod(mode);
}
} }

View File

@ -50,24 +50,28 @@ public class Management {
this.pm = plugin.getServer().getPluginManager(); this.pm = plugin.getServer().getPluginManager();
} }
public void performLogin(final Player player, final String password, final boolean passpartu) { public void performLogin(final Player player, final String password, final boolean passpartu, final boolean forceLogin) {
if (passpartu) { if (passpartu) {
// Passpartu-Login Bypasses Password-Authentication. // Passpartu-Login Bypasses Password-Authentication.
Bukkit.getScheduler().runTaskAsynchronously(plugin, new AsyncronousPasspartuLogin(player)); new AsyncronousPasspartuLogin(player).pass();
} else { } else {
Bukkit.getScheduler().runTaskAsynchronously(plugin, new AsyncronousLogin(player, password)); new AsyncronousLogin(player, password, forceLogin).process();
} }
} }
class AsyncronousLogin implements Runnable { class AsyncronousLogin {
protected Player player; protected Player player;
protected String name; protected String name;
protected String password; protected String password;
protected String realName;
protected boolean forceLogin;
public AsyncronousLogin(Player player, String password) { public AsyncronousLogin(Player player, String password, boolean forceLogin) {
this.player = player; this.player = player;
this.password = password; this.password = password;
name = player.getName().toLowerCase(); name = player.getName().toLowerCase();
realName = player.getName();
this.forceLogin = forceLogin;
} }
protected String getIP() { protected String getIP() {
@ -87,12 +91,11 @@ public class Management {
plugin.captcha.remove(name); plugin.captcha.remove(name);
plugin.captcha.put(name, i); plugin.captcha.put(name, i);
} }
if (plugin.captcha.containsKey(name) && plugin.captcha.get(name) > Settings.maxLoginTry) { if (plugin.captcha.containsKey(name) && plugin.captcha.get(name) >= Settings.maxLoginTry) {
player.sendMessage(m._("need_captcha"));
plugin.cap.put(name, rdm.nextString()); plugin.cap.put(name, rdm.nextString());
player.sendMessage("Type : /captcha " + plugin.cap.get(name)); player.sendMessage(m._("need_captcha").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 {
plugin.captcha.remove(name); plugin.captcha.remove(name);
plugin.cap.remove(name); plugin.cap.remove(name);
@ -127,8 +130,7 @@ public class Management {
return pAuth; return pAuth;
} }
@Override protected void process() {
public void run() {
PlayerAuth pAuth = preAuth(); PlayerAuth pAuth = preAuth();
if (pAuth == null || needsCaptcha()) if (pAuth == null || needsCaptcha())
return; return;
@ -136,15 +138,16 @@ public class Management {
String hash = pAuth.getHash(); String hash = pAuth.getHash();
String email = pAuth.getEmail(); String email = pAuth.getEmail();
boolean passwordVerified = true; boolean passwordVerified = true;
try { if (!forceLogin)
passwordVerified = PasswordSecurity.comparePasswordWithHash(password, hash, name); try {
} catch (Exception ex) { passwordVerified = PasswordSecurity.comparePasswordWithHash(password, hash, name);
ConsoleLogger.showError(ex.getMessage()); } catch (Exception ex) {
player.sendMessage(m._("error")); ConsoleLogger.showError(ex.getMessage());
return; player.sendMessage(m._("error"));
} return;
}
if (passwordVerified && player.isOnline()) { if (passwordVerified && player.isOnline()) {
PlayerAuth auth = new PlayerAuth(name, hash, getIP(), new Date().getTime(), email); PlayerAuth auth = new PlayerAuth(name, hash, getIP(), new Date().getTime(), email, realName);
database.updateSession(auth); database.updateSession(auth);
/* /*
@ -216,13 +219,12 @@ public class Management {
} }
} }
class AsyncronousPasspartuLogin extends AsyncronousLogin implements Runnable { class AsyncronousPasspartuLogin extends AsyncronousLogin {
public AsyncronousPasspartuLogin(Player player) { public AsyncronousPasspartuLogin(Player player) {
super(player, null); super(player, null, false);
} }
@Override public void pass() {
public void run() {
PlayerAuth pAuth = preAuth(); PlayerAuth pAuth = preAuth();
if (pAuth == null) if (pAuth == null)
return; return;
@ -230,7 +232,7 @@ public class Management {
String hash = pAuth.getHash(); String hash = pAuth.getHash();
String email = pAuth.getEmail(); String email = pAuth.getEmail();
PlayerAuth auth = new PlayerAuth(name, hash, getIP(), new Date().getTime(), email); PlayerAuth auth = new PlayerAuth(name, hash, getIP(), new Date().getTime(), email, realName);
database.updateSession(auth); database.updateSession(auth);
/* /*
@ -338,6 +340,13 @@ public class Management {
API.setPlayerInventory(player, event.getInventory(), event.getArmor()); API.setPlayerInventory(player, event.getInventory(), event.getArmor());
} }
} }
protected void forceCommands() {
for (String command : Settings.forceCommands) {
try {
player.performCommand(command.replace("%p", player.getName()));
} catch (Exception e) {}
}
}
@Override @Override
public void run() { public void run() {
@ -386,7 +395,7 @@ public class Management {
// Re-Force Survival GameMode if we need due to world change specification // Re-Force Survival GameMode if we need due to world change specification
if (Settings.isForceSurvivalModeEnabled) if (Settings.isForceSurvivalModeEnabled)
player.setGameMode(GameMode.SURVIVAL); Utils.forceGM(player);
// Cleanup no longer used temporary data // Cleanup no longer used temporary data
LimboCache.getInstance().deleteLimboPlayer(name); LimboCache.getInstance().deleteLimboPlayer(name);
@ -394,9 +403,21 @@ public class Management {
playerCache.removeCache(name); playerCache.removeCache(name);
} }
} }
// We can now display the join message
if (AuthMePlayerListener.joinMessage.containsKey(name) && AuthMePlayerListener.joinMessage.get(name) != null) {
for (Player p : Bukkit.getServer().getOnlinePlayers()) {
if (p.isOnline())
p.sendMessage(AuthMePlayerListener.joinMessage.get(name));
}
}
// The Loginevent now fires (as intended) after everything is processed // The Loginevent now fires (as intended) after everything is processed
Bukkit.getServer().getPluginManager().callEvent(new LoginEvent(player, true)); Bukkit.getServer().getPluginManager().callEvent(new LoginEvent(player, true));
player.saveData(); player.saveData();
// Login is now finish , we can force all commands
forceCommands();
} }
} }

View File

@ -7,11 +7,13 @@ import java.util.Random;
import java.util.Scanner; import java.util.Scanner;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.World; 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.auth.PlayerCache;
import fr.xephi.authme.events.AuthMeTeleportEvent; import fr.xephi.authme.events.AuthMeTeleportEvent;
import fr.xephi.authme.settings.Settings; import fr.xephi.authme.settings.Settings;
@ -126,24 +128,28 @@ public class Utils {
} }
}); });
id = Bukkit.getScheduler().scheduleSyncRepeatingTask(AuthMe.getInstance(), new Runnable() if (!PlayerCache.getInstance().isAuthenticated(pl.getName().toLowerCase())) {
{ id = Bukkit.getScheduler().scheduleSyncRepeatingTask(AuthMe.getInstance(), new Runnable()
@Override {
public void run() { @Override
int current = (int)pl.getLocation().getY(); public void run() {
World currentWorld = pl.getWorld(); if (!PlayerCache.getInstance().isAuthenticated(pl.getName().toLowerCase())) {
if (current != fY && world.getName() == currentWorld.getName()) { int current = (int)pl.getLocation().getY();
pl.teleport(loc); World currentWorld = pl.getWorld();
} if (current != fY && world.getName() == currentWorld.getName()) {
} pl.teleport(loc);
}, 1L, 20L); }
Bukkit.getScheduler().scheduleSyncDelayedTask(AuthMe.getInstance(), new Runnable() }
{ }
@Override }, 1L, 20L);
public void run() { Bukkit.getScheduler().scheduleSyncDelayedTask(AuthMe.getInstance(), new Runnable()
Bukkit.getScheduler().cancelTask(id); {
} @Override
}, 60L); public void run() {
Bukkit.getScheduler().cancelTask(id);
}
}, 60L);
}
} }
/* /*
@ -217,6 +223,14 @@ public class Utils {
return new String(arr); return new String(arr);
} }
/*
* Used for force player GameMode
*/
public static void forceGM(Player player) {
if (!AuthMe.getInstance().authmePermissible(player, "authme.bypassforcesurvival"))
player.setGameMode(GameMode.SURVIVAL);
}
public enum groupType { public enum groupType {
UNREGISTERED, REGISTERED, NOTLOGGEDIN, LOGGEDIN UNREGISTERED, REGISTERED, NOTLOGGEDIN, LOGGEDIN
} }

View File

@ -145,7 +145,7 @@ public class API {
if (isRegistered(name)) { if (isRegistered(name)) {
return false; return false;
} }
PlayerAuth auth = new PlayerAuth(name, hash, "198.18.0.1", 0); PlayerAuth auth = new PlayerAuth(name, hash, "198.18.0.1", 0, "your@email.com", getPlayerRealName(name));
if (!database.saveAuth(auth)) { if (!database.saveAuth(auth)) {
return false; return false;
} }
@ -154,5 +154,26 @@ public class API {
return false; return false;
} }
} }
/**
* Get Player realName from lowerCase nickname
* @param String playerName
* return String player real name
*/
public static String getPlayerRealName(String nickname) {
try {
String realName = Bukkit.getOfflinePlayer(nickname).getName();
if (realName != null && !realName.isEmpty())
return realName;
} catch (NullPointerException npe) {}
return nickname;
}
/**
* Force a player to login
* @param Player player
*/
public static void forceLogin(Player player) {
instance.management.performLogin(player, "dontneed", false, true);
}
} }

View File

@ -5,10 +5,10 @@ import fr.xephi.authme.settings.Settings;
public class PlayerAuth { public class PlayerAuth {
private String nickname; private String nickname = "";
private String hash; private String hash = "";
private String ip = "198.18.0.1"; private String ip = "198.18.0.1";
private long lastLogin; private long lastLogin = 0;
private int x = 0; private int x = 0;
private int y = 0; private int y = 0;
private int z = 0; private int z = 0;
@ -17,20 +17,15 @@ public class PlayerAuth {
private String vBhash = null; private String vBhash = null;
private int groupId; private int groupId;
private String email = "your@email.com"; private String email = "your@email.com";
private String realName = "";
public PlayerAuth(String nickname, String hash, String ip, long lastLogin) { public PlayerAuth(String nickname, String hash, String ip, long lastLogin, String email, String realName) {
this.nickname = nickname;
this.hash = hash;
this.ip = ip;
this.lastLogin = lastLogin;
}
public PlayerAuth(String nickname, String hash, String ip, long lastLogin, String email) {
this.nickname = nickname; this.nickname = nickname;
this.hash = hash; this.hash = hash;
this.ip = ip; this.ip = ip;
this.lastLogin = lastLogin; this.lastLogin = lastLogin;
this.email = email; this.email = email;
this.realName = realName;
} }
public PlayerAuth(String nickname, int x, int y, int z, String world) { public PlayerAuth(String nickname, int x, int y, int z, String world) {
@ -41,7 +36,7 @@ public class PlayerAuth {
this.world = world; this.world = world;
} }
public PlayerAuth(String nickname, String hash, String ip, long lastLogin, int x, int y, int z, String world, String email) { public PlayerAuth(String nickname, String hash, String ip, long lastLogin, int x, int y, int z, String world, String email, String realName) {
this.nickname = nickname; this.nickname = nickname;
this.hash = hash; this.hash = hash;
this.ip = ip; this.ip = ip;
@ -51,9 +46,10 @@ public class PlayerAuth {
this.z = z; this.z = z;
this.world = world; this.world = world;
this.email = email; this.email = email;
this.realName = realName;
} }
public PlayerAuth(String nickname, String hash, String salt, int groupId, String ip, long lastLogin, int x, int y, int z, String world, String email) { public PlayerAuth(String nickname, String hash, String salt, int groupId, String ip, long lastLogin, int x, int y, int z, String world, String email, String realName) {
this.nickname = nickname; this.nickname = nickname;
this.hash = hash; this.hash = hash;
this.ip = ip; this.ip = ip;
@ -64,27 +60,30 @@ public class PlayerAuth {
this.world = world; this.world = world;
this.salt = salt; this.salt = salt;
this.groupId = groupId; this.groupId = groupId;
this.email = email; this.email = email;
this.realName = realName;
} }
public PlayerAuth(String nickname, String hash, String salt, int groupId , String ip, long lastLogin) { public PlayerAuth(String nickname, String hash, String salt, int groupId , String ip, long lastLogin, String realName) {
this.nickname = nickname; this.nickname = nickname;
this.hash = hash; this.hash = hash;
this.ip = ip; this.ip = ip;
this.lastLogin = lastLogin; this.lastLogin = lastLogin;
this.salt = salt; this.salt = salt;
this.groupId = groupId; this.groupId = groupId;
this.realName = realName;
} }
public PlayerAuth(String nickname, String hash, String salt, String ip, long lastLogin) { public PlayerAuth(String nickname, String hash, String salt, String ip, long lastLogin, String realName) {
this.nickname = nickname; this.nickname = nickname;
this.hash = hash; this.hash = hash;
this.ip = ip; this.ip = ip;
this.lastLogin = lastLogin; this.lastLogin = lastLogin;
this.salt = salt; this.salt = salt;
this.realName = realName;
} }
public PlayerAuth(String nickname, String hash, String salt, String ip, long lastLogin, int x, int y, int z, String world, String email) { public PlayerAuth(String nickname, String hash, String salt, String ip, long lastLogin, int x, int y, int z, String world, String email, String realName) {
this.nickname = nickname; this.nickname = nickname;
this.hash = hash; this.hash = hash;
this.ip = ip; this.ip = ip;
@ -94,19 +93,8 @@ public class PlayerAuth {
this.z = z; this.z = z;
this.world = world; this.world = world;
this.salt = salt; this.salt = salt;
this.email = email; this.email = email;
} this.realName = realName;
public PlayerAuth(String nickname, String hash, String ip, long lastLogin, int x, int y, int z, String world) {
this.nickname = nickname;
this.hash = hash;
this.ip = ip;
this.lastLogin = lastLogin;
this.x = x;
this.y = y;
this.z = z;
this.world = world;
this.email = "your@email.com";
} }
public String getIp() { public String getIp() {
@ -118,7 +106,7 @@ public class PlayerAuth {
} }
public String getHash() { public String getHash() {
if(!salt.isEmpty() && Settings.getPasswordHash == HashAlgorithm.MD5VB) { if(salt != null && !salt.isEmpty() && Settings.getPasswordHash == HashAlgorithm.MD5VB) {
vBhash = "$MD5vb$"+salt+"$"+hash; vBhash = "$MD5vb$"+salt+"$"+hash;
return vBhash; return vBhash;
} }
@ -208,9 +196,13 @@ public class PlayerAuth {
@Override @Override
public String toString() { public String toString() {
String s = "Player : " + nickname + " ! IP : " + ip + " ! LastLogin : " + lastLogin + " ! LastPosition : " + x + "," + y + "," + z + "," + world String s = "Player : " + nickname + " ! IP : " + ip + " ! LastLogin : " + lastLogin + " ! LastPosition : " + x + "," + y + "," + z + "," + world
+ " ! Email : " + email + " ! Hash : " + hash + " ! Salt : " + salt; + " ! Email : " + email + " ! Hash : " + hash + " ! Salt : " + salt + " ! RealName : " + realName;
return s; return s;
} }
public String getRealname() {
return realName;
}
} }

View File

@ -3,12 +3,12 @@ package fr.xephi.authme.cache.limbo;
import java.util.HashMap; import java.util.HashMap;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import fr.xephi.authme.AuthMe; import fr.xephi.authme.AuthMe;
import fr.xephi.authme.api.API;
import fr.xephi.authme.cache.backup.FileCache; import fr.xephi.authme.cache.backup.FileCache;
import fr.xephi.authme.events.ResetInventoryEvent; import fr.xephi.authme.events.ResetInventoryEvent;
import fr.xephi.authme.events.StoreInventoryEvent; import fr.xephi.authme.events.StoreInventoryEvent;
@ -30,6 +30,7 @@ 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);
int gameMode = player.getGameMode().getValue(); int gameMode = player.getGameMode().getValue();
ItemStack[] arm; ItemStack[] arm;
ItemStack[] inv; ItemStack[] inv;
@ -69,11 +70,11 @@ public class LimboCache {
} }
if(Settings.isForceSurvivalModeEnabled) { if(Settings.isForceSurvivalModeEnabled) {
if(Settings.isResetInventoryIfCreative && gameMode != 0 ) { if(Settings.isResetInventoryIfCreative && player.getGameMode() == GameMode.CREATIVE ) {
ResetInventoryEvent event = new ResetInventoryEvent(player); ResetInventoryEvent event = new ResetInventoryEvent(player);
Bukkit.getServer().getPluginManager().callEvent(event); Bukkit.getServer().getPluginManager().callEvent(event);
if (!event.isCancelled()) { if (!event.isCancelled()) {
API.setPlayerInventory(player, new ItemStack[36], new ItemStack[4]); player.getInventory().clear();
player.sendMessage("Your inventory has been cleaned!"); player.sendMessage("Your inventory has been cleaned!");
} }
} }

View File

@ -25,12 +25,14 @@ import org.bukkit.plugin.java.JavaPlugin;
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.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;
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.xAuthToFlat; import fr.xephi.authme.converter.newxAuthToFlat;
import fr.xephi.authme.converter.oldxAuthToFlat;
import fr.xephi.authme.datasource.DataSource; import fr.xephi.authme.datasource.DataSource;
import fr.xephi.authme.security.PasswordSecurity; import fr.xephi.authme.security.PasswordSecurity;
import fr.xephi.authme.settings.Messages; import fr.xephi.authme.settings.Messages;
@ -66,6 +68,8 @@ public class AdminCommand implements CommandExecutor {
sender.sendMessage("/authme spawn - Teleport you to the AuthMe SpawnPoint"); sender.sendMessage("/authme spawn - Teleport you to the AuthMe SpawnPoint");
sender.sendMessage("/authme chgemail <playername> <email> - Change player email"); sender.sendMessage("/authme chgemail <playername> <email> - Change player email");
sender.sendMessage("/authme getemail <playername> - Get player email"); sender.sendMessage("/authme getemail <playername> - Get player email");
sender.sendMessage("/authme purgelastpos <playername> - Purge last position for a player");
sender.sendMessage("/authme switchantibot on/off - Enable/Disable antibot method");
return true; return true;
} }
@ -100,7 +104,16 @@ public class AdminCommand implements CommandExecutor {
try { try {
long days = Long.parseLong(args[1]) * 86400000; long days = Long.parseLong(args[1]) * 86400000;
long until = new Date().getTime() - days; long until = new Date().getTime() - days;
sender.sendMessage("Deleted " + database.purgeDatabase(until) + " user accounts"); List<String> purged = database.autoPurgeDatabase(until);
sender.sendMessage("Deleted " + purged.size() + " user accounts");
if (Settings.purgeEssentialsFile && plugin.ess != null)
plugin.purgeEssentials(purged);
if (Settings.purgePlayerDat)
plugin.purgeDat(purged);
if (Settings.purgeLimitedCreative)
plugin.purgeLimitedCreative(purged);
if (Settings.purgeAntiXray)
plugin.purgeAntiXray(purged);
return true; return true;
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
sender.sendMessage("Usage: /authme purge <DAYS>"); sender.sendMessage("Usage: /authme purge <DAYS>");
@ -256,24 +269,27 @@ public class AdminCommand implements CommandExecutor {
} }
try { try {
String name = args[1].toLowerCase(); String name = args[1].toLowerCase();
String hash = PasswordSecurity.getHash(Settings.getPasswordHash, args[2], name);
if (database.isAuthAvailable(name)) { if (database.isAuthAvailable(name)) {
sender.sendMessage(m._("user_regged")); sender.sendMessage(m._("user_regged"));
return true; return true;
} }
PlayerAuth auth = new PlayerAuth(name, hash, "198.18.0.1", 0); String hash = PasswordSecurity.getHash(Settings.getPasswordHash, args[2], name);
auth.setSalt(PasswordSecurity.userSalt.get(name)); PlayerAuth auth = new PlayerAuth(name, hash, "198.18.0.1", 0L, "your@email.com", API.getPlayerRealName(name));
if (PasswordSecurity.userSalt.containsKey(name) && PasswordSecurity.userSalt.get(name) != null)
auth.setSalt(PasswordSecurity.userSalt.get(name));
else
auth.setSalt("");
if (!database.saveAuth(auth)) { if (!database.saveAuth(auth)) {
sender.sendMessage(m._("error")); sender.sendMessage(m._("error"));
return true; return true;
} }
database.updateSalt(auth);
sender.sendMessage(m._("registered")); sender.sendMessage(m._("registered"));
ConsoleLogger.info(args[1] + " registered"); ConsoleLogger.info(args[1] + " registered");
} catch (NoSuchAlgorithmException ex) { } catch (NoSuchAlgorithmException ex) {
ConsoleLogger.showError(ex.getMessage()); ConsoleLogger.showError(ex.getMessage());
sender.sendMessage(m._("error")); sender.sendMessage(m._("error"));
} }
return true;
} else if (args[0].equalsIgnoreCase("convertflattosql")) { } else if (args[0].equalsIgnoreCase("convertflattosql")) {
try { try {
FlatToSql.FlatToSqlConverter(); FlatToSql.FlatToSqlConverter();
@ -294,13 +310,22 @@ public class AdminCommand implements CommandExecutor {
} catch (NullPointerException ex) { } catch (NullPointerException ex) {
System.out.println(ex.getMessage()); System.out.println(ex.getMessage());
} }
return true;
} else if (args[0].equalsIgnoreCase("xauthimport")) { } else if (args[0].equalsIgnoreCase("xauthimport")) {
xAuthToFlat converter = new xAuthToFlat(plugin, database); try {
if (converter.convert(sender)) { Class.forName("com.cypherx.xauth.xAuth");
sender.sendMessage("[AuthMe] Successfull convert from xAuth database"); oldxAuthToFlat converter = new oldxAuthToFlat(plugin, database, sender);
} else { converter.run();
sender.sendMessage("[AuthMe] Error while trying to convert from xAuth database"); } catch (ClassNotFoundException e) {
} try {
Class.forName("de.luricos.bukkit.xAuth.xAuth");
newxAuthToFlat converter = new newxAuthToFlat(plugin, database, sender);
converter.run();
} catch (ClassNotFoundException ce) {
sender.sendMessage("[AuthMe] No version of xAuth found or xAuth isn't enable! ");
}
}
return true;
} else if (args[0].equalsIgnoreCase("getemail")) { } else if (args[0].equalsIgnoreCase("getemail")) {
if (args.length != 2) { if (args.length != 2) {
sender.sendMessage("Usage: /authme getemail playername"); sender.sendMessage("Usage: /authme getemail playername");
@ -343,6 +368,7 @@ public class AdminCommand implements CommandExecutor {
} catch (NullPointerException ex) { } catch (NullPointerException ex) {
ConsoleLogger.showError(ex.getMessage()); ConsoleLogger.showError(ex.getMessage());
} }
return true;
} else if (args[0].equalsIgnoreCase("setspawn")) { } else if (args[0].equalsIgnoreCase("setspawn")) {
try { try {
if (sender instanceof Player) { if (sender instanceof Player) {
@ -355,6 +381,7 @@ public class AdminCommand implements CommandExecutor {
} catch (NullPointerException ex) { } catch (NullPointerException ex) {
ConsoleLogger.showError(ex.getMessage()); ConsoleLogger.showError(ex.getMessage());
} }
return true;
} else if (args[0].equalsIgnoreCase("purgebannedplayers")) { } else if (args[0].equalsIgnoreCase("purgebannedplayers")) {
List<String> bannedPlayers = new ArrayList<String>(); List<String> bannedPlayers = new ArrayList<String>();
for (OfflinePlayer off : plugin.getServer().getBannedPlayers()) { for (OfflinePlayer off : plugin.getServer().getBannedPlayers()) {
@ -371,6 +398,15 @@ public class AdminCommand implements CommandExecutor {
} }
}); });
} }
if (Settings.purgeEssentialsFile && plugin.ess != null)
plugin.purgeEssentials(bannedPlayers);
if (Settings.purgePlayerDat)
plugin.purgeDat(bannedPlayers);
if (Settings.purgeLimitedCreative)
plugin.purgeLimitedCreative(bannedPlayers);
if (Settings.purgeAntiXray)
plugin.purgeAntiXray(bannedPlayers);
return true;
} else if (args[0].equalsIgnoreCase("spawn")) { } else if (args[0].equalsIgnoreCase("spawn")) {
try { try {
if (sender instanceof Player) { if (sender instanceof Player) {
@ -383,6 +419,7 @@ public class AdminCommand implements CommandExecutor {
} catch (NullPointerException ex) { } catch (NullPointerException ex) {
ConsoleLogger.showError(ex.getMessage()); ConsoleLogger.showError(ex.getMessage());
} }
return true;
} else if (args[0].equalsIgnoreCase("changepassword") || args[0].equalsIgnoreCase("cp")) { } else if (args[0].equalsIgnoreCase("changepassword") || args[0].equalsIgnoreCase("cp")) {
if (args.length != 3) { if (args.length != 3) {
sender.sendMessage("Usage: /authme changepassword playername newpassword"); sender.sendMessage("Usage: /authme changepassword playername newpassword");
@ -413,6 +450,7 @@ public class AdminCommand implements CommandExecutor {
ConsoleLogger.showError(ex.getMessage()); ConsoleLogger.showError(ex.getMessage());
sender.sendMessage(m._("error")); sender.sendMessage(m._("error"));
} }
return true;
} else if (args[0].equalsIgnoreCase("unregister") || args[0].equalsIgnoreCase("unreg") || args[0].equalsIgnoreCase("del") ) { } else if (args[0].equalsIgnoreCase("unregister") || args[0].equalsIgnoreCase("unreg") || args[0].equalsIgnoreCase("del") ) {
if (args.length != 2) { if (args.length != 2) {
sender.sendMessage("Usage: /authme unregister playername"); sender.sendMessage("Usage: /authme unregister playername");
@ -426,6 +464,49 @@ public class AdminCommand implements CommandExecutor {
PlayerCache.getInstance().removePlayer(name); PlayerCache.getInstance().removePlayer(name);
sender.sendMessage("unregistered"); sender.sendMessage("unregistered");
ConsoleLogger.info(args[1] + " unregistered"); ConsoleLogger.info(args[1] + " unregistered");
return true;
} else if (args[0].equalsIgnoreCase("purgelastpos")){
if (args.length != 2) {
sender.sendMessage("Usage: /authme purgelastpos playername");
return true;
}
try {
String name = args[1].toLowerCase();
PlayerAuth auth = database.getAuth(name);
if (auth == null) {
sender.sendMessage("The player " + name + " is not registered ");
return true;
}
auth.setQuitLocX(0);
auth.setQuitLocY(0);
auth.setQuitLocZ(0);
auth.setWorld("world");
database.updateQuitLoc(auth);
sender.sendMessage(name + " 's last pos location is now reset");
} catch (Exception e) {
ConsoleLogger.showError("An error occured while trying to reset location or player do not exist, please see below: ");
ConsoleLogger.showError(e.getMessage());
if (sender instanceof Player)
sender.sendMessage("An error occured while trying to reset location or player do not exist, please see logs");
}
return true;
} else if (args[0].equalsIgnoreCase("switchantibot")) {
if (args.length != 2) {
sender.sendMessage("Usage : /authme switchantibot on/off");
return true;
}
if (args[1].equalsIgnoreCase("on")) {
plugin.switchAntiBotMod(true);
sender.sendMessage("[AuthMe] AntiBotMod enabled");
return true;
}
if (args[1].equalsIgnoreCase("off")) {
plugin.switchAntiBotMod(false);
sender.sendMessage("[AuthMe] AntiBotMod disabled");
return true;
}
sender.sendMessage("Usage : /authme switchantibot on/off");
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

@ -59,7 +59,10 @@ public class ChangePasswordCommand implements CommandExecutor {
if (PasswordSecurity.comparePasswordWithHash(args[0], PlayerCache.getInstance().getAuth(name).getHash(), name)) { if (PasswordSecurity.comparePasswordWithHash(args[0], PlayerCache.getInstance().getAuth(name).getHash(), name)) {
PlayerAuth auth = PlayerCache.getInstance().getAuth(name); PlayerAuth auth = PlayerCache.getInstance().getAuth(name);
auth.setHash(hashnew); auth.setHash(hashnew);
auth.setSalt(PasswordSecurity.userSalt.get(name)); if (PasswordSecurity.userSalt.containsKey(name) && PasswordSecurity.userSalt.get(name) != null)
auth.setSalt(PasswordSecurity.userSalt.get(name));
else
auth.setSalt("");
if (!database.updatePassword(auth)) { if (!database.updatePassword(auth)) {
player.sendMessage(m._("error")); player.sendMessage(m._("error"));
return true; return true;

View File

@ -35,7 +35,7 @@ public class LoginCommand implements CommandExecutor {
player.sendMessage(m._("no_perm")); player.sendMessage(m._("no_perm"));
return true; return true;
} }
plugin.management.performLogin(player, args[0], false); plugin.management.performLogin(player, args[0], false, false);
return true; return true;
} }
} }

View File

@ -65,18 +65,14 @@ public class LogoutCommand implements CommandExecutor {
PlayerAuth auth = PlayerCache.getInstance().getAuth(name); PlayerAuth auth = PlayerCache.getInstance().getAuth(name);
auth.setIp("198.18.0.1"); auth.setIp("198.18.0.1");
database.updateSession(auth); database.updateSession(auth);
auth.setQuitLocX(player.getLocation().getBlockX());
auth.setQuitLocY(player.getLocation().getBlockY());
auth.setQuitLocZ(player.getLocation().getBlockZ());
auth.setWorld(player.getWorld().getName());
database.updateQuitLoc(auth);
PlayerCache.getInstance().removePlayer(name); PlayerCache.getInstance().removePlayer(name);
LimboCache.getInstance().addLimboPlayer(player , utils.removeAll(player));
LimboCache.getInstance().addLimboPlayer(player);
if(Settings.protectInventoryBeforeLogInEnabled) {
player.getInventory().setArmorContents(new ItemStack[4]);
player.getInventory().setContents(new ItemStack[36]);
// create cache file for handling lost of inventories on unlogged in status
DataFileCache playerData = new DataFileCache(player.getInventory().getContents(),player.getInventory().getArmorContents());
playerBackup.createCache(name, playerData, LimboCache.getInstance().getLimboPlayer(name).getGroup(),LimboCache.getInstance().getLimboPlayer(name).getOperator(),LimboCache.getInstance().getLimboPlayer(name).isFlying());
}
if (Settings.isTeleportToSpawnEnabled) { if (Settings.isTeleportToSpawnEnabled) {
Location spawnLoc = player.getWorld().getSpawnLocation(); Location spawnLoc = player.getWorld().getSpawnLocation();
if (plugin.essentialsSpawn != null) { if (plugin.essentialsSpawn != null) {
@ -94,6 +90,17 @@ public class LogoutCommand implements CommandExecutor {
} }
} }
if (LimboCache.getInstance().hasLimboPlayer(name))
LimboCache.getInstance().deleteLimboPlayer(name);
LimboCache.getInstance().addLimboPlayer(player , utils.removeAll(player));
LimboCache.getInstance().addLimboPlayer(player);
if(Settings.protectInventoryBeforeLogInEnabled) {
player.getInventory().clear();
// create cache file for handling lost of inventories on unlogged in status
DataFileCache playerData = new DataFileCache(LimboCache.getInstance().getLimboPlayer(name).getInventory(),LimboCache.getInstance().getLimboPlayer(name).getArmour());
playerBackup.createCache(name, playerData, LimboCache.getInstance().getLimboPlayer(name).getGroup(),LimboCache.getInstance().getLimboPlayer(name).getOperator(),LimboCache.getInstance().getLimboPlayer(name).isFlying());
}
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();

View File

@ -18,7 +18,7 @@ import fr.xephi.authme.settings.Messages;
public class PasspartuCommand implements CommandExecutor { public class PasspartuCommand implements CommandExecutor {
private Utils utils = new Utils(); private Utils utils = new Utils();
public AuthMe plugin; public AuthMe plugin;
private Messages m; private Messages m = Messages.getInstance();
public PasspartuCommand(AuthMe plugin) { public PasspartuCommand(AuthMe plugin) {
this.plugin = plugin; this.plugin = plugin;
@ -39,7 +39,7 @@ public class PasspartuCommand implements CommandExecutor {
if ((sender instanceof Player) && args.length == 1) { if ((sender instanceof Player) && args.length == 1) {
if(utils.readToken(args[0])) { if(utils.readToken(args[0])) {
//bypass login! //bypass login!
plugin.management.performLogin((Player) sender, "dontneed", true); plugin.management.performLogin((Player) sender, "dontneed", true, false);
return true; return true;
} }
sender.sendMessage("Time is expired or Token is Wrong!"); sender.sendMessage("Time is expired or Token is Wrong!");

View File

@ -126,7 +126,7 @@ public class RegisterCommand implements CommandExecutor {
if (PasswordSecurity.userSalt.containsKey(name)) { if (PasswordSecurity.userSalt.containsKey(name)) {
try { try {
final String hashnew = PasswordSecurity.getHash(Settings.getPasswordHash, thePass, name); final String hashnew = PasswordSecurity.getHash(Settings.getPasswordHash, thePass, name);
final PlayerAuth fAuth = new PlayerAuth(name, hashnew, PasswordSecurity.userSalt.get(name), ip, new Date().getTime(), (int) player.getLocation().getX() , (int) player.getLocation().getY(), (int) player.getLocation().getZ(), player.getLocation().getWorld().getName(), email); final PlayerAuth fAuth = new PlayerAuth(name, hashnew, PasswordSecurity.userSalt.get(name), ip, new Date().getTime(), (int) player.getLocation().getX() , (int) player.getLocation().getY(), (int) player.getLocation().getZ(), player.getLocation().getWorld().getName(), email, player.getName());
database.saveAuth(fAuth); database.saveAuth(fAuth);
database.updateEmail(fAuth); database.updateEmail(fAuth);
database.updateSession(fAuth); database.updateSession(fAuth);
@ -137,7 +137,7 @@ public class RegisterCommand implements CommandExecutor {
} else { } else {
try { try {
final String hashnew = PasswordSecurity.getHash(Settings.getPasswordHash, thePass, name); final String hashnew = PasswordSecurity.getHash(Settings.getPasswordHash, thePass, name);
final PlayerAuth fAuth = new PlayerAuth(name, hashnew, ip, new Date().getTime(), (int) player.getLocation().getX() , (int) player.getLocation().getY(), (int) player.getLocation().getZ(), player.getLocation().getWorld().getName(), email); final PlayerAuth fAuth = new PlayerAuth(name, hashnew, ip, new Date().getTime(), (int) player.getLocation().getX() , (int) player.getLocation().getY(), (int) player.getLocation().getZ(), player.getLocation().getWorld().getName(), email, player.getName());
database.saveAuth(fAuth); database.saveAuth(fAuth);
database.updateEmail(fAuth); database.updateEmail(fAuth);
database.updateSession(fAuth); database.updateSession(fAuth);
@ -216,9 +216,9 @@ public class RegisterCommand implements CommandExecutor {
hash = PasswordSecurity.getHash(Settings.getPasswordHash, args[0], name); hash = PasswordSecurity.getHash(Settings.getPasswordHash, args[0], name);
if (Settings.getMySQLColumnSalt.isEmpty()) if (Settings.getMySQLColumnSalt.isEmpty())
{ {
auth = new PlayerAuth(name, hash, ip, new Date().getTime()); auth = new PlayerAuth(name, hash, ip, new Date().getTime(), "your@email.com", player.getName());
} else { } else {
auth = new PlayerAuth(name, hash, PasswordSecurity.userSalt.get(name), ip, new Date().getTime()); auth = new PlayerAuth(name, hash, PasswordSecurity.userSalt.get(name), ip, new Date().getTime(), player.getName());
} }
if (!database.saveAuth(auth)) { if (!database.saveAuth(auth)) {
player.sendMessage(m._("error")); player.sendMessage(m._("error"));

View File

@ -77,6 +77,8 @@ public class FlatToSql {
newline = "INSERT INTO " + tableName + " VALUES (" + i + ", '" + args[0] + "', '" + args[1] + "', '" + args[2] + "', " + args[3] + ", " + args[4] + ", " + args[5] + ", " + args[6] + ", 'world', 'your@email.com');"; newline = "INSERT INTO " + tableName + " VALUES (" + i + ", '" + args[0] + "', '" + args[1] + "', '" + args[2] + "', " + args[3] + ", " + args[4] + ", " + args[5] + ", " + args[6] + ", 'world', 'your@email.com');";
else if (args.length == 8) else if (args.length == 8)
newline = "INSERT INTO " + tableName + " VALUES (" + i + ", '" + args[0] + "', '" + args[1] + "', '" + args[2] + "', " + args[3] + ", " + args[4] + ", " + args[5] + ", " + args[6] + ", '" + args[7] + "', 'your@email.com');"; newline = "INSERT INTO " + tableName + " VALUES (" + i + ", '" + args[0] + "', '" + args[1] + "', '" + args[2] + "', " + args[3] + ", " + args[4] + ", " + args[5] + ", " + args[6] + ", '" + args[7] + "', 'your@email.com');";
else if (args.length == 9)
newline = "INSERT INTO " + tableName + " VALUES (" + i + ", '" + args[0] + "', '" + args[1] + "', '" + args[2] + "', " + args[3] + ", " + args[4] + ", " + args[5] + ", " + args[6] + ", '" + args[7] + "', '" + args[8] + "');";
else else
newline = ""; newline = "";
if (newline != "") if (newline != "")

View File

@ -73,6 +73,8 @@ public class FlatToSqlite {
newline = "INSERT INTO " + tableName + " VALUES (" + i + ", '" + args[0] + "', '" + args[1] + "', '" + args[2] + "', " + args[3] + ", " + args[4] + ", " + args[5] + ", " + args[6] + ", 'world', 'your@email.com');"; newline = "INSERT INTO " + tableName + " VALUES (" + i + ", '" + args[0] + "', '" + args[1] + "', '" + args[2] + "', " + args[3] + ", " + args[4] + ", " + args[5] + ", " + args[6] + ", 'world', 'your@email.com');";
else if (args.length == 8) else if (args.length == 8)
newline = "INSERT INTO " + tableName + " VALUES (" + i + ", '" + args[0] + "', '" + args[1] + "', '" + args[2] + "', " + args[3] + ", " + args[4] + ", " + args[5] + ", " + args[6] + ", '" + args[7] + "', 'your@email.com');"; newline = "INSERT INTO " + tableName + " VALUES (" + i + ", '" + args[0] + "', '" + args[1] + "', '" + args[2] + "', " + args[3] + ", " + args[4] + ", " + args[5] + ", " + args[6] + ", '" + args[7] + "', 'your@email.com');";
else if (args.length == 9)
newline = "INSERT INTO " + tableName + " VALUES (" + i + ", '" + args[0] + "', '" + args[1] + "', '" + args[2] + "', " + args[3] + ", " + args[4] + ", " + args[5] + ", " + args[6] + ", '" + args[7] + "', '" + args[8] + "');";
else else
newline = ""; newline = "";
if (newline != "") if (newline != "")

View File

@ -94,12 +94,12 @@ public class RakamakConverter {
String player = m.getKey(); String player = m.getKey();
String psw = playerPSW.get(player); String psw = playerPSW.get(player);
String ip = playerIP.get(player); String ip = playerIP.get(player);
newLine = player + ":" + psw + ":" + ip + ":1325376060:0:0:0"; newLine = player + ":" + psw + ":" + ip + ":1325376060:0:0:0:world:your@email.com";
} else { } else {
String player = m.getKey(); String player = m.getKey();
String psw = playerPSW.get(player); String psw = playerPSW.get(player);
String ip = "127.0.0.1"; String ip = "127.0.0.1";
newLine = player + ":" + psw + ":" + ip + ":1325376060:0:0:0"; newLine = player + ":" + psw + ":" + ip + ":1325376060:0:0:0:world:your@email.com";
} }
if (alreadyExist) outputDB.newLine(); if (alreadyExist) outputDB.newLine();
outputDB.write(newLine); outputDB.write(newLine);

View File

@ -0,0 +1,137 @@
package fr.xephi.authme.converter;
import java.io.File;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.command.CommandSender;
import de.luricos.bukkit.xAuth.xAuth;
import de.luricos.bukkit.xAuth.database.Table;
import de.luricos.bukkit.xAuth.utils.xAuthLog;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.api.API;
import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.datasource.DataSource;
public class newxAuthToFlat extends Thread {
public AuthMe instance;
public DataSource database;
public CommandSender sender;
public newxAuthToFlat(AuthMe instance, DataSource database, CommandSender sender) {
this.instance = instance;
this.database = database;
this.sender = sender;
}
public void run() {
convert();
if (isAlive())
interrupt();
}
public boolean convert() {
if (instance.getServer().getPluginManager().getPlugin("xAuth") == null) {
sender.sendMessage("[AuthMe] xAuth plugin not found");
return false;
}
if (!(new File("./plugins/xAuth/xAuth.h2.db").exists())) {
sender.sendMessage("[AuthMe] xAuth H2 database not found, checking for MySQL or SQLite data...");
}
List<Integer> players = getXAuthPlayers();
if (players == null || players.isEmpty()) {
sender.sendMessage("[AuthMe] Error while import xAuthPlayers");
return false;
}
sender.sendMessage("[AuthMe] Starting import...");
try {
for (int id : players) {
String pl = getIdPlayer(id);
String psw = getPassword(id);
if (psw != null && !psw.isEmpty() && pl != null) {
PlayerAuth auth = new PlayerAuth(pl, psw, "198.18.0.1", 0, "your@email.com", API.getPlayerRealName(pl));
database.saveAuth(auth);
}
}
sender.sendMessage("[AuthMe] Successfull convert from xAuth database");
} catch (Exception e) {
sender.sendMessage("[AuthMe] An error has been thrown while import xAuth database, the import hadn't fail but can be not complete ");
}
return true;
}
public String getIdPlayer(int id) {
String realPass = "";
Connection conn = xAuth.getPlugin().getDatabaseController().getConnection();
PreparedStatement ps = null;
ResultSet rs = null;
try {
String sql = String.format("SELECT `playername` FROM `%s` WHERE `id` = ?",
xAuth.getPlugin().getDatabaseController().getTable(Table.ACCOUNT));
ps = conn.prepareStatement(sql);
ps.setInt(1, id);
rs = ps.executeQuery();
if (!rs.next())
return null;
realPass = rs.getString("playername").toLowerCase();
} catch (SQLException e) {
xAuthLog.severe("Failed to retrieve name for account: " + id, e);
return null;
} finally {
xAuth.getPlugin().getDatabaseController().close(conn, ps, rs);
}
return realPass;
}
public List<Integer> getXAuthPlayers() {
List<Integer> xP = new ArrayList<Integer>();
Connection conn = xAuth.getPlugin().getDatabaseController().getConnection();
PreparedStatement ps = null;
ResultSet rs = null;
try {
String sql = String.format("SELECT * FROM `%s`",
xAuth.getPlugin().getDatabaseController().getTable(Table.ACCOUNT));
ps = conn.prepareStatement(sql);
rs = ps.executeQuery();
while(rs.next()) {
xP.add(rs.getInt("id"));
}
} catch (SQLException e) {
xAuthLog.severe("Cannot import xAuthPlayers", e);
return new ArrayList<Integer>();
} finally {
xAuth.getPlugin().getDatabaseController().close(conn, ps, rs);
}
return xP;
}
public String getPassword(int accountId) {
String realPass = "";
Connection conn = xAuth.getPlugin().getDatabaseController().getConnection();
PreparedStatement ps = null;
ResultSet rs = null;
try {
String sql = String.format("SELECT `password`, `pwtype` FROM `%s` WHERE `id` = ?",
xAuth.getPlugin().getDatabaseController().getTable(Table.ACCOUNT));
ps = conn.prepareStatement(sql);
ps.setInt(1, accountId);
rs = ps.executeQuery();
if (!rs.next())
return null;
realPass = rs.getString("password");
} catch (SQLException e) {
xAuthLog.severe("Failed to retrieve password hash for account: " + accountId, e);
return null;
} finally {
xAuth.getPlugin().getDatabaseController().close(conn, ps, rs);
}
return realPass;
}
}

View File

@ -15,6 +15,7 @@ import com.cypherx.xauth.database.Table;
import com.cypherx.xauth.utils.xAuthLog; import com.cypherx.xauth.utils.xAuthLog;
import fr.xephi.authme.AuthMe; import fr.xephi.authme.AuthMe;
import fr.xephi.authme.api.API;
import fr.xephi.authme.cache.auth.PlayerAuth; import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.datasource.DataSource; import fr.xephi.authme.datasource.DataSource;
@ -23,17 +24,25 @@ import fr.xephi.authme.datasource.DataSource;
* *
* @author Xephi59 * @author Xephi59
*/ */
public class xAuthToFlat { public class oldxAuthToFlat extends Thread {
public AuthMe instance; public AuthMe instance;
public DataSource database; public DataSource database;
public CommandSender sender;
public xAuthToFlat(AuthMe instance, DataSource database) { public oldxAuthToFlat(AuthMe instance, DataSource database, CommandSender sender) {
this.instance = instance; this.instance = instance;
this.database = database; this.database = database;
this.sender = sender;
}
public void run() {
convert();
if (isAlive())
interrupt();
} }
public boolean convert(CommandSender sender) { public boolean convert() {
if (instance.getServer().getPluginManager().getPlugin("xAuth") == null) { if (instance.getServer().getPluginManager().getPlugin("xAuth") == null) {
sender.sendMessage("[AuthMe] xAuth plugin not found"); sender.sendMessage("[AuthMe] xAuth plugin not found");
return false; return false;
@ -47,15 +56,19 @@ public class xAuthToFlat {
return false; return false;
} }
sender.sendMessage("[AuthMe] Starting import..."); sender.sendMessage("[AuthMe] Starting import...");
for (int id : players) { try {
String pl = getIdPlayer(id); for (int id : players) {
String psw = getPassword(id); String pl = getIdPlayer(id);
if (psw != null && !psw.isEmpty() && pl != null) { String psw = getPassword(id);
PlayerAuth auth = new PlayerAuth(pl, psw, "198.18.0.1", 0); if (psw != null && !psw.isEmpty() && pl != null) {
database.saveAuth(auth); PlayerAuth auth = new PlayerAuth(pl, psw, "198.18.0.1", 0, "your@email.com", API.getPlayerRealName(pl));
database.saveAuth(auth);
}
} }
sender.sendMessage("[AuthMe] Successfull convert from xAuth database");
} catch (Exception e) {
sender.sendMessage("[AuthMe] An error has been thrown while import xAuth database, the import hadn't fail but can be not complete ");
} }
sender.sendMessage("[AuthMe] Import done!");
return true; return true;
} }

View File

@ -11,6 +11,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import fr.xephi.authme.ConsoleLogger; import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.api.API;
import fr.xephi.authme.cache.auth.PlayerAuth; import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.settings.Settings; import fr.xephi.authme.settings.Settings;
@ -19,9 +20,10 @@ public class FileDataSource implements DataSource {
/* file layout: /* file layout:
* *
* PLAYERNAME:HASHSUM:IP:LOGININMILLIESECONDS:LASTPOSX:LASTPOSY:LASTPOSZ:LASTPOSWORLD * PLAYERNAME:HASHSUM:IP:LOGININMILLIESECONDS:LASTPOSX:LASTPOSY:LASTPOSZ:LASTPOSWORLD:EMAIL
* *
* Old but compatible: * Old but compatible:
* PLAYERNAME:HASHSUM:IP:LOGININMILLIESECONDS:LASTPOSX:LASTPOSY:LASTPOSZ:LASTPOSWORLD
* PLAYERNAME:HASHSUM:IP:LOGININMILLIESECONDS * PLAYERNAME:HASHSUM:IP:LOGININMILLIESECONDS
* PLAYERNAME:HASHSUM:IP * PLAYERNAME:HASHSUM:IP
* PLAYERNAME:HASHSUM * PLAYERNAME:HASHSUM
@ -71,7 +73,7 @@ public class FileDataSource implements DataSource {
BufferedWriter bw = null; BufferedWriter bw = null;
try { try {
bw = new BufferedWriter(new FileWriter(source, true)); bw = new BufferedWriter(new FileWriter(source, true));
bw.write(auth.getNickname() + ":" + auth.getHash() + ":" + auth.getIp() + ":" + auth.getLastLogin() + ":" + auth.getQuitLocX() + ":" + auth.getQuitLocY() + ":" + auth.getQuitLocZ() + ":" + auth.getWorld() + "\n"); bw.write(auth.getNickname() + ":" + auth.getHash() + ":" + auth.getIp() + ":" + auth.getLastLogin() + ":" + auth.getQuitLocX() + ":" + auth.getQuitLocY() + ":" + auth.getQuitLocZ() + ":" + auth.getWorld() + ":" + auth.getEmail() + "\n");
} catch (IOException ex) { } catch (IOException ex) {
ConsoleLogger.showError(ex.getMessage()); ConsoleLogger.showError(ex.getMessage());
return false; return false;
@ -101,19 +103,23 @@ public class FileDataSource implements DataSource {
if (args[0].equals(auth.getNickname())) { if (args[0].equals(auth.getNickname())) {
switch (args.length) { switch (args.length) {
case 4: { case 4: {
newAuth = new PlayerAuth(args[0], auth.getHash(), args[2], Long.parseLong(args[3]), 0, 0, 0, "world"); newAuth = new PlayerAuth(args[0], auth.getHash(), args[2], Long.parseLong(args[3]), 0, 0, 0, "world", "your@email.com", API.getPlayerRealName(args[0]));
break; break;
} }
case 7: { case 7: {
newAuth = new PlayerAuth(args[0], auth.getHash(), args[2], Long.parseLong(args[3]), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), "world"); newAuth = new PlayerAuth(args[0], auth.getHash(), args[2], Long.parseLong(args[3]), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), "world", "your@email.com", API.getPlayerRealName(args[0]));
break; break;
} }
case 8: { case 8: {
newAuth = new PlayerAuth(args[0], auth.getHash(), args[2], Long.parseLong(args[3]), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), args[7]); newAuth = new PlayerAuth(args[0], auth.getHash(), args[2], Long.parseLong(args[3]), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), args[7], "your@email.com", API.getPlayerRealName(args[0]));
break;
}
case 9: {
newAuth = new PlayerAuth(args[0], auth.getHash(), args[2], Long.parseLong(args[3]), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), args[7], args[8], API.getPlayerRealName(args[0]));
break; break;
} }
default: { default: {
newAuth = new PlayerAuth(args[0], auth.getHash(), args[2], 0, 0, 0, 0, "world"); newAuth = new PlayerAuth(args[0], auth.getHash(), args[2], 0, 0, 0, 0, "world", "your@email.com", API.getPlayerRealName(args[0]));
break; break;
} }
} }
@ -154,19 +160,23 @@ public class FileDataSource implements DataSource {
if (args[0].equals(auth.getNickname())) { if (args[0].equals(auth.getNickname())) {
switch (args.length) { switch (args.length) {
case 4: { case 4: {
newAuth = new PlayerAuth(args[0], args[1], auth.getIp(), auth.getLastLogin(), 0, 0, 0, "world"); newAuth = new PlayerAuth(args[0], args[1], auth.getIp(), auth.getLastLogin(), 0, 0, 0, "world", "your@email.com", API.getPlayerRealName(args[0]));
break; break;
} }
case 7: { case 7: {
newAuth = new PlayerAuth(args[0], args[1], auth.getIp(), auth.getLastLogin(), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), "world"); newAuth = new PlayerAuth(args[0], args[1], auth.getIp(), auth.getLastLogin(), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), "world", "your@email.com", API.getPlayerRealName(args[0]));
break; break;
} }
case 8: { case 8: {
newAuth = new PlayerAuth(args[0], args[1], auth.getIp(), auth.getLastLogin(), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), args[7]); newAuth = new PlayerAuth(args[0], args[1], auth.getIp(), auth.getLastLogin(), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), args[7], "your@email.com", API.getPlayerRealName(args[0]));
break;
}
case 9: {
newAuth = new PlayerAuth(args[0], args[1], auth.getIp(), auth.getLastLogin(), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), args[7], args[8], API.getPlayerRealName(args[0]));
break; break;
} }
default: { default: {
newAuth = new PlayerAuth(args[0], args[1], auth.getIp(), auth.getLastLogin(), 0, 0, 0, "world"); newAuth = new PlayerAuth(args[0], args[1], auth.getIp(), auth.getLastLogin(), 0, 0, 0, "world", "your@email.com", API.getPlayerRealName(args[0]));
break; break;
} }
} }
@ -205,7 +215,7 @@ public class FileDataSource implements DataSource {
while ((line = br.readLine()) != null) { while ((line = br.readLine()) != null) {
String[] args = line.split(":"); String[] args = line.split(":");
if (args[0].equals(auth.getNickname())) { if (args[0].equals(auth.getNickname())) {
newAuth = new PlayerAuth(args[0], args[1], args[2], Long.parseLong(args[3]), auth.getQuitLocX(), auth.getQuitLocY(), auth.getQuitLocZ(), auth.getWorld()); newAuth = new PlayerAuth(args[0], args[1], args[2], Long.parseLong(args[3]), auth.getQuitLocX(), auth.getQuitLocY(), auth.getQuitLocZ(), auth.getWorld(), auth.getEmail(), API.getPlayerRealName(args[0]));
break; break;
} }
} }
@ -407,15 +417,17 @@ public class FileDataSource implements DataSource {
if (args[0].equals(user)) { if (args[0].equals(user)) {
switch (args.length) { switch (args.length) {
case 2: case 2:
return new PlayerAuth(args[0], args[1], "198.18.0.1", 0); return new PlayerAuth(args[0], args[1], "198.18.0.1", 0, "your@email.com", API.getPlayerRealName(args[0]));
case 3: case 3:
return new PlayerAuth(args[0], args[1], args[2], 0); return new PlayerAuth(args[0], args[1], args[2], 0, "your@email.com", API.getPlayerRealName(args[0]));
case 4: case 4:
return new PlayerAuth(args[0], args[1], args[2], Long.parseLong(args[3])); return new PlayerAuth(args[0], args[1], args[2], Long.parseLong(args[3]), "your@email.com", API.getPlayerRealName(args[0]));
case 7: case 7:
return new PlayerAuth(args[0], args[1], args[2], Long.parseLong(args[3]), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), "unavailableworld"); return new PlayerAuth(args[0], args[1], args[2], Long.parseLong(args[3]), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), "unavailableworld", "your@email.com", API.getPlayerRealName(args[0]));
case 8: case 8:
return new PlayerAuth(args[0], args[1], args[2], Long.parseLong(args[3]), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), args[7]); return new PlayerAuth(args[0], args[1], args[2], Long.parseLong(args[3]), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), args[7], "your@email.com", API.getPlayerRealName(args[0]));
case 9:
return new PlayerAuth(args[0], args[1], args[2], Long.parseLong(args[3]), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), args[7], args[8], API.getPlayerRealName(args[0]));
} }
} }
} }
@ -446,7 +458,38 @@ public class FileDataSource implements DataSource {
@Override @Override
public boolean updateEmail(PlayerAuth auth) { public boolean updateEmail(PlayerAuth auth) {
return false; if (!isAuthAvailable(auth.getNickname())) {
return false;
}
PlayerAuth newAuth = null;
BufferedReader br = null;
try {
br = new BufferedReader(new FileReader(source));
String line = "";
while ((line = br.readLine()) != null) {
String[] args = line.split(":");
if (args[0].equals(auth.getNickname())) {
newAuth = new PlayerAuth(args[0], args[1], args[2], Long.parseLong(args[3]), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), args[7], auth.getEmail(), API.getPlayerRealName(args[0]));
break;
}
}
} catch (FileNotFoundException ex) {
ConsoleLogger.showError(ex.getMessage());
return false;
} catch (IOException ex) {
ConsoleLogger.showError(ex.getMessage());
return false;
} finally {
if (br != null) {
try {
br.close();
} catch (IOException ex) {
}
}
}
removeAuth(auth.getNickname());
saveAuth(newAuth);
return true;
} }
@Override @Override
@ -511,12 +554,37 @@ public class FileDataSource implements DataSource {
} catch (IOException ex) { } catch (IOException ex) {
} }
} }
} }
} }
@Override @Override
public List<String> getAllAuthsByEmail(String email) { public List<String> getAllAuthsByEmail(String email) {
return new ArrayList<String>(); BufferedReader br = null;
List<String> countEmail = new ArrayList<String>();
try {
br = new BufferedReader(new FileReader(source));
String line;
while ((line = br.readLine()) != null) {
String[] args = line.split(":");
if (args.length > 8 && args[8].equals(email)) {
countEmail.add(args[0]);
}
}
return countEmail;
} catch (FileNotFoundException ex) {
ConsoleLogger.showError(ex.getMessage());
return new ArrayList<String>();
} catch (IOException ex) {
ConsoleLogger.showError(ex.getMessage());
return new ArrayList<String>();
} finally {
if (br != null) {
try {
br.close();
} catch (IOException ex) {
}
}
}
} }
@Override @Override

View File

@ -4,6 +4,7 @@ import com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource;
import fr.xephi.authme.AuthMe; import fr.xephi.authme.AuthMe;
import fr.xephi.authme.ConsoleLogger; import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.api.API;
import fr.xephi.authme.cache.auth.PlayerAuth; import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.datasource.MiniConnectionPoolManager.TimeoutException; import fr.xephi.authme.datasource.MiniConnectionPoolManager.TimeoutException;
import fr.xephi.authme.security.HashAlgorithm; import fr.xephi.authme.security.HashAlgorithm;
@ -177,14 +178,14 @@ public class MySQLDataSource implements DataSource {
rs = pst.executeQuery(); rs = pst.executeQuery();
if (rs.next()) { if (rs.next()) {
if (rs.getString(columnIp).isEmpty() ) { if (rs.getString(columnIp).isEmpty() ) {
return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword), "198.18.0.1", rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld),rs.getString(columnEmail)); return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword), "198.18.0.1", rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld),rs.getString(columnEmail), API.getPlayerRealName(rs.getString(columnName)));
} else { } else {
if(!columnSalt.isEmpty()){ if(!columnSalt.isEmpty()){
if(!columnGroup.isEmpty()) if(!columnGroup.isEmpty())
return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword),rs.getString(columnSalt), rs.getInt(columnGroup), rs.getString(columnIp), rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld), rs.getString(columnEmail)); return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword),rs.getString(columnSalt), rs.getInt(columnGroup), rs.getString(columnIp), rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld), rs.getString(columnEmail), API.getPlayerRealName(rs.getString(columnName)));
else return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword),rs.getString(columnSalt), rs.getString(columnIp), rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld),rs.getString(columnEmail)); else return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword),rs.getString(columnSalt), rs.getString(columnIp), rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld),rs.getString(columnEmail), API.getPlayerRealName(rs.getString(columnName)));
} else { } else {
return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword), rs.getString(columnIp), rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld), rs.getString(columnEmail)); return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword), rs.getString(columnIp), rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld), rs.getString(columnEmail), API.getPlayerRealName(rs.getString(columnName)));
} }
} }
} else { } else {
@ -209,7 +210,7 @@ public class MySQLDataSource implements DataSource {
PreparedStatement pst = null; PreparedStatement pst = null;
try { try {
con = makeSureConnectionIsReady(); con = makeSureConnectionIsReady();
if ((columnSalt.isEmpty() || columnSalt == null) && (auth.getSalt().isEmpty() || auth.getSalt() == null)) { if ((columnSalt == null || columnSalt.isEmpty()) && (auth.getSalt() == null || auth.getSalt().isEmpty())) {
pst = con.prepareStatement("INSERT INTO " + tableName + "(" + columnName + "," + columnPassword + "," + columnIp + "," + columnLastLogin + ") VALUES (?,?,?,?);"); pst = con.prepareStatement("INSERT INTO " + tableName + "(" + columnName + "," + columnPassword + "," + columnIp + "," + columnLastLogin + ") VALUES (?,?,?,?);");
pst.setString(1, auth.getNickname()); pst.setString(1, auth.getNickname());
pst.setString(2, auth.getHash()); pst.setString(2, auth.getHash());
@ -227,8 +228,8 @@ public class MySQLDataSource implements DataSource {
} }
if (!columnOthers.isEmpty()) { if (!columnOthers.isEmpty()) {
for(String column : columnOthers) { for(String column : columnOthers) {
pst = con.prepareStatement("UPDATE " + tableName + " SET " + tableName + "." + column + "=? WHERE " + columnName + "=?;"); pst = con.prepareStatement("UPDATE " + tableName + " SET " + column + "=? WHERE " + columnName + "=?;");
pst.setString(1, auth.getNickname()); pst.setString(1, auth.getRealname());
pst.setString(2, auth.getNickname()); pst.setString(2, auth.getNickname());
pst.executeUpdate(); pst.executeUpdate();
} }
@ -241,12 +242,30 @@ public class MySQLDataSource implements DataSource {
rs = pst.executeQuery(); rs = pst.executeQuery();
if (rs.next()) { if (rs.next()) {
id = rs.getInt(columnID); id = rs.getInt(columnID);
// Insert player in phpbb_user_group
pst = con.prepareStatement("INSERT INTO " + Settings.getPhpbbPrefix + "user_group (group_id, user_id, group_leader, user_pending) VALUES (?,?,?,?);"); pst = con.prepareStatement("INSERT INTO " + Settings.getPhpbbPrefix + "user_group (group_id, user_id, group_leader, user_pending) VALUES (?,?,?,?);");
pst.setInt(1, Settings.getPhpbbGroup); pst.setInt(1, Settings.getPhpbbGroup);
pst.setInt(2, id); pst.setInt(2, id);
pst.setInt(3, 0); pst.setInt(3, 0);
pst.setInt(4, 0); pst.setInt(4, 0);
pst.executeUpdate(); pst.executeUpdate();
// Update player group in phpbb_users
pst = con.prepareStatement("UPDATE " + tableName + " SET " + tableName + ".group_id=? WHERE " + columnName + "=?;");
pst.setInt(1, Settings.getPhpbbGroup);
pst.setString(2, auth.getNickname());
pst.executeUpdate();
// Get current time without ms
long time = System.currentTimeMillis()/1000;
// Update user_regdate
pst = con.prepareStatement("UPDATE " + tableName + " SET " + tableName + ".user_regdate=? WHERE " + columnName + "=?;");
pst.setLong(1, time);
pst.setString(2, auth.getNickname());
pst.executeUpdate();
// Update user_lastvisit
pst = con.prepareStatement("UPDATE " + tableName + " SET " + tableName + ".user_lastvisit=? WHERE " + columnName + "=?;");
pst.setLong(1, time);
pst.setString(2, auth.getNickname());
pst.executeUpdate();
} }
} }
if (Settings.getPasswordHash == HashAlgorithm.WORDPRESS) { if (Settings.getPasswordHash == HashAlgorithm.WORDPRESS) {
@ -426,6 +445,9 @@ public class MySQLDataSource implements DataSource {
while (rs.next()) { while (rs.next()) {
list.add(rs.getString(columnName)); list.add(rs.getString(columnName));
} }
pst = con.prepareStatement("DELETE FROM " + tableName + " WHERE " + columnLastLogin + "<?;");
pst.setLong(1, until);
pst.executeUpdate();
return list; return list;
} catch (SQLException ex) { } catch (SQLException ex) {
ConsoleLogger.showError(ex.getMessage()); ConsoleLogger.showError(ex.getMessage());

View File

@ -7,6 +7,7 @@ import java.util.List;
import org.sqlite.*; import org.sqlite.*;
import fr.xephi.authme.ConsoleLogger; import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.api.API;
import fr.xephi.authme.cache.auth.PlayerAuth; import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.datasource.MiniConnectionPoolManager.TimeoutException; import fr.xephi.authme.datasource.MiniConnectionPoolManager.TimeoutException;
import fr.xephi.authme.settings.Settings; import fr.xephi.authme.settings.Settings;
@ -147,12 +148,12 @@ public class SqliteDataSource implements DataSource {
rs = pst.executeQuery(); rs = pst.executeQuery();
if (rs.next()) { if (rs.next()) {
if (rs.getString(columnIp).isEmpty() ) { if (rs.getString(columnIp).isEmpty() ) {
return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword), "198.18.0.1", rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld) , rs.getString(columnEmail)); return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword), "198.18.0.1", rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld) , rs.getString(columnEmail), API.getPlayerRealName(rs.getString(columnName)));
} else { } else {
if(!columnSalt.isEmpty()){ if(!columnSalt.isEmpty()){
return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword),rs.getString(columnSalt), rs.getInt(columnGroup), rs.getString(columnIp), rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld) , rs.getString(columnEmail)); return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword),rs.getString(columnSalt), rs.getInt(columnGroup), rs.getString(columnIp), rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld) , rs.getString(columnEmail), API.getPlayerRealName(rs.getString(columnName)));
} else { } else {
return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword), rs.getString(columnIp), rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld) , rs.getString(columnEmail)); return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword), rs.getString(columnIp), rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld) , rs.getString(columnEmail), API.getPlayerRealName(rs.getString(columnName)));
} }
} }
} else { } else {

View File

@ -41,4 +41,8 @@ public class LoginEvent extends Event {
return handlers; return handlers;
} }
public static HandlerList getHandlerList() {
return handlers;
}
} }

View File

@ -41,4 +41,8 @@ public class PasswordEncryptionEvent extends Event {
return playerName; return playerName;
} }
public static HandlerList getHandlerList() {
return handlers;
}
} }

View File

@ -117,7 +117,7 @@ public class LoginScreen extends GenericPopup implements Clickable{
if (event.isCancelled() || event == null || event.getPlayer() == null) return; if (event.isCancelled() || event == null || event.getPlayer() == null) return;
if (b.equals(loginBtn)) if (b.equals(loginBtn))
{ {
plugin.management.performLogin(player, passBox.getText(), false); plugin.management.performLogin(player, passBox.getText(), false, false);
}else if(b.equals(exitBtn)) }else if(b.equals(exitBtn))
{ {
event.getPlayer().kickPlayer(exitMsg); event.getPlayer().kickPlayer(exitMsg);

View File

@ -8,6 +8,7 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.Utils; import fr.xephi.authme.Utils;
import fr.xephi.authme.cache.auth.PlayerCache; import fr.xephi.authme.cache.auth.PlayerCache;
import fr.xephi.authme.datasource.DataSource; import fr.xephi.authme.datasource.DataSource;
@ -16,9 +17,11 @@ import fr.xephi.authme.settings.Settings;
public class AuthMeBungeeCordListener implements Listener { public class AuthMeBungeeCordListener implements Listener {
private DataSource data; private DataSource data;
private AuthMe plugin;
public AuthMeBungeeCordListener(DataSource data) { public AuthMeBungeeCordListener(DataSource data, AuthMe plugin) {
this.data = data; this.data = data;
this.plugin = plugin;
} }
@EventHandler (priority = EventPriority.LOWEST) @EventHandler (priority = EventPriority.LOWEST)
@ -27,9 +30,20 @@ public class AuthMeBungeeCordListener implements Listener {
if (event.isCancelled()) return; if (event.isCancelled()) return;
if (!event.isCommand()) return; if (!event.isCommand()) return;
Player player = null; Player player = null;
for (Player p : Bukkit.getServer().getOnlinePlayers()) { try {
if (p.getAddress().getAddress().equals(event.getReceiver().getAddress().getAddress())) { for (String p : plugin.realIp.keySet()) {
player = p; Player pl = Bukkit.getPlayer(p);
if (pl != null) {
if (plugin.realIp.get(p).equalsIgnoreCase(event.getSender().getAddress().getAddress().getHostAddress()))
player = pl;
}
}
} catch (Exception e) {}
if (player == null) {
for (Player p : Bukkit.getServer().getOnlinePlayers()) {
if (p.getAddress().getAddress().equals(event.getSender().getAddress().getAddress())) {
player = p;
}
} }
} }
String name = player.getName().toLowerCase(); String name = player.getName().toLowerCase();

View File

@ -24,6 +24,7 @@ import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.event.player.PlayerBedEnterEvent; import org.bukkit.event.player.PlayerBedEnterEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerDropItemEvent; import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerGameModeChangeEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerJoinEvent;
@ -65,11 +66,14 @@ public class AuthMePlayerListener implements Listener {
public static int gm = 0; public static int gm = 0;
public static HashMap<String, Integer> gameMode = new HashMap<String, Integer>(); public static HashMap<String, Integer> gameMode = new HashMap<String, Integer>();
public static HashMap<String, String> joinMessage = new HashMap<String, String>();
private Utils utils = Utils.getInstance(); private Utils utils = Utils.getInstance();
private Messages m = Messages.getInstance(); private Messages m = Messages.getInstance();
public AuthMe plugin; public AuthMe plugin;
private DataSource data; private DataSource data;
private FileCache playerBackup = new FileCache(); private FileCache playerBackup = new FileCache();
public boolean causeByAuthMe = false;
private HashMap<String, PlayerLoginEvent> antibot = new HashMap<String, PlayerLoginEvent>();
public AuthMePlayerListener(AuthMe plugin, DataSource data) { public AuthMePlayerListener(AuthMe plugin, DataSource data) {
this.plugin = plugin; this.plugin = plugin;
@ -384,6 +388,21 @@ public class AuthMePlayerListener implements Listener {
return; return;
} }
if (Settings.enableProtection && !Settings.countries.isEmpty()) {
String code = plugin.getCountryCode(event.getAddress());
if (((code == null) || (!Settings.countries.contains(code) && !API.isRegistered(name))) && !plugin.authmePermissible(player, "authme.bypassantibot")) {
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, m._("country_banned"));
return;
}
}
if (Settings.isKickNonRegisteredEnabled) {
if (!data.isAuthAvailable(name)) {
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, m._("reg_only"));
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"));
return; return;
@ -442,11 +461,19 @@ public class AuthMePlayerListener implements Listener {
return; return;
} }
if (Settings.isKickNonRegisteredEnabled) { if (event.getResult() == PlayerLoginEvent.Result.ALLOWED) {
if (!data.isAuthAvailable(name)) { checkAntiBotMod(event);
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, m._("reg_only")); if (Settings.bungee) {
return; final ByteArrayOutputStream b = new ByteArrayOutputStream();
DataOutputStream out = new DataOutputStream(b);
try {
out.writeUTF("IP");
} catch (IOException e) {
}
player.sendPluginMessage(plugin, "BungeeCord", b.toByteArray());
} }
return;
} }
if (event.getResult() != PlayerLoginEvent.Result.KICK_FULL) return; if (event.getResult() != PlayerLoginEvent.Result.KICK_FULL) return;
if (player.isBanned()) return; if (player.isBanned()) return;
@ -467,34 +494,38 @@ public class AuthMePlayerListener implements Listener {
} 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"));
return;
} }
} }
} }
@EventHandler(priority = EventPriority.LOWEST) private void checkAntiBotMod(final PlayerLoginEvent event) {
public void onPlayerLowestJoin(PlayerJoinEvent event) { if (plugin.delayedAntiBot || plugin.antibotMod)
if (event.getPlayer() == null) return; return;
final Player player = event.getPlayer(); if (plugin.authmePermissible(event.getPlayer(), "authme.bypassantibot"))
return;
if (plugin.getCitizensCommunicator().isNPC(player, plugin) || Utils.getInstance().isUnrestricted(player) || CombatTagComunicator.isNPC(player)) { if (antibot.keySet().size() > Settings.antiBotSensibility) {
return; plugin.switchAntiBotMod(true);
} Bukkit.broadcastMessage(m._("antibot_auto_enabled"));
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
if (Settings.bungee) { @Override
final ByteArrayOutputStream b = new ByteArrayOutputStream(); public void run() {
DataOutputStream out = new DataOutputStream(b); if (plugin.antibotMod) {
plugin.switchAntiBotMod(false);
try { antibot.clear();
out.writeUTF("IP"); Bukkit.broadcastMessage(m._("antibot_auto_disabled").replace("%m", "" + Settings.antiBotDuration));
} catch (IOException e) { }
} }
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { }, Settings.antiBotDuration * 1200);
@Override return;
public void run() { }
player.sendPluginMessage(plugin, "BungeeCord", b.toByteArray()); antibot.put(event.getPlayer().getName().toLowerCase(), event);
} Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
}); @Override
} public void run() {
antibot.remove(event.getPlayer().getName().toLowerCase());
}
}, 300);
} }
@EventHandler(priority = EventPriority.HIGHEST) @EventHandler(priority = EventPriority.HIGHEST)
@ -510,14 +541,16 @@ public class AuthMePlayerListener implements Listener {
final String name = player.getName().toLowerCase(); final String name = player.getName().toLowerCase();
gameMode.put(name, gm); gameMode.put(name, gm);
BukkitScheduler sched = plugin.getServer().getScheduler(); BukkitScheduler sched = plugin.getServer().getScheduler();
final PlayerJoinEvent e = event;
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;
} }
if (plugin.ess != null && Settings.disableSocialSpy) if (plugin.ess != null && Settings.disableSocialSpy) {
plugin.ess.getUser(player.getName()).setSocialSpyEnabled(false); try {
plugin.ess.getUser(player.getName()).setSocialSpyEnabled(false);
} catch (Exception e) {}
}
String ip = player.getAddress().getAddress().getHostAddress(); String ip = player.getAddress().getAddress().getHostAddress();
if (Settings.bungee) { if (Settings.bungee) {
@ -526,7 +559,9 @@ public class AuthMePlayerListener implements Listener {
} }
if(Settings.isAllowRestrictedIp && !Settings.getRestrictedIp(name, ip)) { if(Settings.isAllowRestrictedIp && !Settings.getRestrictedIp(name, ip)) {
int gM = gameMode.get(name); int gM = gameMode.get(name);
this.causeByAuthMe = true;
player.setGameMode(GameMode.getByValue(gM)); player.setGameMode(GameMode.getByValue(gM));
this.causeByAuthMe = false;
player.kickPlayer("You are not the Owner of this account, please try another name!"); player.kickPlayer("You are not the Owner of this account, please try another name!");
if (Settings.banUnsafeIp) if (Settings.banUnsafeIp)
plugin.getServer().banIP(ip); plugin.getServer().banIP(ip);
@ -550,22 +585,25 @@ public class AuthMePlayerListener implements Listener {
return; return;
} else if (!Settings.sessionExpireOnIpChange){ } else if (!Settings.sessionExpireOnIpChange){
int gM = gameMode.get(name); int gM = gameMode.get(name);
this.causeByAuthMe = true;
player.setGameMode(GameMode.getByValue(gM)); player.setGameMode(GameMode.getByValue(gM));
this.causeByAuthMe = false;
player.kickPlayer(m._("unvalid_session")); player.kickPlayer(m._("unvalid_session"));
return; return;
} else if (auth.getNickname().equalsIgnoreCase(name)){ } else if (auth.getNickname().equalsIgnoreCase(name)){
if (Settings.isForceSurvivalModeEnabled && !Settings.forceOnlyAfterLogin) if (Settings.isForceSurvivalModeEnabled && !Settings.forceOnlyAfterLogin) {
sched.scheduleSyncDelayedTask(plugin, new Runnable() { this.causeByAuthMe = true;
public void run() { Utils.forceGM(player);
e.getPlayer().setGameMode(GameMode.SURVIVAL); this.causeByAuthMe = false;
} }
});
//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)); LimboCache.getInstance().addLimboPlayer(player , utils.removeAll(player));
} else { } else {
int gM = gameMode.get(name); int gM = gameMode.get(name);
this.causeByAuthMe = true;
player.setGameMode(GameMode.getByValue(gM)); player.setGameMode(GameMode.getByValue(gM));
this.causeByAuthMe = false;
player.kickPlayer(m._("unvalid_session")); player.kickPlayer(m._("unvalid_session"));
return; return;
} }
@ -576,8 +614,11 @@ public class AuthMePlayerListener implements Listener {
} }
} }
// isent in session or session was ended correctly // isent in session or session was ended correctly
if (Settings.isForceSurvivalModeEnabled && !Settings.forceOnlyAfterLogin) if (Settings.isForceSurvivalModeEnabled && !Settings.forceOnlyAfterLogin) {
e.getPlayer().setGameMode(GameMode.SURVIVAL); this.causeByAuthMe = true;
Utils.forceGM(player);
this.causeByAuthMe = false;
}
if (Settings.isTeleportToSpawnEnabled || (Settings.isForceSpawnLocOnJoinEnabled && Settings.getForcedWorlds.contains(player.getWorld().getName()))) { if (Settings.isTeleportToSpawnEnabled || (Settings.isForceSpawnLocOnJoinEnabled && Settings.getForcedWorlds.contains(player.getWorld().getName()))) {
SpawnTeleportEvent tpEvent = new SpawnTeleportEvent(player, player.getLocation(), spawnLoc, PlayerCache.getInstance().isAuthenticated(name)); SpawnTeleportEvent tpEvent = new SpawnTeleportEvent(player, player.getLocation(), spawnLoc, PlayerCache.getInstance().isAuthenticated(name));
plugin.getServer().getPluginManager().callEvent(tpEvent); plugin.getServer().getPluginManager().callEvent(tpEvent);
@ -593,8 +634,11 @@ public class AuthMePlayerListener implements Listener {
DataFileCache dataFile = new DataFileCache(LimboCache.getInstance().getLimboPlayer(name).getInventory(),LimboCache.getInstance().getLimboPlayer(name).getArmour()); DataFileCache dataFile = new DataFileCache(LimboCache.getInstance().getLimboPlayer(name).getInventory(),LimboCache.getInstance().getLimboPlayer(name).getArmour());
playerBackup.createCache(name, dataFile, LimboCache.getInstance().getLimboPlayer(name).getGroup(),LimboCache.getInstance().getLimboPlayer(name).getOperator(),LimboCache.getInstance().getLimboPlayer(name).isFlying()); playerBackup.createCache(name, dataFile, LimboCache.getInstance().getLimboPlayer(name).getGroup(),LimboCache.getInstance().getLimboPlayer(name).getOperator(),LimboCache.getInstance().getLimboPlayer(name).isFlying());
} else { } else {
if (Settings.isForceSurvivalModeEnabled && !Settings.forceOnlyAfterLogin) if (Settings.isForceSurvivalModeEnabled && !Settings.forceOnlyAfterLogin) {
e.getPlayer().setGameMode(GameMode.SURVIVAL); this.causeByAuthMe = true;
Utils.forceGM(player);
this.causeByAuthMe = false;
}
if(!Settings.unRegisteredGroup.isEmpty()){ if(!Settings.unRegisteredGroup.isEmpty()){
utils.setGroup(player, Utils.groupType.UNREGISTERED); utils.setGroup(player, Utils.groupType.UNREGISTERED);
} }
@ -643,6 +687,10 @@ public class AuthMePlayerListener implements Listener {
player.setNoDamageTicks(Settings.getRegistrationTimeout * 20); player.setNoDamageTicks(Settings.getRegistrationTimeout * 20);
if (Settings.useEssentialsMotd) if (Settings.useEssentialsMotd)
player.performCommand("motd"); player.performCommand("motd");
// Remove the join message while the player isn't logging in
joinMessage.put(name, event.getJoinMessage());
event.setJoinMessage(null);
} }
private void placePlayerSafely(Player player, Location spawnLoc) { private void placePlayerSafely(Player player, Location spawnLoc) {
@ -688,7 +736,9 @@ public class AuthMePlayerListener implements Listener {
} }
} catch (NullPointerException npe) { } } catch (NullPointerException npe) { }
} }
} } else {
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);
@ -762,6 +812,8 @@ public class AuthMePlayerListener implements Listener {
}); });
} }
} catch (NullPointerException npe) { } } catch (NullPointerException npe) { }
} else if (!PlayerCache.getInstance().isAuthenticated(name)){
event.setLeaveMessage(null);
} }
if (LimboCache.getInstance().hasLimboPlayer(name)) if (LimboCache.getInstance().hasLimboPlayer(name))
@ -1040,12 +1092,48 @@ public class AuthMePlayerListener implements Listener {
if (!data.isAuthAvailable(name)) if (!data.isAuthAvailable(name))
if (!Settings.isForcedRegistrationEnabled) if (!Settings.isForcedRegistrationEnabled)
return; return;
if (!Settings.isTeleportToSpawnEnabled && !Settings.isForceSpawnLocOnJoinEnabled)
return;
Location spawn = plugin.getSpawnLocation(player.getWorld()); Location spawn = plugin.getSpawnLocation(player.getWorld());
if(Settings.isSaveQuitLocationEnabled && data.isAuthAvailable(name)) {
final PlayerAuth auth = new PlayerAuth(name,spawn.getBlockX(),spawn.getBlockY(),spawn.getBlockZ(),spawn.getWorld().getName());
try {
data.updateQuitLoc(auth);
} catch (NullPointerException npe) { }
}
event.setRespawnLocation(spawn); event.setRespawnLocation(spawn);
} }
@EventHandler (priority = EventPriority.HIGHEST)
public void onPlayerGameModeChange(PlayerGameModeChangeEvent event) {
if (event.isCancelled())
return;
if (event.getPlayer() == null || event == null)
return;
if (!Settings.isForceSurvivalModeEnabled)
return;
Player player = event.getPlayer();
if (plugin.authmePermissible(player, "authme.bypassforcesurvival"))
return;
String name = player.getName().toLowerCase();
if (Utils.getInstance().isUnrestricted(player) || CombatTagComunicator.isNPC(player))
return;
if(plugin.getCitizensCommunicator().isNPC(player, plugin))
return;
if (PlayerCache.getInstance().isAuthenticated(name))
return;
if (!data.isAuthAvailable(name))
if (!Settings.isForcedRegistrationEnabled)
return;
if (this.causeByAuthMe)
return;
event.setCancelled(true);
}
} }

View File

@ -20,10 +20,15 @@ public class BungeeCordMessage implements PluginMessageListener {
@Override @Override
public void onPluginMessageReceived(String channel, Player player, byte[] message) { public void onPluginMessageReceived(String channel, Player player, byte[] message) {
if (!channel.equals("BungeeCord")) {
return;
}
try { try {
final DataInputStream in = new DataInputStream(new ByteArrayInputStream(message)); final DataInputStream in = new DataInputStream(new ByteArrayInputStream(message));
if (in.readUTF().equals("IP")) { //We need only the IP channel String subchannel = in.readUTF();
plugin.realIp.put(player.getName().toLowerCase(), in.readUTF()); //Put the IP (only the ip not the port) in the hashmap if (subchannel.equals("IP")) { //We need only the IP channel
String ip = in.readUTF();
plugin.realIp.put(player.getName().toLowerCase(), ip); //Put the IP (only the ip not the port) in the hashmap
} }
} catch (IOException ex) { } catch (IOException ex) {
} }

View File

@ -36,4 +36,5 @@ public enum HashAlgorithm {
public Class<?> getclass() { public Class<?> getclass() {
return classe; return classe;
} }
} }

View File

@ -6,6 +6,8 @@ import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom; import java.security.SecureRandom;
import java.util.HashMap; import java.util.HashMap;
import org.bukkit.Bukkit;
import fr.xephi.authme.AuthMe; import fr.xephi.authme.AuthMe;
import fr.xephi.authme.cache.auth.PlayerAuth; import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.events.PasswordEncryptionEvent; import fr.xephi.authme.events.PasswordEncryptionEvent;
@ -19,7 +21,7 @@ public class PasswordSecurity {
private static SecureRandom rnd = new SecureRandom(); private static SecureRandom rnd = new SecureRandom();
public static HashMap<String, String> userSalt = new HashMap<String, String>(); public static HashMap<String, String> userSalt = new HashMap<String, String>();
private static String createSalt(int length) throws NoSuchAlgorithmException { public static String createSalt(int length) throws NoSuchAlgorithmException {
byte[] msg = new byte[40]; byte[] msg = new byte[40];
rnd.nextBytes(msg); rnd.nextBytes(msg);
MessageDigest sha1 = MessageDigest.getInstance("SHA1"); MessageDigest sha1 = MessageDigest.getInstance("SHA1");
@ -41,64 +43,68 @@ public class PasswordSecurity {
} }
String salt = ""; String salt = "";
switch (alg) { switch (alg) {
case MD5: case SHA256:
case SHA1: salt = createSalt(16);
case WHIRLPOOL: break;
case PHPBB: case MD5VB:
case PLAINTEXT: salt = createSalt(16);
case XENFORO: break;
case SHA512: case XAUTH:
case DOUBLEMD5: salt = createSalt(12);
case WORDPRESS: break;
case CUSTOM: case MYBB:
break; salt = createSalt(8);
case SHA256: userSalt.put(playerName, salt);
salt = createSalt(16); break;
break; case IPB3:
case MD5VB: salt = createSalt(5);
salt = createSalt(16); userSalt.put(playerName, salt);
break; break;
case XAUTH: case PHPFUSION:
salt = createSalt(12); salt = createSalt(12);
break; userSalt.put(playerName, salt);
case MYBB: break;
salt = createSalt(8); case SALTED2MD5:
userSalt.put(playerName, salt); salt = createSalt(Settings.saltLength);
break; userSalt.put(playerName, salt);
case IPB3: break;
salt = createSalt(5); case JOOMLA:
userSalt.put(playerName, salt); salt = createSalt(32);
break; userSalt.put(playerName, salt);
case PHPFUSION: break;
salt = createSalt(12); case BCRYPT:
userSalt.put(playerName, salt); salt = BCRYPT.gensalt(Settings.bCryptLog2Rounds);
break; userSalt.put(playerName, salt);
case SALTED2MD5: break;
salt = createSalt(Settings.saltLength); case WBB3:
userSalt.put(playerName, salt); salt = createSalt(40);
break; userSalt.put(playerName, salt);
case JOOMLA: break;
salt = createSalt(32); case PBKDF2:
userSalt.put(playerName, salt); salt = createSalt(12);
break; userSalt.put(playerName, salt);
case BCRYPT: break;
salt = BCRYPT.gensalt(Settings.bCryptLog2Rounds); case SMF:
userSalt.put(playerName, salt); return method.getHash(password, playerName.toLowerCase());
break; case PHPBB:
case WBB3: salt = createSalt(16);
salt = createSalt(40); userSalt.put(playerName, salt);
userSalt.put(playerName, salt); break;
break; case MD5:
case PBKDF2: case SHA1:
salt = createSalt(12); case WHIRLPOOL:
userSalt.put(playerName, salt); case PLAINTEXT:
break; case XENFORO:
case SMF: case SHA512:
return method.getHash(password, playerName.toLowerCase()); case DOUBLEMD5:
default: case WORDPRESS:
throw new NoSuchAlgorithmException("Unknown hash algorithm"); case CUSTOM:
break;
default:
throw new NoSuchAlgorithmException("Unknown hash algorithm");
} }
PasswordEncryptionEvent event = new PasswordEncryptionEvent(method, playerName); PasswordEncryptionEvent event = new PasswordEncryptionEvent(method, playerName);
Bukkit.getPluginManager().callEvent(event);
method = event.getMethod(); method = event.getMethod();
if (method == null) if (method == null)
throw new NoSuchAlgorithmException("Unknown hash algorithm"); throw new NoSuchAlgorithmException("Unknown hash algorithm");
@ -118,6 +124,7 @@ public class PasswordSecurity {
throw new NoSuchAlgorithmException("Problem with this hash algorithm"); throw new NoSuchAlgorithmException("Problem with this hash algorithm");
} }
PasswordEncryptionEvent event = new PasswordEncryptionEvent(method, playerName); PasswordEncryptionEvent event = new PasswordEncryptionEvent(method, playerName);
Bukkit.getPluginManager().callEvent(event);
method = event.getMethod(); method = event.getMethod();
if (method == null) if (method == null)
throw new NoSuchAlgorithmException("Unknown hash algorithm"); throw new NoSuchAlgorithmException("Unknown hash algorithm");
@ -136,8 +143,9 @@ public class PasswordSecurity {
private static boolean compareWithAllEncryptionMethod(String password, String hash, String playerName) throws NoSuchAlgorithmException { private static boolean compareWithAllEncryptionMethod(String password, String hash, String playerName) throws NoSuchAlgorithmException {
for (HashAlgorithm algo : HashAlgorithm.values()) { for (HashAlgorithm algo : HashAlgorithm.values()) {
try { try {
if (algo != HashAlgorithm.CUSTOM) EncryptionMethod method = (EncryptionMethod) algo.getclass().newInstance();
if (((EncryptionMethod) algo.getclass().newInstance()).comparePassword(hash, password, playerName)) { if (algo != HashAlgorithm.CUSTOM) {
if (method.comparePassword(hash, password, playerName)) {
PlayerAuth nAuth = AuthMe.getInstance().database.getAuth(playerName); PlayerAuth nAuth = AuthMe.getInstance().database.getAuth(playerName);
if (nAuth != null) { if (nAuth != null) {
nAuth.setHash(getHash(Settings.getPasswordHash, password, playerName)); nAuth.setHash(getHash(Settings.getPasswordHash, password, playerName));
@ -147,9 +155,8 @@ public class PasswordSecurity {
} }
return true; return true;
} }
} catch (InstantiationException e) { }
} catch (IllegalAccessException e) { } catch (Exception e) {}
}
} }
return false; return false;
} }

View File

@ -18,9 +18,6 @@ import java.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom; import java.security.SecureRandom;
import fr.xephi.authme.AuthMe;
/** /**
* BCrypt implements OpenBSD-style Blowfish password hashing using * BCrypt implements OpenBSD-style Blowfish password hashing using
* the scheme described in "A Future-Adaptable Password Scheme" by * the scheme described in "A Future-Adaptable Password Scheme" by
@ -762,7 +759,6 @@ public class BCRYPT implements EncryptionMethod {
@Override @Override
public boolean comparePassword(String hash, String password, public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException { String playerName) throws NoSuchAlgorithmException {
String salt = AuthMe.getInstance().database.getAuth(playerName).getSalt(); return checkpw(password, hash);
return hash.equals(hashpw(password, salt));
} }
} }

View File

@ -18,14 +18,14 @@ public class PHPBB implements EncryptionMethod {
private String itoa64 = private String itoa64 =
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
public String phpbb_hash(String password) { public String phpbb_hash(String password, String salt) {
String random_state = unique_id(); String random_state = salt;
String random = ""; String random = "";
int count = 6; int count = 6;
if (random.length() < count) { if (random.length() < count) {
random = ""; random = "";
for (int i = 0; i < count; i += 16) { for (int i = 0; i < count; i += 16) {
random_state = md5(unique_id() + random_state); random_state = md5(salt + random_state);
random += pack(md5(random_state)); random += pack(md5(random_state));
} }
random = random.substring(0, count); random = random.substring(0, count);
@ -37,15 +37,6 @@ public class PHPBB implements EncryptionMethod {
return md5(password); return md5(password);
} }
private String unique_id() {
return unique_id("c");
}
private String unique_id(String extra) {
//TODO: Maybe check the salt?
return "1234567890abcdef";
}
private String _hash_gensalt_private(String input, String itoa64) { private String _hash_gensalt_private(String input, String itoa64) {
return _hash_gensalt_private(input, itoa64, 6); return _hash_gensalt_private(input, itoa64, 6);
} }
@ -162,7 +153,7 @@ private String _hash_gensalt_private(
@Override @Override
public String getHash(String password, String salt) public String getHash(String password, String salt)
throws NoSuchAlgorithmException { throws NoSuchAlgorithmException {
return phpbb_hash(password); return phpbb_hash(password, salt);
} }
@Override @Override

View File

@ -61,8 +61,6 @@ import java.security.NoSuchAlgorithmException;
import java.util.Arrays; import java.util.Arrays;
public class WHIRLPOOL implements EncryptionMethod { public class WHIRLPOOL implements EncryptionMethod {
public WHIRLPOOL() {}
/** /**
* The message digest size (in bits) * The message digest size (in bits)
@ -181,6 +179,9 @@ public class WHIRLPOOL implements EncryptionMethod {
protected long[] block = new long[8]; protected long[] block = new long[8];
protected long[] state = new long[8]; protected long[] state = new long[8];
public WHIRLPOOL() {
}
/** /**
* The core Whirlpool transform. * The core Whirlpool transform.
*/ */

View File

@ -7,8 +7,7 @@ public class XAUTH implements EncryptionMethod {
@Override @Override
public String getHash(String password, String salt) public String getHash(String password, String salt)
throws NoSuchAlgorithmException { throws NoSuchAlgorithmException {
WHIRLPOOL w = new WHIRLPOOL(); String hash = getWhirlpool(salt + password).toLowerCase();
String hash = w.getHash((salt + password).toLowerCase(), "");
int saltPos = (password.length() >= hash.length() ? hash.length() - 1 : password.length()); int saltPos = (password.length() >= hash.length() ? hash.length() - 1 : password.length());
return hash.substring(0, saltPos) + salt + hash.substring(saltPos); return hash.substring(0, saltPos) + salt + hash.substring(saltPos);
} }
@ -21,4 +20,13 @@ public class XAUTH implements EncryptionMethod {
return hash.equals(getHash(password, salt)); return hash.equals(getHash(password, salt));
} }
public static String getWhirlpool(String message) {
WHIRLPOOL w = new WHIRLPOOL();
byte[] digest = new byte[WHIRLPOOL.DIGESTBYTES];
w.NESSIEinit();
w.NESSIEadd(message);
w.NESSIEfinalize(digest);
return WHIRLPOOL.display(digest);
}
} }

View File

@ -1,73 +1,64 @@
package fr.xephi.authme.settings; package fr.xephi.authme.settings;
import java.io.File; import java.io.File;
import java.io.InputStream;
import org.bukkit.configuration.file.YamlConfiguration;
import fr.xephi.authme.AuthMe;
public class Messages extends CustomConfiguration { public class Messages extends CustomConfiguration {
private static Messages singleton = null; private static Messages singleton = null;
public Messages() { public Messages(File file) {
super(new File(Settings.MESSAGE_FILE+"_"+Settings.messagesLanguage+".yml")); super(file);
loadDefaults(); loadDefaults(file);
loadFile(); loadFile();
saveDefaults(file);
singleton = this; singleton = this;
} }
private void loadDefaults() { /**
this.set("logged_in", "&cAlready logged in!"); * Loads a file from the plugin jar and sets as default
this.set("not_logged_in", "&cNot logged in!"); *
this.set("reg_disabled", "&cRegistration is disabled"); * @param filename The filename to open
this.set("user_regged", "&cUsername already registered"); */
this.set("usage_reg", "&cUsage: /register password ConfirmPassword"); public final void loadDefaults(File file) {
this.set("usage_log", "&cUsage: /login password"); InputStream stream = AuthMe.getInstance().getResource(file.getName());
this.set("user_unknown", "&cUsername not registered"); if(stream == null) return;
this.set("pwd_changed", "&cPassword changed!");
this.set("reg_only", "&fRegistered players only! Please visit http://example.com to register"); setDefaults(YamlConfiguration.loadConfiguration(stream));
this.set("valid_session", "&cSession login"); }
this.set("login_msg", "&cPlease login with \"/login password\"");
this.set("reg_msg", "&cPlease register with \"/register password ConfirmPassword\""); /**
this.set("reg_email_msg", "&cPlease register with \"/register <email> <confirmEmail>\""); * Saves the configuration to disk
this.set("timeout", "&fLogin Timeout"); *
this.set("wrong_pwd", "&cWrong password"); * @return True if saved successfully
this.set("logout", "&cSuccessful logout"); */
this.set("usage_unreg", "&cUsage: /unregister password"); public final boolean saved(File file) {
this.set("registered", "&cSuccessfully registered!"); try {
this.set("unregistered", "&cSuccessfully unregistered!"); save(file);
this.set("login", "&cSuccessful login!"); return true;
this.set("no_perm", "&cNo Permission"); } catch (Exception ex) {
this.set("same_nick", "&fSame nick is already playing"); return false;
this.set("reg_voluntarily", "&fYou can register your nickname with the server with the command \"/register password ConfirmPassword\""); }
this.set("reload", "&fConfiguration and database has been reloaded"); }
this.set("error", "&fAn error ocurred; Please contact the admin");
this.set("unknown_user", "&fUser is not in database"); /**
this.set("unsafe_spawn","&fYour Quit location was unsafe, teleporting you to World Spawn"); * Saves current configuration (plus defaults) to disk.
this.set("unvalid_session","&fSession Dataes doesnt corrispond Plaese wait the end of session"); *
this.set("max_reg","&fYou have Exceded the max number of Registration for your Account"); * If defaults and configuration are empty, saves blank file.
this.set("password_error","&fPassword doesnt match"); *
this.set("pass_len","&fYour password dind''t reach the minimum length or exeded the max length"); * @return True if saved successfully
this.set("vb_nonActiv","&fYour Account isent Activated yet check your Emails!"); */
this.set("usage_changepassword", "&fUsage: /changepassword oldPassword newPassword"); public final boolean saveDefaults(File file) {
this.set("name_len", "&cYour nickname is too Short or too long"); options().copyDefaults(true);
this.set("regex", "&cYour nickname contains illegal characters. Allowed chars: REG_EX"); options().copyHeader(true);
this.set("add_email","&cPlease add your email with : /email add yourEmail confirmEmail"); boolean success = saved(file);
this.set("bad_database_email", "[AuthMe] This /email command only available with MySQL and SQLite, contact an Admin"); options().copyDefaults(false);
this.set("recovery_email", "&cForgot your password? Please use /email recovery <yourEmail>"); options().copyHeader(false);
this.set("usage_captcha", "&cUsage: /captcha <theCaptcha>"); return success;
this.set("wrong_captcha", "&cWrong Captcha, please use : /captcha THE_CAPTCHA");
this.set("valid_captcha", "&cYour captcha is valid !");
this.set("kick_forvip", "&cA VIP Player join the full server!");
this.set("kick_fullserver", "&cThe server is actually full, Sorry!");
this.set("usage_email_add", "&fUsage: /email add <Email> <confirmEmail> ");
this.set("usage_email_change", "&Usage: /email change <old> <new> ");
this.set("usage_email_recovery", "&Usage: /email recovery <Email>");
this.set("email_add", "[AuthMe] /email add <Email> <confirmEmail>");
this.set("new_email_invalid", "[AuthMe] New email invalid!");
this.set("old_email_invalid", "[AuthMe] Old email invalid!");
this.set("email_invalid", "[AuthMe] Invalid Email !");
this.set("email_added", "[AuthMe] Email Added !");
this.set("email_confirm", "[AuthMe] Confirm your Email !");
this.set("email_changed", "[AuthMe] Email Change !");
this.set("email_send", "[AuthMe] Recovery Email Send !");
} }
private void loadFile() { private void loadFile() {
@ -76,23 +67,24 @@ public class Messages extends CustomConfiguration {
} }
public String _(String msg) { public String _(String msg) {
String loc = (String) this.get(msg); String loc = (String) this.get(msg, this.getDefault(msg));
if (loc != null) { if (loc != null) {
return loc.replace("&", "\u00a7"); return loc.replace("&", "\u00a7");
} }
if (loc == null && !contains(msg)) { if (loc == null && !contains(msg)) {
set(msg, this.getDefault(msg)); set(msg, this.getDefault(msg));
save(); save();
loc = (String) this.get(msg); load();
loc = (String) this.get(msg, this.getDefault(msg));
} }
if (loc == null) if (loc == null)
return "Error with Translation files; Please contact the admin"; return "Error with Translation files; Please contact the admin ";
return loc.replace("&", "\u00a7"); return loc.replace("&", "\u00a7");
} }
public static Messages getInstance() { public static Messages getInstance() {
if (singleton == null) { if (singleton == null) {
singleton = new Messages(); singleton = new Messages(new File(Settings.MESSAGE_FILE+"_"+Settings.messagesLanguage+".yml"));
} }
return singleton; return singleton;
} }

View File

@ -29,8 +29,10 @@ public final class Settings extends YamlConfiguration {
private static List<String> getRestrictedIp; private static List<String> getRestrictedIp;
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> forceCommands = null;
public final Plugin plugin; public final Plugin 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;
@ -39,13 +41,14 @@ public final class Settings extends YamlConfiguration {
public static Boolean isPermissionCheckEnabled, isRegistrationEnabled, isForcedRegistrationEnabled, public static Boolean isPermissionCheckEnabled, isRegistrationEnabled, isForcedRegistrationEnabled,
isTeleportToSpawnEnabled, isSessionsEnabled, isChatAllowed, isAllowRestrictedIp, isTeleportToSpawnEnabled, isSessionsEnabled, isChatAllowed, isAllowRestrictedIp,
isMovementAllowed, isKickNonRegisteredEnabled, isForceSingleSessionEnabled, isMovementAllowed, isKickNonRegisteredEnabled, isForceSingleSessionEnabled,
isForceSpawnLocOnJoinEnabled, isForceExactSpawnEnabled, isSaveQuitLocationEnabled, isForceSpawnLocOnJoinEnabled, isSaveQuitLocationEnabled,
isForceSurvivalModeEnabled, isResetInventoryIfCreative, isCachingEnabled, isKickOnWrongPasswordEnabled, isForceSurvivalModeEnabled, isResetInventoryIfCreative, isCachingEnabled, isKickOnWrongPasswordEnabled,
getEnablePasswordVerifier, protectInventoryBeforeLogInEnabled, isBackupActivated, isBackupOnStart, getEnablePasswordVerifier, protectInventoryBeforeLogInEnabled, isBackupActivated, isBackupOnStart,
isBackupOnStop, enablePasspartu, isStopEnabled, reloadSupport, rakamakUseIp, noConsoleSpam, removePassword, displayOtherAccounts, isBackupOnStop, enablePasspartu, isStopEnabled, reloadSupport, rakamakUseIp, noConsoleSpam, removePassword, displayOtherAccounts,
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; usePurge, purgePlayerDat, purgeEssentialsFile, supportOldPassword, purgeLimitedCreative,
purgeAntiXray, purgePermissions, enableProtection, enableAntiBot;
public static String getNickRegex, getUnloggedinGroup, getMySQLHost, getMySQLPort, public static String getNickRegex, getUnloggedinGroup, getMySQLHost, getMySQLPort,
getMySQLUsername, getMySQLPassword, getMySQLDatabase, getMySQLTablename, getMySQLUsername, getMySQLPassword, getMySQLDatabase, getMySQLTablename,
@ -59,7 +62,7 @@ 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; bCryptLog2Rounds, purgeDelay, getPhpbbGroup, antiBotSensibility, antiBotDuration;
protected static YamlConfiguration configFile; protected static YamlConfiguration configFile;
@ -187,7 +190,7 @@ public void loadConfigOptions() {
chestshop = configFile.getBoolean("Hooks.chestshop", true); chestshop = configFile.getBoolean("Hooks.chestshop", true);
notifications = configFile.getBoolean("Hooks.notifications", true); notifications = configFile.getBoolean("Hooks.notifications", true);
bungee = configFile.getBoolean("Hooks.bungeecord", false); bungee = configFile.getBoolean("Hooks.bungeecord", false);
getForcedWorlds = (List<String>) configFile.getList("settings.restrictions.ForceSpawnOnTheseWorlds"); getForcedWorlds = (List<String>) configFile.getList("settings.restrictions.ForceSpawnOnTheseWorlds", new ArrayList<String>());
banUnsafeIp = configFile.getBoolean("settings.restrictions.banUnsafedIP", false); banUnsafeIp = configFile.getBoolean("settings.restrictions.banUnsafedIP", false);
doubleEmailCheck = configFile.getBoolean("settings.registration.doubleEmailCheck", false); doubleEmailCheck = configFile.getBoolean("settings.registration.doubleEmailCheck", false);
sessionExpireOnIpChange = configFile.getBoolean("settings.sessions.sessionExpireOnIpChange", false); sessionExpireOnIpChange = configFile.getBoolean("settings.sessions.sessionExpireOnIpChange", false);
@ -206,6 +209,15 @@ public void loadConfigOptions() {
getPhpbbGroup = configFile.getInt("ExternalBoardOptions.phpbbActivatedGroupId", 2); getPhpbbGroup = configFile.getInt("ExternalBoardOptions.phpbbActivatedGroupId", 2);
supportOldPassword = configFile.getBoolean("settings.security.supportOldPasswordHash", false); supportOldPassword = configFile.getBoolean("settings.security.supportOldPasswordHash", false);
getWordPressPrefix = configFile.getString("ExternalBoardOptions.wordpressTablePrefix", "wp_"); getWordPressPrefix = configFile.getString("ExternalBoardOptions.wordpressTablePrefix", "wp_");
purgeLimitedCreative = configFile.getBoolean("Purge.removeLimitedCreativesInventories", false);
purgeAntiXray = configFile.getBoolean("Purge.removeAntiXRayFile", false);
//purgePermissions = configFile.getBoolean("Purge.removePermissions", false);
enableProtection = configFile.getBoolean("Protection.enableProtection", false);
countries = (List<String>) configFile.getList("Protection.countries", new ArrayList<String>());
enableAntiBot = configFile.getBoolean("Protection.enableAntiBot", false);
antiBotSensibility = configFile.getInt("Protection.antiBotSensibility", 5);
antiBotDuration = configFile.getInt("Protection.antiBotDuration", 10);
forceCommands = (List<String>) configFile.getList("settings.forceCommands", new ArrayList<String>());
saveDefaults(); saveDefaults();
} }
@ -339,6 +351,15 @@ public static void reloadConfigOptions(YamlConfiguration newConfig) {
getPhpbbGroup = configFile.getInt("ExternalBoardOptions.phpbbActivatedGroupId", 2); getPhpbbGroup = configFile.getInt("ExternalBoardOptions.phpbbActivatedGroupId", 2);
supportOldPassword = configFile.getBoolean("settings.security.supportOldPasswordHash", false); supportOldPassword = configFile.getBoolean("settings.security.supportOldPasswordHash", false);
getWordPressPrefix = configFile.getString("ExternalBoardOptions.wordpressTablePrefix", "wp_"); getWordPressPrefix = configFile.getString("ExternalBoardOptions.wordpressTablePrefix", "wp_");
purgeLimitedCreative = configFile.getBoolean("Purge.removeLimitedCreativesInventories", false);
purgeAntiXray = configFile.getBoolean("Purge.removeAntiXRayFile", false);
//purgePermissions = configFile.getBoolean("Purge.removePermissions", false);
enableProtection = configFile.getBoolean("Protection.enableProtection", false);
countries = (List<String>) configFile.getList("Protection.countries");
enableAntiBot = configFile.getBoolean("Protection.enableAntiBot", false);
antiBotSensibility = configFile.getInt("Protection.antiBotSensibility", 5);
antiBotDuration = configFile.getInt("Protection.antiBotDuration", 10);
forceCommands = (List<String>) configFile.getList("settings.forceCommands", new ArrayList<String>());
} }
public void mergeConfig() { public void mergeConfig() {
@ -433,7 +454,29 @@ public void mergeConfig() {
set("Xenoforo.predefinedSalt", null); set("Xenoforo.predefinedSalt", null);
if(configFile.getString("settings.security.passwordHash","SHA256").toUpperCase().equals("XFSHA1") || configFile.getString("settings.security.passwordHash","SHA256").toUpperCase().equals("XFSHA256")) if(configFile.getString("settings.security.passwordHash","SHA256").toUpperCase().equals("XFSHA1") || configFile.getString("settings.security.passwordHash","SHA256").toUpperCase().equals("XFSHA256"))
set("settings.security.passwordHash", "XENFORO"); set("settings.security.passwordHash", "XENFORO");
if(!contains("Purge.removeLimitedCreativesInventories"))
set("Purge.removeLimitedCreativesInventories", false);
if(!contains("Purge.removeAntiXRayFile"))
set("Purge.removeAntiXRayFile", false);
/*if(!contains("Purge.removePermissions"))
set("Purge.removePermissions", false);*/
if(!contains("Protection.enableProtection"))
set("Protection.enableProtection", false);
if(!contains("Protection.countries")) {
countries = new ArrayList<String>();
countries.add("US");
countries.add("GB");
set("Protection.countries", countries);
}
if(!contains("Protection.enableAntiBot"))
set("Protection.enableAntiBot", false);
if(!contains("Protection.antiBotSensibility"))
set("Protection.antiBotSensibility", 5);
if(!contains("Protection.antiBotDuration"))
set("Protection.antiBotDuration", 10);
if(!contains("settings.forceCommands"))
set("settings.forceCommands", new ArrayList<String>());
plugin.getLogger().info("Merge new Config Options if needed.."); plugin.getLogger().info("Merge new Config Options if needed..");
plugin.saveConfig(); plugin.saveConfig();
@ -581,11 +624,11 @@ public void mergeConfig() {
setDefaults(new MemoryConfiguration()); setDefaults(new MemoryConfiguration());
} }
/** /**
* Check loaded defaults against current configuration * Check loaded defaults against current configuration
* *
* @return false When all defaults aren't present in config * @return false When all defaults aren't present in config
*/ */
public boolean checkDefaults() { public boolean checkDefaults() {
if (getDefaults() == null) { if (getDefaults() == null) {
return true; return true;
@ -604,8 +647,14 @@ public void mergeConfig() {
return "en"; return "en";
} }
public enum messagesLang { public static void switchAntiBotMod(boolean mode) {
en, de, br, cz, pl, fr, ru, hu, sk, es, zhtw, fi, zhcn, lt, it, ko, pt if (mode)
isKickNonRegisteredEnabled = true;
else
isKickNonRegisteredEnabled = configFile.getBoolean("settings.restrictions.kickNonRegistered",false);
} }
public enum messagesLang {
en, de, br, cz, pl, fr, ru, hu, sk, es, zhtw, fi, zhcn, lt, it, ko, pt, nl
}
} }

View File

@ -25,9 +25,9 @@ public class MessageTask implements Runnable {
@Override @Override
public void run() { public void run() {
if (PlayerCache.getInstance().isAuthenticated(name)) { if (PlayerCache.getInstance().isAuthenticated(name))
return; return;
}
for (Player player : plugin.getServer().getOnlinePlayers()) { for (Player player : plugin.getServer().getOnlinePlayers()) {
if (player.getName().toLowerCase().equals(name)) { if (player.getName().toLowerCase().equals(name)) {
player.sendMessage(msg); player.sendMessage(msg);

View File

@ -32,13 +32,14 @@ public class TimeoutTask implements Runnable {
@Override @Override
public void run() { public void run() {
if (PlayerCache.getInstance().isAuthenticated(name)) { if (PlayerCache.getInstance().isAuthenticated(name))
return; return;
}
for (Player player : plugin.getServer().getOnlinePlayers()) { for (Player player : plugin.getServer().getOnlinePlayers()) {
if (player.getName().toLowerCase().equals(name)) { if (player.getName().toLowerCase().equals(name)) {
if (LimboCache.getInstance().hasLimboPlayer(name)) { if (LimboCache.getInstance().hasLimboPlayer(name)) {
LimboPlayer inv = LimboCache.getInstance().getLimboPlayer(name); LimboPlayer inv = LimboCache.getInstance().getLimboPlayer(name);
player.getServer().getScheduler().cancelTask(inv.getMessageTaskId());
player.getServer().getScheduler().cancelTask(inv.getTimeoutTaskId()); player.getServer().getScheduler().cancelTask(inv.getTimeoutTaskId());
if(playerCache.doesCacheExist(name)) { if(playerCache.doesCacheExist(name)) {
playerCache.removeCache(name); playerCache.removeCache(name);

View File

@ -12,6 +12,7 @@ import java.util.List;
import fr.xephi.authme.AuthMe; import fr.xephi.authme.AuthMe;
import fr.xephi.authme.ConsoleLogger; import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.api.API;
import fr.xephi.authme.cache.auth.PlayerAuth; import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.datasource.DataSource; import fr.xephi.authme.datasource.DataSource;
import fr.xephi.authme.settings.Settings; import fr.xephi.authme.settings.Settings;
@ -21,9 +22,10 @@ public class FlatFileThread extends Thread implements DataSource {
/* file layout: /* file layout:
* *
* PLAYERNAME:HASHSUM:IP:LOGININMILLIESECONDS:LASTPOSX:LASTPOSY:LASTPOSZ:LASTPOSWORLD * PLAYERNAME:HASHSUM:IP:LOGININMILLIESECONDS:LASTPOSX:LASTPOSY:LASTPOSZ:LASTPOSWORLD:EMAIL
* *
* Old but compatible: * Old but compatible:
* PLAYERNAME:HASHSUM:IP:LOGININMILLIESECONDS:LASTPOSX:LASTPOSY:LASTPOSZ:LASTPOSWORLD
* PLAYERNAME:HASHSUM:IP:LOGININMILLIESECONDS * PLAYERNAME:HASHSUM:IP:LOGININMILLIESECONDS
* PLAYERNAME:HASHSUM:IP * PLAYERNAME:HASHSUM:IP
* PLAYERNAME:HASHSUM * PLAYERNAME:HASHSUM
@ -84,7 +86,7 @@ public class FlatFileThread extends Thread implements DataSource {
BufferedWriter bw = null; BufferedWriter bw = null;
try { try {
bw = new BufferedWriter(new FileWriter(source, true)); bw = new BufferedWriter(new FileWriter(source, true));
bw.write(auth.getNickname() + ":" + auth.getHash() + ":" + auth.getIp() + ":" + auth.getLastLogin() + ":" + auth.getQuitLocX() + ":" + auth.getQuitLocY() + ":" + auth.getQuitLocZ() + ":" + auth.getWorld() + "\n"); bw.write(auth.getNickname() + ":" + auth.getHash() + ":" + auth.getIp() + ":" + auth.getLastLogin() + ":" + auth.getQuitLocX() + ":" + auth.getQuitLocY() + ":" + auth.getQuitLocZ() + ":" + auth.getWorld() + ":" + auth.getEmail() + "\n");
} catch (IOException ex) { } catch (IOException ex) {
ConsoleLogger.showError(ex.getMessage()); ConsoleLogger.showError(ex.getMessage());
return false; return false;
@ -114,19 +116,23 @@ public class FlatFileThread extends Thread implements DataSource {
if (args[0].equals(auth.getNickname())) { if (args[0].equals(auth.getNickname())) {
switch (args.length) { switch (args.length) {
case 4: { case 4: {
newAuth = new PlayerAuth(args[0], auth.getHash(), args[2], Long.parseLong(args[3]), 0, 0, 0, "world"); newAuth = new PlayerAuth(args[0], auth.getHash(), args[2], Long.parseLong(args[3]), 0, 0, 0, "world", "your@email.com", API.getPlayerRealName(args[0]));
break; break;
} }
case 7: { case 7: {
newAuth = new PlayerAuth(args[0], auth.getHash(), args[2], Long.parseLong(args[3]), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), "world"); newAuth = new PlayerAuth(args[0], auth.getHash(), args[2], Long.parseLong(args[3]), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), "world", "your@email.com", API.getPlayerRealName(args[0]));
break; break;
} }
case 8: { case 8: {
newAuth = new PlayerAuth(args[0], auth.getHash(), args[2], Long.parseLong(args[3]), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), args[7]); newAuth = new PlayerAuth(args[0], auth.getHash(), args[2], Long.parseLong(args[3]), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), args[7], "your@email.com", API.getPlayerRealName(args[0]));
break;
}
case 9: {
newAuth = new PlayerAuth(args[0], auth.getHash(), args[2], Long.parseLong(args[3]), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), args[7], args[8], API.getPlayerRealName(args[0]));
break; break;
} }
default: { default: {
newAuth = new PlayerAuth(args[0], auth.getHash(), args[2], 0, 0, 0, 0, "world"); newAuth = new PlayerAuth(args[0], auth.getHash(), args[2], 0, 0, 0, 0, "world", "your@email.com", API.getPlayerRealName(args[0]));
break; break;
} }
} }
@ -167,19 +173,23 @@ public class FlatFileThread extends Thread implements DataSource {
if (args[0].equals(auth.getNickname())) { if (args[0].equals(auth.getNickname())) {
switch (args.length) { switch (args.length) {
case 4: { case 4: {
newAuth = new PlayerAuth(args[0], args[1], auth.getIp(), auth.getLastLogin(), 0, 0, 0, "world"); newAuth = new PlayerAuth(args[0], args[1], auth.getIp(), auth.getLastLogin(), 0, 0, 0, "world", "your@email.com", API.getPlayerRealName(args[0]));
break; break;
} }
case 7: { case 7: {
newAuth = new PlayerAuth(args[0], args[1], auth.getIp(), auth.getLastLogin(), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), "world"); newAuth = new PlayerAuth(args[0], args[1], auth.getIp(), auth.getLastLogin(), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), "world", "your@email.com", API.getPlayerRealName(args[0]));
break; break;
} }
case 8: { case 8: {
newAuth = new PlayerAuth(args[0], args[1], auth.getIp(), auth.getLastLogin(), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), args[7]); newAuth = new PlayerAuth(args[0], args[1], auth.getIp(), auth.getLastLogin(), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), args[7], "your@email.com", API.getPlayerRealName(args[0]));
break;
}
case 9: {
newAuth = new PlayerAuth(args[0], args[1], auth.getIp(), auth.getLastLogin(), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), args[7], args[8], API.getPlayerRealName(args[0]));
break; break;
} }
default: { default: {
newAuth = new PlayerAuth(args[0], args[1], auth.getIp(), auth.getLastLogin(), 0, 0, 0, "world"); newAuth = new PlayerAuth(args[0], args[1], auth.getIp(), auth.getLastLogin(), 0, 0, 0, "world", "your@email.com", API.getPlayerRealName(args[0]));
break; break;
} }
} }
@ -218,7 +228,7 @@ public class FlatFileThread extends Thread implements DataSource {
while ((line = br.readLine()) != null) { while ((line = br.readLine()) != null) {
String[] args = line.split(":"); String[] args = line.split(":");
if (args[0].equals(auth.getNickname())) { if (args[0].equals(auth.getNickname())) {
newAuth = new PlayerAuth(args[0], args[1], args[2], Long.parseLong(args[3]), auth.getQuitLocX(), auth.getQuitLocY(), auth.getQuitLocZ(), auth.getWorld()); newAuth = new PlayerAuth(args[0], args[1], args[2], Long.parseLong(args[3]), auth.getQuitLocX(), auth.getQuitLocY(), auth.getQuitLocZ(), auth.getWorld(), auth.getEmail(), API.getPlayerRealName(args[0]));
break; break;
} }
} }
@ -420,15 +430,17 @@ public class FlatFileThread extends Thread implements DataSource {
if (args[0].equals(user)) { if (args[0].equals(user)) {
switch (args.length) { switch (args.length) {
case 2: case 2:
return new PlayerAuth(args[0], args[1], "198.18.0.1", 0); return new PlayerAuth(args[0], args[1], "198.18.0.1", 0, "your@email.com", API.getPlayerRealName(args[0]));
case 3: case 3:
return new PlayerAuth(args[0], args[1], args[2], 0); return new PlayerAuth(args[0], args[1], args[2], 0, "your@email.com", API.getPlayerRealName(args[0]));
case 4: case 4:
return new PlayerAuth(args[0], args[1], args[2], Long.parseLong(args[3])); return new PlayerAuth(args[0], args[1], args[2], Long.parseLong(args[3]), "your@email.com", API.getPlayerRealName(args[0]));
case 7: case 7:
return new PlayerAuth(args[0], args[1], args[2], Long.parseLong(args[3]), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), "unavailableworld"); return new PlayerAuth(args[0], args[1], args[2], Long.parseLong(args[3]), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), "unavailableworld", "your@email.com", API.getPlayerRealName(args[0]));
case 8: case 8:
return new PlayerAuth(args[0], args[1], args[2], Long.parseLong(args[3]), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), args[7]); return new PlayerAuth(args[0], args[1], args[2], Long.parseLong(args[3]), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), args[7], "your@email.com", API.getPlayerRealName(args[0]));
case 9:
return new PlayerAuth(args[0], args[1], args[2], Long.parseLong(args[3]), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), args[7], args[8], API.getPlayerRealName(args[0]));
} }
} }
} }
@ -459,7 +471,38 @@ public class FlatFileThread extends Thread implements DataSource {
@Override @Override
public boolean updateEmail(PlayerAuth auth) { public boolean updateEmail(PlayerAuth auth) {
return false; if (!isAuthAvailable(auth.getNickname())) {
return false;
}
PlayerAuth newAuth = null;
BufferedReader br = null;
try {
br = new BufferedReader(new FileReader(source));
String line = "";
while ((line = br.readLine()) != null) {
String[] args = line.split(":");
if (args[0].equals(auth.getNickname())) {
newAuth = new PlayerAuth(args[0], args[1], args[2], Long.parseLong(args[3]), Integer.parseInt(args[4]), Integer.parseInt(args[5]), Integer.parseInt(args[6]), args[7], auth.getEmail(), API.getPlayerRealName(args[0]));
break;
}
}
} catch (FileNotFoundException ex) {
ConsoleLogger.showError(ex.getMessage());
return false;
} catch (IOException ex) {
ConsoleLogger.showError(ex.getMessage());
return false;
} finally {
if (br != null) {
try {
br.close();
} catch (IOException ex) {
}
}
}
removeAuth(auth.getNickname());
saveAuth(newAuth);
return true;
} }
@Override @Override
@ -524,12 +567,37 @@ public class FlatFileThread extends Thread implements DataSource {
} catch (IOException ex) { } catch (IOException ex) {
} }
} }
} }
} }
@Override @Override
public List<String> getAllAuthsByEmail(String email) { public List<String> getAllAuthsByEmail(String email) {
return new ArrayList<String>(); BufferedReader br = null;
List<String> countEmail = new ArrayList<String>();
try {
br = new BufferedReader(new FileReader(source));
String line;
while ((line = br.readLine()) != null) {
String[] args = line.split(":");
if (args.length > 8 && args[8].equals(email)) {
countEmail.add(args[0]);
}
}
return countEmail;
} catch (FileNotFoundException ex) {
ConsoleLogger.showError(ex.getMessage());
return new ArrayList<String>();
} catch (IOException ex) {
ConsoleLogger.showError(ex.getMessage());
return new ArrayList<String>();
} finally {
if (br != null) {
try {
br.close();
} catch (IOException ex) {
}
}
}
} }
@Override @Override

View File

@ -13,6 +13,7 @@ import com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource;
import fr.xephi.authme.AuthMe; import fr.xephi.authme.AuthMe;
import fr.xephi.authme.ConsoleLogger; import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.api.API;
import fr.xephi.authme.cache.auth.PlayerAuth; import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.datasource.DataSource; import fr.xephi.authme.datasource.DataSource;
import fr.xephi.authme.datasource.MiniConnectionPoolManager; import fr.xephi.authme.datasource.MiniConnectionPoolManager;
@ -208,14 +209,14 @@ public class MySQLThread extends Thread implements DataSource {
rs = pst.executeQuery(); rs = pst.executeQuery();
if (rs.next()) { if (rs.next()) {
if (rs.getString(columnIp).isEmpty() ) { if (rs.getString(columnIp).isEmpty() ) {
return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword), "198.18.0.1", rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld),rs.getString(columnEmail)); return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword), "198.18.0.1", rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld),rs.getString(columnEmail), API.getPlayerRealName(rs.getString(columnName)));
} else { } else {
if(!columnSalt.isEmpty()){ if(!columnSalt.isEmpty()){
if(!columnGroup.isEmpty()) if(!columnGroup.isEmpty())
return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword),rs.getString(columnSalt), rs.getInt(columnGroup), rs.getString(columnIp), rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld), rs.getString(columnEmail)); return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword),rs.getString(columnSalt), rs.getInt(columnGroup), rs.getString(columnIp), rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld), rs.getString(columnEmail), API.getPlayerRealName(rs.getString(columnName)));
else return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword),rs.getString(columnSalt), rs.getString(columnIp), rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld),rs.getString(columnEmail)); else return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword),rs.getString(columnSalt), rs.getString(columnIp), rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld),rs.getString(columnEmail), API.getPlayerRealName(rs.getString(columnName)));
} else { } else {
return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword), rs.getString(columnIp), rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld), rs.getString(columnEmail)); return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword), rs.getString(columnIp), rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld), rs.getString(columnEmail), API.getPlayerRealName(rs.getString(columnName)));
} }
} }
} else { } else {
@ -258,8 +259,8 @@ public class MySQLThread extends Thread implements DataSource {
} }
if (!columnOthers.isEmpty()) { if (!columnOthers.isEmpty()) {
for(String column : columnOthers) { for(String column : columnOthers) {
pst = con.prepareStatement("UPDATE " + tableName + " SET " + tableName + "." + column + "=? WHERE " + columnName + "=?;"); pst = con.prepareStatement("UPDATE " + tableName + " SET " + column + "=? WHERE " + columnName + "=?;");
pst.setString(1, auth.getNickname()); pst.setString(1, auth.getRealname());
pst.setString(2, auth.getNickname()); pst.setString(2, auth.getNickname());
pst.executeUpdate(); pst.executeUpdate();
} }
@ -272,12 +273,30 @@ public class MySQLThread extends Thread implements DataSource {
rs = pst.executeQuery(); rs = pst.executeQuery();
if (rs.next()) { if (rs.next()) {
id = rs.getInt(columnID); id = rs.getInt(columnID);
// Insert player in phpbb_user_group
pst = con.prepareStatement("INSERT INTO " + Settings.getPhpbbPrefix + "user_group (group_id, user_id, group_leader, user_pending) VALUES (?,?,?,?);"); pst = con.prepareStatement("INSERT INTO " + Settings.getPhpbbPrefix + "user_group (group_id, user_id, group_leader, user_pending) VALUES (?,?,?,?);");
pst.setInt(1, Settings.getPhpbbGroup); pst.setInt(1, Settings.getPhpbbGroup);
pst.setInt(2, id); pst.setInt(2, id);
pst.setInt(3, 0); pst.setInt(3, 0);
pst.setInt(4, 0); pst.setInt(4, 0);
pst.executeUpdate(); pst.executeUpdate();
// Update player group in phpbb_users
pst = con.prepareStatement("UPDATE " + tableName + " SET " + tableName + ".group_id=? WHERE " + columnName + "=?;");
pst.setInt(1, Settings.getPhpbbGroup);
pst.setString(2, auth.getNickname());
pst.executeUpdate();
// Get current time without ms
long time = System.currentTimeMillis()/1000;
// Update user_regdate
pst = con.prepareStatement("UPDATE " + tableName + " SET " + tableName + ".user_regdate=? WHERE " + columnName + "=?;");
pst.setLong(1, time);
pst.setString(2, auth.getNickname());
pst.executeUpdate();
// Update user_lastvisit
pst = con.prepareStatement("UPDATE " + tableName + " SET " + tableName + ".user_lastvisit=? WHERE " + columnName + "=?;");
pst.setLong(1, time);
pst.setString(2, auth.getNickname());
pst.executeUpdate();
} }
} }
if (Settings.getPasswordHash == HashAlgorithm.WORDPRESS) { if (Settings.getPasswordHash == HashAlgorithm.WORDPRESS) {
@ -457,6 +476,9 @@ public class MySQLThread extends Thread implements DataSource {
while (rs.next()) { while (rs.next()) {
list.add(rs.getString(columnName)); list.add(rs.getString(columnName));
} }
pst = con.prepareStatement("DELETE FROM " + tableName + " WHERE " + columnLastLogin + "<?;");
pst.setLong(1, until);
pst.executeUpdate();
return list; return list;
} catch (SQLException ex) { } catch (SQLException ex) {
ConsoleLogger.showError(ex.getMessage()); ConsoleLogger.showError(ex.getMessage());

View File

@ -11,6 +11,7 @@ import java.util.List;
import fr.xephi.authme.AuthMe; import fr.xephi.authme.AuthMe;
import fr.xephi.authme.ConsoleLogger; import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.api.API;
import fr.xephi.authme.cache.auth.PlayerAuth; import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.datasource.DataSource; import fr.xephi.authme.datasource.DataSource;
import fr.xephi.authme.datasource.MiniConnectionPoolManager.TimeoutException; import fr.xephi.authme.datasource.MiniConnectionPoolManager.TimeoutException;
@ -169,12 +170,12 @@ public class SQLiteThread extends Thread implements DataSource {
rs = pst.executeQuery(); rs = pst.executeQuery();
if (rs.next()) { if (rs.next()) {
if (rs.getString(columnIp).isEmpty() ) { if (rs.getString(columnIp).isEmpty() ) {
return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword), "198.18.0.1", rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld) , rs.getString(columnEmail)); return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword), "198.18.0.1", rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld) , rs.getString(columnEmail), API.getPlayerRealName(rs.getString(columnName)));
} else { } else {
if(!columnSalt.isEmpty()){ if(!columnSalt.isEmpty()){
return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword),rs.getString(columnSalt), rs.getInt(columnGroup), rs.getString(columnIp), rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld) , rs.getString(columnEmail)); return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword),rs.getString(columnSalt), rs.getInt(columnGroup), rs.getString(columnIp), rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld) , rs.getString(columnEmail), API.getPlayerRealName(rs.getString(columnName)));
} else { } else {
return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword), rs.getString(columnIp), rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld) , rs.getString(columnEmail)); return new PlayerAuth(rs.getString(columnName), rs.getString(columnPassword), rs.getString(columnIp), rs.getLong(columnLastLogin), rs.getInt(lastlocX), rs.getInt(lastlocY), rs.getInt(lastlocZ), rs.getString(lastlocWorld) , rs.getString(columnEmail), API.getPlayerRealName(rs.getString(columnName)));
} }
} }
} else { } else {

View File

@ -224,6 +224,8 @@ 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
forceCommands: []
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: ''
@ -343,7 +345,24 @@ Purge:
daysBeforeRemovePlayer: 60 daysBeforeRemovePlayer: 60
# Do we need to remove the player.dat file during purge process ? # Do we need to remove the player.dat file during purge process ?
removePlayerDat: false removePlayerDat: false
# Do we need to remove the Essentials/users/player.yml file during purge proecess ? # Do we need to remove the Essentials/users/player.yml file during purge process ?
removeEssentialsFile: false removeEssentialsFile: false
# World where are players.dat stores # World where are players.dat stores
defaultWorld: 'world' defaultWorld: 'world'
# Do we need to remove LimitedCreative/inventories/player.yml , player_creative.yml files during purge process ?
removeLimitedCreativesInventories: false
# Do we need to remove the AntiXRayData/PlayerData/player file during purge process ?
removeAntiXRayFile: false
Protection:
# Enable some servers protection ( country based login, antibot )
enableProtection: false
# Countries allowed to join the server and register, see http://dev.maxmind.com/geoip/legacy/codes/iso3166/ for countries' codes
countries:
- US
- GB
# Do we need to enable automatic antibot system?
enableAntiBot: false
# Max number of player allowed to login in 5 secs before enable AntiBot system automatically
antiBotSensibility: 5
# Duration in minutes of the antibot automatic system
antiBotDuration: 10

View File

@ -49,3 +49,6 @@ email_added: '[AuthMe] E-mail adicionado com sucesso!'
email_confirm: '[AuthMe] Confirme seu e-mail!' email_confirm: '[AuthMe] Confirme seu e-mail!'
email_changed: '[AuthMe] E-mail alterado!' email_changed: '[AuthMe] E-mail alterado!'
email_send: '[AuthMe] E-mail com nova senha enviado!' email_send: '[AuthMe] E-mail com nova senha enviado!'
country_banned: 'Your country is banned from this server'
antibot_auto_enabled: '[AuthMe] AntiBotMod automatically enabled due to massive connections!'
antibot_auto_disabled: '[AuthMe] AntiBotMod automatically disabled after %m Minutes, hope invasion stopped'

View File

@ -51,3 +51,6 @@ email_added: '[AuthMe] Email pridan !'
email_confirm: '[AuthMe] Potvrd prosim svuj email !' email_confirm: '[AuthMe] Potvrd prosim svuj email !'
email_changed: '[AuthMe] Email zmenen !' email_changed: '[AuthMe] Email zmenen !'
email_send: '[AuthMe] Email pro obnoveni hesla odeslan !' email_send: '[AuthMe] Email pro obnoveni hesla odeslan !'
country_banned: 'Your country is banned from this server'
antibot_auto_enabled: '[AuthMe] AntiBotMod automatically enabled due to massive connections!'
antibot_auto_disabled: '[AuthMe] AntiBotMod automatically disabled after %m Minutes, hope invasion stopped'

View File

@ -50,4 +50,7 @@ email_invalid: '[AuthMe] Invalid Email'
email_added: '[AuthMe] Email Added !' email_added: '[AuthMe] Email Added !'
email_confirm: '[AuthMe] Confirm your Email !' email_confirm: '[AuthMe] Confirm your Email !'
email_changed: '[AuthMe] Email Change !' email_changed: '[AuthMe] Email Change !'
email_send: '[AuthMe] Recovery Email Send !' email_send: '[AuthMe] Recovery Email Send !'
country_banned: 'Your country is banned from this server'
antibot_auto_enabled: '[AuthMe] AntiBotMod automatically enabled due to massive connections!'
antibot_auto_disabled: '[AuthMe] AntiBotMod automatically disabled after %m Minutes, hope invasion stopped'

View File

@ -36,7 +36,7 @@ regex: '&cYour nickname contains illegal characters. Allowed chars: REG_EX'
add_email: '&cPlease add your email with : /email add yourEmail confirmEmail' add_email: '&cPlease add your email with : /email add yourEmail confirmEmail'
bad_database_email: '[AuthMe] This /email command only available with MySQL and SQLite, contact an Admin' bad_database_email: '[AuthMe] This /email command only available with MySQL and SQLite, contact an Admin'
recovery_email: '&cForgot your password? Please use /email recovery <yourEmail>' recovery_email: '&cForgot your password? Please use /email recovery <yourEmail>'
usage_captcha: '&cUsage: /captcha <theCaptcha>' usage_captcha: '&cYou need to type a captcha, please type: /captcha <theCaptcha>'
wrong_captcha: '&cWrong Captcha, please use : /captcha THE_CAPTCHA' wrong_captcha: '&cWrong Captcha, please use : /captcha THE_CAPTCHA'
valid_captcha: '&cYour captcha is valid !' valid_captcha: '&cYour captcha is valid !'
kick_forvip: '&cA VIP Player join the full server!' kick_forvip: '&cA VIP Player join the full server!'
@ -51,3 +51,6 @@ email_added: '[AuthMe] Email Added !'
email_confirm: '[AuthMe] Confirm your Email !' email_confirm: '[AuthMe] Confirm your Email !'
email_changed: '[AuthMe] Email Change !' email_changed: '[AuthMe] Email Change !'
email_send: '[AuthMe] Recovery Email Send !' email_send: '[AuthMe] Recovery Email Send !'
country_banned: 'Your country is banned from this server'
antibot_auto_enabled: '[AuthMe] AntiBotMod automatically enabled due to massive connections!'
antibot_auto_disabled: '[AuthMe] AntiBotMod automatically disabled after %m Minutes, hope invasion stopped'

View File

@ -52,3 +52,6 @@ email_added: '[AuthMe] Email agregado !'
email_confirm: '[AuthMe] Confirma tu Email !' email_confirm: '[AuthMe] Confirma tu Email !'
email_changed: '[AuthMe] Email cambiado !' email_changed: '[AuthMe] Email cambiado !'
email_send: '[AuthMe] Correo de recuperación enviado !' email_send: '[AuthMe] Correo de recuperación enviado !'
country_banned: 'Your country is banned from this server'
antibot_auto_enabled: '[AuthMe] AntiBotMod automatically enabled due to massive connections!'
antibot_auto_disabled: '[AuthMe] AntiBotMod automatically disabled after %m Minutes, hope invasion stopped'

View File

@ -51,3 +51,6 @@ email_added: '[AuthMe] Sähköposti lisätty!'
email_confirm: '[AuthMe] Vahvistuta sähköposti!' email_confirm: '[AuthMe] Vahvistuta sähköposti!'
email_changed: '[AuthMe] Sähköposti vaihdettu!' email_changed: '[AuthMe] Sähköposti vaihdettu!'
email_send: '[AuthMe] Palautus sähköposti lähetetty!' email_send: '[AuthMe] Palautus sähköposti lähetetty!'
country_banned: 'Your country is banned from this server'
antibot_auto_enabled: '[AuthMe] AntiBotMod automatically enabled due to massive connections!'
antibot_auto_disabled: '[AuthMe] AntiBotMod automatically disabled after %m Minutes, hope invasion stopped'

View File

@ -26,7 +26,7 @@ unvalid_session: '&fSession invalide, relancez le jeu ou attendez la fin de la s
reg_only: '&fSeul les joueurs enregistré sont admis!' reg_only: '&fSeul les joueurs enregistré sont admis!'
logged_in: '&cVous êtes déjà connecté!' logged_in: '&cVous êtes déjà connecté!'
logout: '&cVous avez été déconnecté!' logout: '&cVous avez été déconnecté!'
same_nick: '&fUne personne ayant ce même pseudo joue deja..' same_nick: '&fUne personne ayant ce même pseudo joue déjà..'
registered: '&cEnregistrement réussi avec succès!' registered: '&cEnregistrement réussi avec succès!'
pass_len: '&fVotre mot de passe n''est pas assez long..' pass_len: '&fVotre mot de passe n''est pas assez long..'
reload: '&fConfiguration et BDD relancé avec succès' reload: '&fConfiguration et BDD relancé avec succès'
@ -45,10 +45,13 @@ kick_fullserver: '&cLe serveur est actuellement plein, désolé!'
usage_email_add: '&fUsage: /email add <Email> <ConfirmeEmail> ' usage_email_add: '&fUsage: /email add <Email> <ConfirmeEmail> '
usage_email_change: '&fUsage: /email change <EmailAntigo> <NovoEmail> ' usage_email_change: '&fUsage: /email change <EmailAntigo> <NovoEmail> '
usage_email_recovery: '&fUsage: /email recovery <Email>' usage_email_recovery: '&fUsage: /email recovery <Email>'
new_email_invalid: '[AuthMe] New email invalid!' new_email_invalid: '[AuthMe] Nouvel email invalide!'
old_email_invalid: '[AuthMe] Old email invalid!' old_email_invalid: '[AuthMe] Ancien email invalide!'
email_invalid: '[AuthMe] Invalid Email' email_invalid: '[AuthMe] Email invalide'
email_added: '[AuthMe] Email Added !' email_added: '[AuthMe] Email ajouté !'
email_confirm: '[AuthMe] Confirm your Email !' email_confirm: '[AuthMe] Confirmez votre email !'
email_changed: '[AuthMe] Email Change !' email_changed: '[AuthMe] Email changé !'
email_send: '[AuthMe] Recovery Email Send !' email_send: '[AuthMe] Email de récupération envoyé!'
country_banned: 'Votre pays est banni de ce serveur'
antibot_auto_enabled: '[AuthMe] AntiBotMod a été activé automatiquement à cause de nombreuses connections!'
antibot_auto_disabled: '[AuthMe] AntiBotMod a été désactivé automatiquement après %m Minutes, espérons que l''invasion soit arrêtée!'

View File

@ -51,3 +51,6 @@ email_added: '[AuthMe] Email Added !'
email_confirm: '[AuthMe] Confirm your Email !' email_confirm: '[AuthMe] Confirm your Email !'
email_changed: '[AuthMe] Email Change !' email_changed: '[AuthMe] Email Change !'
email_send: '[AuthMe] Recovery Email Send !' email_send: '[AuthMe] Recovery Email Send !'
country_banned: 'Your country is banned from this server'
antibot_auto_enabled: '[AuthMe] AntiBotMod automatically enabled due to massive connections!'
antibot_auto_disabled: '[AuthMe] AntiBotMod automatically disabled after %m Minutes, hope invasion stopped'

View File

@ -51,3 +51,6 @@ email_added: '[AuthMe] Email Aggiunta!'
email_confirm: '[AuthMe] Conferma la tua Email!' email_confirm: '[AuthMe] Conferma la tua Email!'
email_changed: '[AuthMe] Email cambiata!' email_changed: '[AuthMe] Email cambiata!'
email_send: '[AuthMe] Email di recupero inviata!' email_send: '[AuthMe] Email di recupero inviata!'
country_banned: 'Your country is banned from this server'
antibot_auto_enabled: '[AuthMe] AntiBotMod automatically enabled due to massive connections!'
antibot_auto_disabled: '[AuthMe] AntiBotMod automatically disabled after %m Minutes, hope invasion stopped'

View File

@ -42,7 +42,7 @@ valid_captcha: '&c당신의 캡차는 올바릅니다 !'
kick_forvip: '&c한 VIP 플레이어가 만원인 서버에 입장했습니다!!' kick_forvip: '&c한 VIP 플레이어가 만원인 서버에 입장했습니다!!'
kick_fullserver: '&c그 서버는 실제로 만원입니다, 미안!' kick_fullserver: '&c그 서버는 실제로 만원입니다, 미안!'
usage_email_add: '&f사용법: /email add <이메일> <이메일재입력> ' usage_email_add: '&f사용법: /email add <이메일> <이메일재입력> '
usage_email_change: '&f사용법: /email change <oldEmail> <newEmail> ' usage_email_change: '&f사용법: /email change <기존이메일> <새이메일> '
usage_email_recovery: '&f사용법: /email recovery <이메일>' usage_email_recovery: '&f사용법: /email recovery <이메일>'
new_email_invalid: '[AuthMe] 새 이메일이 잘못되었습니다!' new_email_invalid: '[AuthMe] 새 이메일이 잘못되었습니다!'
old_email_invalid: '[AuthMe] 기존 이메일이 잘못되었습니다!' old_email_invalid: '[AuthMe] 기존 이메일이 잘못되었습니다!'
@ -51,3 +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'
antibot_auto_enabled: '[AuthMe] AntiBotMod automatically enabled due to massive connections!'
antibot_auto_disabled: '[AuthMe] AntiBotMod automatically disabled after %m Minutes, hope invasion stopped'

View File

@ -50,4 +50,7 @@ email_invalid: '[AuthMe] Invalid Email'
email_added: '[AuthMe] Email Added !' email_added: '[AuthMe] Email Added !'
email_confirm: '[AuthMe] Confirm your Email !' email_confirm: '[AuthMe] Confirm your Email !'
email_changed: '[AuthMe] Email Change !' email_changed: '[AuthMe] Email Change !'
email_send: '[AuthMe] Recovery Email Send !' email_send: '[AuthMe] Recovery Email Send !'
country_banned: 'Your country is banned from this server'
antibot_auto_enabled: '[AuthMe] AntiBotMod automatically enabled due to massive connections!'
antibot_auto_disabled: '[AuthMe] AntiBotMod automatically disabled after %m Minutes, hope invasion stopped'

View File

@ -0,0 +1,55 @@
unknown_user: Gebruiker is niet gevonden in database
unsafe_spawn: De locatie waar je de vorige keer het spel verlied was gevaarlijk, je bent geteleporteert naar de Spawn
not_logged_in: '&cNiet ingelogt!'
reg_voluntarily: Je kunt je gebruikersnaam registreren met "/register <wachtwoord> <herhaalWachtwoord>"
usage_log: '&cGebruik: /login <wachtwoord>'
wrong_pwd: '&cFout wachtwoord'
unregistered: '&cRegistratie succesvol ongedaan gemaakt!'
reg_disabled: '&cRegistratie is uitgeschakeld'
valid_session: '&cSessie ingelogt'
login: '&cSuccesvol ingelogt!'
vb_nonActiv: Je accound is nog niet geactiveerd, controleer je mailbox!
user_regged: '&cGebruikersnaam is al geregistreerd'
usage_reg: '&cGebruik: /register <wachtwoord> <herhaalWachtwoord>'
max_reg: Je hebt de maximale registraties van jouw account overschreden.
no_perm: '&cGeen toegang!'
error: Error; neem contact op met een ADMIN!
login_msg: '&cLog in met "/login <wachtwoord>"'
reg_msg: '&cRegistreer met "/register <wachtwoord> <herhaalWachtwoord>"'
usage_unreg: '&cGebruik: /unregister password'
pwd_changed: '&cWachtwoord aangepast!'
user_unknown: '&cGebruikersnaam niet geregistreerd'
password_error: Wachtwoord incorrect!
unvalid_session: Sessie beschadigt, wacht tot de sessie is verlopen en join opnieuw.
reg_only: Alleen voor geregistreerde spelers! Bezoek http://example.com om te registreren
logged_in: '&cJe bent al ingelogt!'
logout: '&cJe bent succesvol uitgelogt'
same_nick: Er is al iemand met jou gebruikersnaam online.
registered: '&cSuccesvol geregistreerd!'
pass_len: Je gekozen wachtwoord voldoet niet aan de minimum of maximum lengte
reload: Configuratie en database is opnieuw opgestard
timeout: Login time-out; het duurde telang voor je je inlogde.
usage_changepassword: 'Gebruik: /changepassword <oudWachtwoord> <nieuwWachtwoord>'
name_len: '&cJouw gebruikersnaam is te kort'
regex: '&cJouw gebruikersnaam bestaat uit illegale tekens. tegestaan chars: REG_EX'
add_email: '&cVoeg uw email toe Alstublieft met: /email add jouw wachtwoord herhaalwachtwoord'
bad_database_email: '[AuthMe] deze /email command is alleen beschikbaar met MySQL en SQLite, neem contact op met een Admin'
recovery_email: '&cWachtwoord vergeten? gebruik alstublieft /email recovery <Jouwemail>'
usage_captcha: '&cGebruik: /captcha <deCaptcha>'
wrong_captcha: '&cverkeerde Captcha, Gebruik alstublieft : /captcha THE_CAPTCHA'
valid_captcha: '&cJouw captcha is geldig!'
kick_forvip: '&cA VIP Gebruiker ga naar de volledige server!'
kick_fullserver: '&cDe server is eigenlijk vol, Sorry!'
usage_email_add: '&fGebruik: /email add <email> <herhaalEmail> '
usage_email_change: '&fGebruik: /email change <oudeEmail> <nieuweEmail> '
usage_email_recovery: '&fGebruik: /email recovery <Email>'
new_email_invalid: '[AuthMe] Nieuw email ongeldig!'
old_email_invalid: '[AuthMe] Oud email ongeldig!'
email_invalid: '[AuthMe] ongeldig Email'
email_added: '[AuthMe] Bevestig jouw Email !'
email_confirm: '[AuthMe] Bevestig jouw Email !'
email_changed: '[AuthMe] Email Veranderd !'
email_send: '[AuthMe] Herstel Email Verzonden !'
country_banned: 'Your country is banned from this server'
antibot_auto_enabled: '[AuthMe] AntiBotMod automatically enabled due to massive connections!'
antibot_auto_disabled: '[AuthMe] AntiBotMod automatically disabled after %m Minutes, hope invasion stopped'

View File

@ -51,3 +51,6 @@ email_added: '[AuthMe] Email dodany!'
email_confirm: '[AuthMe] Potwierdz swoj email!' email_confirm: '[AuthMe] Potwierdz swoj email!'
email_changed: '[AuthMe] Email zmieniony!' email_changed: '[AuthMe] Email zmieniony!'
email_send: '[AuthMe] Email z odzyskaniem wyslany!' email_send: '[AuthMe] Email z odzyskaniem wyslany!'
country_banned: 'Your country is banned from this server'
antibot_auto_enabled: '[AuthMe] AntiBotMod automatically enabled due to massive connections!'
antibot_auto_disabled: '[AuthMe] AntiBotMod automatically disabled after %m Minutes, hope invasion stopped'

View File

@ -52,3 +52,6 @@ email_added: 'Email adicionado com sucesso!'
email_confirm: 'Confirme o seu email!' email_confirm: 'Confirme o seu email!'
email_changed: 'Email alterado com sucesso!' email_changed: 'Email alterado com sucesso!'
email_send: 'Nova palavra-passe enviada para o seu email!' email_send: 'Nova palavra-passe enviada para o seu email!'
country_banned: 'Your country is banned from this server'
antibot_auto_enabled: '[AuthMe] AntiBotMod automatically enabled due to massive connections!'
antibot_auto_disabled: '[AuthMe] AntiBotMod automatically disabled after %m Minutes, hope invasion stopped'

View File

@ -1,58 +1,56 @@
unknown_user: '&cЭтого игрока нет в базе' unknown_user: '&cТакой игрок не зарегестрирован'
unsafe_spawn: '&6Твоё расположение перед выходом из игры было небезопасным - &aты unsafe_spawn: '&6Ваше расположение перед выходом было опасным - &aВы перенесены на спавн.'
перенесён на спавн' not_logged_in: '&cВы еще не вошли!'
not_logged_in: '&cТы не в игре!' reg_voluntarily: '&eРегистрация - &d/reg ПАРОЛЬ ПОВТОРАРОЛЯ'
reg_voluntarily: '&eЗарегистрируйся - &d/reg ПАРОЛЬ ПОВТОРАРОЛЯ &eили &d/register usage_log: '&eИспользование: &d/l ПАРОЛЬ'
ПАРОЛЬ ПОВТОРАРОЛЯ' wrong_pwd: '&cНеверный пароль'
usage_log: '&eСинтаксис: &d/l ПАРОЛЬ &eили &d/login ПАРОЛЬ' unregistered: '&cВы успешно удалили свой аккаунт!'
wrong_pwd: '&cНеправильный пароль'
unregistered: '&aРегистрация снята'
reg_disabled: '&6Регистрация отключена' reg_disabled: '&6Регистрация отключена'
valid_session: '&aСессия открыта' valid_session: '&cСессия включена'
login: '&aТы в игре' login: '&cУспешная авторизация!'
vb_nonActiv: '&aТвой аккаунт активирован. &5Проверь свою электронную почту.' vb_nonActiv: '&aВаш аккаунт активирован. &5Проверьте свою электронную почту.'
user_regged: '&cЭтот игрок уже зарегистрирован' user_regged: '&cТакой игрок уже зарегистрирован'
usage_reg: '&eСинтаксис: &d/reg ПАРОЛЬ ПОВТОРАРОЛЯ &eили &d/register ПАРОЛЬ ПОВТОРАРОЛЯ' usage_reg: '&cИспользование: /reg ПАРОЛЬ ПОВТОРАРОЛЯ'
max_reg: '&cТы превысил максимальное число регистраций' max_reg: '&fВы превысили максимальное количество регистраций на аккаунт'
no_perm: '&cНет разрешения' no_perm: '&cУ Вас нет прав'
error: '&cЧто-то пошло не так... &5Свяжись с администратором.' error: '&cЧто-то пошло не так; &5Свяжитесь с администратором.'
login_msg: '&eВойди в игру - &d/l ПАРОЛЬ &eили &d/login ПАРОЛЬ' login_msg: '&cВойти в игру - /login ПАРОЛЬ'
reg_msg: '&eЗарегистрируйся - &d/reg ПАРОЛЬ ПОВТОРАРОЛЯ &eили &d/register ПАРОЛЬ reg_msg: '&eЗарегистрируйтесь - &d/reg ПАРОЛЬ ПОВТОРАРОЛЯ'
ПОВТОРАРОЛЯ' reg_email_msg: '&cЗарегистрируйтесь - /register ВАШ_EMAIL ВАШ_EMAIL'
reg_email_msg: '&cPlease register with "/register <email> <confirmEmail>"' usage_unreg: '&cИспользование: /unregister ПАРОЛЬ'
usage_unreg: '&eСинтаксис: &d/unregister ПАРОЛЬ' pwd_changed: '&cПароль успешно изменен!'
pwd_changed: '&aПароль изменён'
user_unknown: '&cТакой игрок не зарегистрирован' user_unknown: '&cТакой игрок не зарегистрирован'
password_error: '&cПароль не найден' password_error: '&fПароль не совпадает'
unvalid_session: '&cДата сессии некорректна. &5Дождись конца сессии.' unvalid_session: '&cСессия некорректна. &5Дождитесь, пока сессия закончится.'
reg_only: '&cРегистрация только для игроков! &5Зайди на &dhttp://example.com &5для reg_only: '&fВход доступен только зарегистрированным игрокам! Зарегистрируйтесь здесь - http://example.com/?do=register'
регистрации.' logged_in: '&cВы уже вошли!'
logged_in: '&cТы уже в матрице!' logout: '&cВы успешно вышли'
logout: '&aТы вышел с сервера' same_nick: '&fТакой игрок уже играет на сервере'
same_nick: '&cЭтот игрок уже играет' registered: '&cУспешная регистрация!'
registered: '&aУспешная регистрация'
pass_len: '&cТвой пароль либо слишком длинный, либо слишком короткий' pass_len: '&cТвой пароль либо слишком длинный, либо слишком короткий'
reload: '&aКонфигурация и база данных перезагружена' reload: '&fКонфигурация и база данных перезагружены.'
timeout: '&cТы не успел войти в игру' timeout: '&fВремя входа истекло, попробуйте еще раз, но быстрее'
usage_changepassword: '&eСинтаксис: &d/changepassword СТАРЫЙ_ПАРОЛЬ НОВЫЙ_ПАРОЛЬ' usage_changepassword: '&fИспользование: /changepassword СТАРЫЙ_ПАРОЛЬ НОВЫЙ_ПАРОЛЬ'
name_len: '&cТвой ник либо слишком длинный, либо слишком короткий' name_len: '&cВаш логин слишком длинный или слишком короткий'
regex: '&cТвой ник содержит недопустимые символы. Разрешено использовать: REG_EX' regex: '&cВаш логин содержит запрещенные символы. Разрешенные символы: REG_EX'
add_email: '&eДобавь свой email: &d/email add АДРЕСОЧТЫ ПОВТОР_АДРЕСАОЧТЫ' add_email: '&cДобавьте свой email: /email add ВАШ_EMAIL ВАШ_EMAIL'
bad_database_email: '&c[AuthMe] Команда &d/email&c доступна только при работе с MySQL bad_database_email: '&c[AuthMe] Команда &d/email&c доступна только при работе с MySQL или SQLite'
или SQLite' recovery_email: '&cЗабыли пароль? Используйте /email recovery ВАШ_EMAIL'
recovery_email: '&cЗабыл пароль? Используй команду &d/email recovery <АДРЕСОЧТЫ>' usage_captcha: '&cИспользование: /captcha СИМВОЛЫ_ВЫШЕ'
usage_captcha: '&cUsage: /captcha <theCaptcha>' wrong_captcha: '&cНеправильная капча: /captcha СИМВОЛЫ_ВЫШЕ'
wrong_captcha: '&cWrong Captcha, please use : /captcha THE_CAPTCHA' valid_captcha: '&cКапча введена правильно!'
valid_captcha: '&cYour captcha is valid !' kick_forvip: '&cVIP игрок зашел на переполненный сервер!'
kick_forvip: '&cA VIP Player join the full server!' kick_fullserver: '&cСервер переполнен!'
kick_fullserver: '&cThe server is actually full, Sorry!' usage_email_add: '&fИспользование: /email add ВАШ_EMAIL ВАШ_EMAIL '
usage_email_add: '&fUsage: /email add <email> <confirmEmail> ' usage_email_change: '&fИспользование: /email change СТАРЫЙ_EMAIL НОВЫЙ_EMAIL '
usage_email_change: '&fUsage: /email change <oldEmail> <newEmail> ' usage_email_recovery: '&fИспользование: /email recovery ВАШ_EMAIL'
usage_email_recovery: '&fUsage: /email recovery <email>' new_email_invalid: '[AuthMe] Новый email недействителен!'
new_email_invalid: '[AuthMe] New email invalid!' old_email_invalid: '[AuthMe] Старый email недействителен!'
old_email_invalid: '[AuthMe] Old email invalid!' email_invalid: '[AuthMe] Email неправильный'
email_invalid: '[AuthMe] Invalid Email' email_added: '[AuthMe] Email добавлен!'
email_added: '[AuthMe] Email Added !' email_confirm: '[AuthMe] Подтвердите ваш email!'
email_confirm: '[AuthMe] Confirm your Email !' email_changed: '[AuthMe] Email изменен!'
email_changed: '[AuthMe] Email Change !' email_send: '[AuthMe] Восстановительное письмо отправлено!'
email_send: '[AuthMe] Recovery Email Send !' country_banned: 'Your country is banned from this server'
antibot_auto_enabled: '[AuthMe] AntiBotMod automatically enabled due to massive connections!'
antibot_auto_disabled: '[AuthMe] AntiBotMod automatically disabled after %m Minutes, hope invasion stopped'

View File

@ -54,4 +54,7 @@ email_invalid: '[AuthMe] Invalid Email'
email_added: '[AuthMe] Email Added !' email_added: '[AuthMe] Email Added !'
email_confirm: '[AuthMe] Confirm your Email !' email_confirm: '[AuthMe] Confirm your Email !'
email_changed: '[AuthMe] Email Change !' email_changed: '[AuthMe] Email Change !'
email_send: '[AuthMe] Recovery Email Send !' email_send: '[AuthMe] Recovery Email Send !'
country_banned: 'Your country is banned from this server'
antibot_auto_enabled: '[AuthMe] AntiBotMod automatically enabled due to massive connections!'
antibot_auto_disabled: '[AuthMe] AntiBotMod automatically disabled after %m Minutes, hope invasion stopped'

View File

@ -51,3 +51,6 @@ email_added: '[AuthMe] Email Added !'
email_confirm: '[AuthMe] Confirm your Email !' email_confirm: '[AuthMe] Confirm your Email !'
email_changed: '[AuthMe] Email Change !' email_changed: '[AuthMe] Email Change !'
email_send: '[AuthMe] Recovery Email Send !' email_send: '[AuthMe] Recovery Email Send !'
country_banned: 'Your country is banned from this server'
antibot_auto_enabled: '[AuthMe] AntiBotMod automatically enabled due to massive connections!'
antibot_auto_disabled: '[AuthMe] AntiBotMod automatically disabled after %m Minutes, hope invasion stopped'

View File

@ -1,3 +1,5 @@
# Translator: uSoc_lifehome (http://lifeho.me) #
# -------------------------------------------- #
unknown_user: '&f用戶資料並不存在於資料庫中 。' unknown_user: '&f用戶資料並不存在於資料庫中 。'
unsafe_spawn: '&f你的登出位置不安全 現在將傳送你到重生點 。' unsafe_spawn: '&f你的登出位置不安全 現在將傳送你到重生點 。'
not_logged_in: '&c你還沒有登入 ' not_logged_in: '&c你還沒有登入 '
@ -16,13 +18,13 @@ no_perm: '&c你並沒有這個權限 。'
error: '&f發生錯誤 請與管理員聯絡 。' error: '&f發生錯誤 請與管理員聯絡 。'
login_msg: '&c請使用這個指令來登入 《 /login <密碼> 》' login_msg: '&c請使用這個指令來登入 《 /login <密碼> 》'
reg_msg: '&c請使用這個的指令來註冊 《 /register <密碼> <重覆密碼> 》' reg_msg: '&c請使用這個的指令來註冊 《 /register <密碼> <重覆密碼> 》'
reg_email_msg: '&cPlease register with "/register <email> <confirmEmail>"' reg_email_msg: '&c請使用這個的指令來註冊 《 /register <電郵> <重覆電郵> 》'
usage_unreg: '&c用法 《 /unregister <密碼> 》' usage_unreg: '&c用法 《 /unregister <密碼> 》'
pwd_changed: '&c你成功的更換了你的密碼 ' pwd_changed: '&c你成功的更換了你的密碼 '
user_unknown: '&c此用戶名沒有已登記資料 。' user_unknown: '&c此用戶名沒有已登記資料 。'
password_error: '&f密碼不符合 。' password_error: '&f密碼不符合 。'
unvalid_session: '&f登入階段資料已損壞 請等待登入階段結束 。' unvalid_session: '&f登入階段資料已損壞 請等待登入階段結束 。'
reg_only: '&f限已註冊會員 請先到 http://example.com 註冊 。' reg_only: '&f限已註冊會員 請先到 https://www.craftinghk.com/ 註冊 。'
logged_in: '&c你已經登入過了 。' logged_in: '&c你已經登入過了 。'
logout: '&b你成功的登出了 。' logout: '&b你成功的登出了 。'
same_nick: '&f同名玩家已在遊玩 。' same_nick: '&f同名玩家已在遊玩 。'
@ -39,15 +41,18 @@ recovery_email: '&c忘記密碼 請使用這個的指令來更新密碼
usage_captcha: '&c用法 《 /captcha <驗證碼> 》' usage_captcha: '&c用法 《 /captcha <驗證碼> 》'
wrong_captcha: '&c你輸入了錯誤的驗證碼請使用 《 /captcha <驗證碼> 》 再次輸入 。' wrong_captcha: '&c你輸入了錯誤的驗證碼請使用 《 /captcha <驗證碼> 》 再次輸入 。'
valid_captcha: '&c你的驗證碼是無效的 ' valid_captcha: '&c你的驗證碼是無效的 '
kick_forvip: '&cA VIP Player join the full server!' kick_forvip: '&cA 因為有VIP玩家進入了伺服器 。'
kick_fullserver: '&cThe server is actually full, Sorry!' kick_fullserver: '&c抱歉 這個伺服器滿人了也許你需要VIP會藉'
usage_email_add: '&fUsage: /email add <email> <confirmEmail> ' usage_email_add: '&f用法 《 /email add <電郵> <重覆電郵> 》'
usage_email_change: '&fUsage: /email change <oldEmail> <newEmail> ' usage_email_change: '&f用法 《 /email change <舊電郵> <新電郵> 》'
usage_email_recovery: '&fUsage: /email recovery <email>' usage_email_recovery: '&f用法 《 /email recovery <電郵> 》'
new_email_invalid: '[AuthMe] New email invalid!' new_email_invalid: '你所填寫的新電郵地址並不正確。'
old_email_invalid: '[AuthMe] Old email invalid!' old_email_invalid: '你所填寫的舊電郵地址並不正確。'
email_invalid: '[AuthMe] Invalid Email' email_invalid: '你所填寫的電郵地址並不正確。'
email_added: '[AuthMe] Email Added !' email_added: '已加入你的電郵地址記錄。'
email_confirm: '[AuthMe] Confirm your Email !' email_confirm: '請重覆輸入你的電郵地址。'
email_changed: '[AuthMe] Email Change !' email_changed: '你的電郵地址記錄已更改。'
email_send: '[AuthMe] Recovery Email Send !' email_send: '忘記密碼確定信件已寄出,請查收。'
country_banned: 'Your country is banned from this server'
antibot_auto_enabled: '[AuthMe] AntiBotMod automatically enabled due to massive connections!'
antibot_auto_disabled: '[AuthMe] AntiBotMod automatically disabled after %m Minutes, hope invasion stopped'

View File

@ -3,7 +3,7 @@ author: Xephi59
website: http://dev.bukkit.org/bukkit-plugins/authme-recoded/ website: http://dev.bukkit.org/bukkit-plugins/authme-recoded/
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.0 version: 3.1.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:
@ -60,6 +60,9 @@ permissions:
authme.admin.lastlogin: true authme.admin.lastlogin: true
authme.admin.getemail: true authme.admin.getemail: true
authme.admin.chgemail: true authme.admin.chgemail: true
authme.admin.purgelastpos: true
authme.admin.switchantibot: true
authme.bypassantibot: true
authme.register: authme.register:
description: Register an account description: Register an account
default: true default: true
@ -77,7 +80,7 @@ permissions:
default: true default: true
authme.passpartu: authme.passpartu:
description: passpartu description: passpartu
default: true default: true
authme.allow2accounts: authme.allow2accounts:
description: allow more accounts for same ip description: allow more accounts for same ip
default: false default: false
@ -140,4 +143,16 @@ permissions:
default: op default: op
authme.admin.flattosqlite: authme.admin.flattosqlite:
description: Convert File to Sqlite method description: Convert File to Sqlite method
default: op
authme.bypassforcesurvival:
description: Bypass all ForceSurvival features
default: false
authme.admin.purgelastpos:
description: Purge last pos of players
default: op
authme.admin.switchantibot:
description: Switch AntiBot mode on/off
default: op
authme.bypassantibot:
description: Bypass the AntiBot check
default: op default: op