Update 3.3.6 - Emergency Fix

//Changes 3.3.6://
* **Emergency fix: Email recovery method are now fixed and safety to
use**
* Support all craftbukkit builds
* Now Support our sponsor ipClean feature ( Get player real ip through
their servers )
* Now Cache correctly Item Custom Names and Lores
* Fix FlatToSQL converter
* Add /authme getip <playername> command, perm : authme.admin.getip
* Implement correctly XenForo Support
* Fix maxregperip
* Fix maxloginperip
* Add ForceCommandsAsConsole config
* Preparation for next features, coming soon !
This commit is contained in:
Xephi
2014-04-01 17:10:33 +02:00
parent 8c3dc12658
commit 864661c797
13 changed files with 101 additions and 10 deletions
@@ -144,7 +144,7 @@ public class AsyncronousLogin {
player.setNoDamageTicks(0);
m._(player, "login");
displayOtherAccounts(auth);
displayOtherAccounts(auth, player);
if (!Settings.noConsoleSpam)
ConsoleLogger.info(player.getName() + " logged in!");
@@ -156,6 +156,7 @@ public class AsyncronousLogin {
// makes player isLoggedin via API
PlayerCache.getInstance().addPlayer(auth);
database.setLogged(name);
plugin.otherAccounts.addPlayer(player.getUniqueId());
// As the scheduling executes the Task most likely after the current task, we schedule it in the end
// so that we can be sure, and have not to care if it might be processed in other order.
@@ -187,7 +188,7 @@ public class AsyncronousLogin {
}
}
public void displayOtherAccounts(PlayerAuth auth) {
public void displayOtherAccounts(PlayerAuth auth, Player p) {
if (!Settings.displayOtherAccounts) {
return;
}
@@ -195,6 +196,7 @@ public class AsyncronousLogin {
return;
}
List<String> auths = this.database.getAllAuthsByName(auth);
//List<String> uuidlist = plugin.otherAccounts.getAllPlayersByUUID(player.getUniqueId());
if (auths.isEmpty() || auths == null) {
return;
}
@@ -202,6 +204,7 @@ public class AsyncronousLogin {
return;
}
String message = "[AuthMe] ";
//String uuidaccounts = "[AuthMe] PlayerNames has %size% links to this UUID : ";
int i = 0;
for (String account : auths) {
i++;
@@ -212,11 +215,23 @@ public class AsyncronousLogin {
message = message + ".";
}
}
/*TODO: Active uuid system
i = 0;
for (String account : uuidlist) {
i++;
uuidaccounts = uuidaccounts + account;
if (i != auths.size()) {
uuidaccounts = uuidaccounts + ", ";
} else {
uuidaccounts = uuidaccounts + ".";
}
}*/
for (Player player : plugin.getServer().getOnlinePlayers()) {
if (plugin.authmePermissible(player, "authme.seeOtherAccounts")) {
player.sendMessage("[AuthMe] The player " + auth.getNickname() + " has "
+ auths.size() + " accounts");
player.sendMessage(message);
//player.sendMessage(uuidaccounts.replace("%size%", ""+uuidlist.size()));
}
}
}
@@ -53,9 +53,11 @@ public class ProcessSyncronousPlayerLogin implements Runnable {
player.setFlying(limbo.isFlying());
}
}
protected void packQuitLocation() {
Utils.getInstance().packCoords(auth.getQuitLocX(), auth.getQuitLocY(), auth.getQuitLocZ(), auth.getWorld(), player);
}
protected void teleportBackFromSpawn() {
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, limbo.getLoc());
pm.callEvent(tpEvent);
@@ -67,6 +69,7 @@ public class ProcessSyncronousPlayerLogin implements Runnable {
player.teleport(fLoc);
}
}
protected void teleportToSpawn() {
Location spawnL = plugin.getSpawnLocation(player);
SpawnTeleportEvent tpEvent = new SpawnTeleportEvent(player, player.getLocation(), spawnL, true);
@@ -79,6 +82,7 @@ public class ProcessSyncronousPlayerLogin implements Runnable {
player.teleport(fLoc);
}
}
protected void restoreInventory() {
RestoreInventoryEvent event = new RestoreInventoryEvent(player, limbo.getInventory(), limbo.getArmour());
Bukkit.getServer().getPluginManager().callEvent(event);
@@ -86,12 +90,16 @@ public class ProcessSyncronousPlayerLogin implements Runnable {
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) {}
}
for (String command : Settings.forceCommandsAsConsole) {
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), command.replace("%p", player.getName()));
}
}
@Override
@@ -147,6 +147,7 @@ public class AsyncronousRegister {
PlayerCache.getInstance().addPlayer(auth);
database.setLogged(name);
}
plugin.otherAccounts.addPlayer(player.getUniqueId());
ProcessSyncronousPasswordRegister syncronous = new ProcessSyncronousPasswordRegister(player, plugin);
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, syncronous);
return;
@@ -5,7 +5,6 @@ import me.muizers.Notifications.Notification;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Player;
import fr.xephi.authme.AuthMe;
@@ -48,7 +47,6 @@ public class ProcessSyncronousEmailRegister implements Runnable {
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(nwMsg);
if (Settings.isTeleportToSpawnEnabled) {
World world = player.getWorld();
Location loca = plugin.getSpawnLocation(player);
RegisterTeleportEvent tpEvent = new RegisterTeleportEvent(player, loca);
plugin.getServer().getPluginManager().callEvent(tpEvent);
@@ -5,7 +5,6 @@ import me.muizers.Notifications.Notification;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitScheduler;
@@ -80,7 +79,6 @@ public class ProcessSyncronousPasswordRegister implements Runnable {
if (limbo != null) {
player.setGameMode(limbo.getGameMode());
if (Settings.isTeleportToSpawnEnabled) {
World world = player.getWorld();
Location loca = plugin.getSpawnLocation(player);
RegisterTeleportEvent tpEvent = new RegisterTeleportEvent(player, loca);
plugin.getServer().getPluginManager().callEvent(tpEvent);