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
+24 -32
View File
@@ -5,10 +5,10 @@ import fr.xephi.authme.settings.Settings;
public class PlayerAuth {
private String nickname;
private String hash;
private String nickname = "";
private String hash = "";
private String ip = "198.18.0.1";
private long lastLogin;
private long lastLogin = 0;
private int x = 0;
private int y = 0;
private int z = 0;
@@ -17,20 +17,15 @@ public class PlayerAuth {
private String vBhash = null;
private int groupId;
private String email = "your@email.com";
private String realName = "";
public PlayerAuth(String nickname, String hash, String ip, long lastLogin) {
this.nickname = nickname;
this.hash = hash;
this.ip = ip;
this.lastLogin = lastLogin;
}
public PlayerAuth(String nickname, String hash, String ip, long lastLogin, String email) {
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;
this.email = email;
this.realName = realName;
}
public PlayerAuth(String nickname, int x, int y, int z, String world) {
@@ -41,7 +36,7 @@ public class PlayerAuth {
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.hash = hash;
this.ip = ip;
@@ -51,9 +46,10 @@ public class PlayerAuth {
this.z = z;
this.world = world;
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.hash = hash;
this.ip = ip;
@@ -64,27 +60,30 @@ public class PlayerAuth {
this.world = world;
this.salt = salt;
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.hash = hash;
this.ip = ip;
this.lastLogin = lastLogin;
this.salt = salt;
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.hash = hash;
this.ip = ip;
this.lastLogin = lastLogin;
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.hash = hash;
this.ip = ip;
@@ -94,19 +93,8 @@ public class PlayerAuth {
this.z = z;
this.world = world;
this.salt = salt;
this.email = email;
}
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";
this.email = email;
this.realName = realName;
}
public String getIp() {
@@ -118,7 +106,7 @@ public class PlayerAuth {
}
public String getHash() {
if(!salt.isEmpty() && Settings.getPasswordHash == HashAlgorithm.MD5VB) {
if(salt != null && !salt.isEmpty() && Settings.getPasswordHash == HashAlgorithm.MD5VB) {
vBhash = "$MD5vb$"+salt+"$"+hash;
return vBhash;
}
@@ -208,9 +196,13 @@ public class PlayerAuth {
@Override
public String toString() {
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;
}
public String getRealname() {
return realName;
}
}
+4 -3
View File
@@ -3,12 +3,12 @@ package fr.xephi.authme.cache.limbo;
import java.util.HashMap;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.api.API;
import fr.xephi.authme.cache.backup.FileCache;
import fr.xephi.authme.events.ResetInventoryEvent;
import fr.xephi.authme.events.StoreInventoryEvent;
@@ -30,6 +30,7 @@ public class LimboCache {
public void addLimboPlayer(Player player) {
String name = player.getName().toLowerCase();
Location loc = player.getLocation();
loc.setY(loc.getY() + 0.4D);
int gameMode = player.getGameMode().getValue();
ItemStack[] arm;
ItemStack[] inv;
@@ -69,11 +70,11 @@ public class LimboCache {
}
if(Settings.isForceSurvivalModeEnabled) {
if(Settings.isResetInventoryIfCreative && gameMode != 0 ) {
if(Settings.isResetInventoryIfCreative && player.getGameMode() == GameMode.CREATIVE ) {
ResetInventoryEvent event = new ResetInventoryEvent(player);
Bukkit.getServer().getPluginManager().callEvent(event);
if (!event.isCancelled()) {
API.setPlayerInventory(player, new ItemStack[36], new ItemStack[4]);
player.getInventory().clear();
player.sendMessage("Your inventory has been cleaned!");
}
}