13
0
geforkt von Mirrors/Velocity

Fix up some stuff

Dieser Commit ist enthalten in:
Andrew Steinborn 2018-11-21 23:36:47 -05:00
Ursprung 904e1367a2
Commit 1515c5069b

Datei anzeigen

@ -246,7 +246,8 @@ public class VelocityServer implements ProxyServer {
return false; return false;
} }
// Re-register servers. If we are replacing a server, we must evacuate players. // Re-register servers. If a server is being replaced, make sure to note what players need to
// move back to a fallback server.
Collection<ConnectedPlayer> evacuate = new ArrayList<>(); Collection<ConnectedPlayer> evacuate = new ArrayList<>();
for (Map.Entry<String, String> entry : newConfiguration.getServers().entrySet()) { for (Map.Entry<String, String> entry : newConfiguration.getServers().entrySet()) {
ServerInfo newInfo = ServerInfo newInfo =
@ -267,6 +268,8 @@ public class VelocityServer implements ProxyServer {
} }
} }
// If we had any players to evacuate, let's move them now. Wait until they are all moved off.
if (!evacuate.isEmpty()) {
CountDownLatch latch = new CountDownLatch(evacuate.size()); CountDownLatch latch = new CountDownLatch(evacuate.size());
for (ConnectedPlayer player : evacuate) { for (ConnectedPlayer player : evacuate) {
Optional<RegisteredServer> next = player.getNextServerToTry(); Optional<RegisteredServer> next = player.getNextServerToTry();
@ -291,6 +294,7 @@ public class VelocityServer implements ProxyServer {
logger.error("Interrupted whilst moving players", e); logger.error("Interrupted whilst moving players", e);
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
} }
}
// If we have a new bind address, bind to it // If we have a new bind address, bind to it
if (!configuration.getBind().equals(newConfiguration.getBind())) { if (!configuration.getBind().equals(newConfiguration.getBind())) {