mirror of
https://github.com/YuzuZensai/Minikura.git
synced 2026-01-31 14:57:49 +00:00
🐛 fix: don't allow migrating to current proxy
This commit is contained in:
@@ -31,7 +31,13 @@ object ProxyTransferUtils {
|
||||
val targetAddress = InetSocketAddress(targetServer.address, targetServer.port)
|
||||
val currentProxyName = redisBungeeApi.proxyId
|
||||
|
||||
val players = server.allPlayers.toList()
|
||||
val playerOnThisProxy = redisBungeeApi.getPlayersOnProxy(currentProxyName)
|
||||
.map { it.toString() }
|
||||
|
||||
val players = server.allPlayers
|
||||
.toList()
|
||||
.filter { playerOnThisProxy.contains(it.uniqueId.toString()) }
|
||||
|
||||
val batchSize = (players.size * 0.05).coerceAtLeast(1.0).toInt() // 5% of players per batch to avoid overloading the server
|
||||
|
||||
var currentIndex = 0
|
||||
|
||||
Reference in New Issue
Block a user