Update 3.3.3

This commit is contained in:
Xephi
2014-02-20 12:54:10 +01:00
parent 5a089fa690
commit 4e7e9e6cb4
21 changed files with 315 additions and 127 deletions
@@ -194,19 +194,19 @@ public class AsyncronousLogin {
if (auth == null) {
return;
}
if (this.database.getAllAuthsByName(auth).isEmpty() || this.database.getAllAuthsByName(auth) == null) {
List<String> auths = this.database.getAllAuthsByName(auth);
if (auths.isEmpty() || auths == null) {
return;
}
if (this.database.getAllAuthsByName(auth).size() == 1) {
if (auths.size() == 1) {
return;
}
List<String> accountList = this.database.getAllAuthsByName(auth);
String message = "[AuthMe] ";
int i = 0;
for (String account : accountList) {
for (String account : auths) {
i++;
message = message + account;
if (i != accountList.size()) {
if (i != auths.size()) {
message = message + ", ";
} else {
message = message + ".";
@@ -215,7 +215,7 @@ public class AsyncronousLogin {
for (Player player : plugin.getServer().getOnlinePlayers()) {
if (plugin.authmePermissible(player, "authme.seeOtherAccounts")) {
player.sendMessage("[AuthMe] The player " + auth.getNickname() + " has "
+ accountList.size() + " accounts");
+ auths.size() + " accounts");
player.sendMessage(message);
}
}
@@ -68,7 +68,7 @@ public class ProcessSyncronousPlayerLogin implements Runnable {
}
}
protected void teleportToSpawn() {
Location spawnL = plugin.getSpawnLocation(player.getWorld());
Location spawnL = plugin.getSpawnLocation(name, player.getWorld());
SpawnTeleportEvent tpEvent = new SpawnTeleportEvent(player, player.getLocation(), spawnL, true);
pm.callEvent(tpEvent);
if (!tpEvent.isCancelled()) {
@@ -187,7 +187,7 @@ public class ProcessSyncronousPlayerLogin implements Runnable {
if(Settings.useWelcomeMessage)
if(Settings.broadcastWelcomeMessage) {
for (String s : Settings.welcomeMsg) {
Bukkit.getServer().broadcastMessage(s);
Bukkit.getServer().broadcastMessage(plugin.replaceAllInfos(s, player));
}
} else {
for (String s : Settings.welcomeMsg) {
@@ -66,17 +66,24 @@ public class AsyncronousRegister {
}
if(Settings.getmaxRegPerIp > 0 ){
if(!plugin.authmePermissible(player, "authme.allow2accounts") && database.getAllAuthsByIp(getIp()).size() >= Settings.getmaxRegPerIp) {
if(!plugin.authmePermissible(player, "authme.allow2accounts") && database.getAllAuthsByIp(getIp()).size() >= Settings.getmaxRegPerIp && !getIp().equalsIgnoreCase("127.0.0.1") && !getIp().equalsIgnoreCase("localhost")) {
m._(player, "max_reg");
allowRegister = false;
}
}
}
public void process() {
preRegister();
if(!allowRegister) return;
if(!email.isEmpty() && email != "") {
if(Settings.getmaxRegPerEmail > 0) {
if (!plugin.authmePermissible(player, "authme.allow2accounts") && database.getAllAuthsByEmail(email).size() >= Settings.getmaxRegPerEmail) {
m._(player, "max_reg");
return;
}
}
emailRegister();
return;
}
@@ -49,7 +49,7 @@ public class ProcessSyncronousEmailRegister implements Runnable {
if (Settings.isTeleportToSpawnEnabled) {
World world = player.getWorld();
Location loca = plugin.getSpawnLocation(world);
Location loca = plugin.getSpawnLocation(name, world);
RegisterTeleportEvent tpEvent = new RegisterTeleportEvent(player, loca);
plugin.getServer().getPluginManager().callEvent(tpEvent);
if(!tpEvent.isCancelled()) {
@@ -44,7 +44,7 @@ public class ProcessSyncronousPasswordRegister implements Runnable {
player.setGameMode(limbo.getGameMode());
if (Settings.isTeleportToSpawnEnabled) {
World world = player.getWorld();
Location loca = plugin.getSpawnLocation(world);
Location loca = plugin.getSpawnLocation(name, world);
RegisterTeleportEvent tpEvent = new RegisterTeleportEvent(player, loca);
plugin.getServer().getPluginManager().callEvent(tpEvent);
if(!tpEvent.isCancelled()) {