Do not lose stack information in case of server overload command termination
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Dieser Commit ist enthalten in:
Ursprung
5ae758fe34
Commit
6104864944
@ -28,7 +28,7 @@ import de.steamwar.sql.SteamwarUser;
|
|||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.Deque;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
@ -56,16 +56,16 @@ public class CommandPortal implements PortalHandler {
|
|||||||
maxId = stackIds[i-1];
|
maxId = stackIds[i-1];
|
||||||
}
|
}
|
||||||
|
|
||||||
Deque<Portal> stack = Portals.getStack(player);
|
Iterator<Portal> stack = Portals.getStack(player).iterator();
|
||||||
String[] pieces = new String[stackIds.length];
|
String[] pieces = new String[stackIds.length];
|
||||||
while (maxId > 0) {
|
while (maxId > 0) {
|
||||||
if(stack.isEmpty()) {
|
if(!stack.hasNext()) {
|
||||||
LobbySystem.getPlugin().getLogger().log(Level.WARNING, "Stackportal with missing elements: " + player.getName() + " /" + command);
|
LobbySystem.getPlugin().getLogger().log(Level.WARNING, "Stackportal with missing elements: " + player.getName() + " /" + command);
|
||||||
player.sendMessage("§cEigentlich solltest du gerade gar nicht durch dieses Portal durchgehen können...");
|
player.sendMessage("§cEigentlich solltest du gerade gar nicht durch dieses Portal durchgehen können...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Portal portal = stack.pop();
|
Portal portal = stack.next();
|
||||||
if(portal.type() == PortalType.STACK) {
|
if(portal.type() == PortalType.STACK) {
|
||||||
for(int i = 0; i < stackIds.length; i++) {
|
for(int i = 0; i < stackIds.length; i++) {
|
||||||
if(stackIds[i] == maxId) {
|
if(stackIds[i] == maxId) {
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren