Merge branch 'master' of ssh://184.154.0.242:7999/min/Mineplex

This commit is contained in:
Ty 2014-08-13 16:37:20 -04:00
commit 5c5a57b048
3 changed files with 12 additions and 18 deletions

View File

@ -48,6 +48,8 @@ public class LobbyBalancer implements Listener, Runnable
if (!event.getTarget().getName().equalsIgnoreCase("Lobby"))
return;
int bungeeBufferNumber = 20;
synchronized (_serverLock)
{
if (_playersSentToBestServer >= _maxPlayersToSendToBestServer)
@ -57,7 +59,7 @@ public class LobbyBalancer implements Listener, Runnable
while (_bestServerIndex < _sortedLobbies.size())
{
_bestServerIndex++;
_maxPlayersToSendToBestServer = (_sortedLobbies.get(_bestServerIndex).getMaxPlayerCount() - _sortedLobbies.get(_bestServerIndex).getPlayerCount());
_maxPlayersToSendToBestServer = (_sortedLobbies.get(_bestServerIndex).getMaxPlayerCount() - _sortedLobbies.get(_bestServerIndex).getPlayerCount()) / bungeeBufferNumber;
if (_maxPlayersToSendToBestServer > 0)
break;
@ -69,7 +71,11 @@ public class LobbyBalancer implements Listener, Runnable
_maxPlayersToSendToBestServer = 1;
// Since we had to enter our dangerzone, update local data so if we have to enter it again we don't pick the same server over and over
_sortedLobbies.get(_bestServerIndex).incrementPlayerCount(5);
_sortedLobbies.get(_bestServerIndex).incrementPlayerCount(5);
bungeeBufferNumber -= 2;
if (bungeeBufferNumber <= 0)
bungeeBufferNumber = 0;
}
}

View File

@ -100,14 +100,6 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
AddItem(22, item);
}
private void clearPage()
{
for (int i = 0; i < getSize(); i++)
{
setItem(i, null);
}
}
private ShopItem buildShopItem(ServerInfo serverInfo, int slotsNeeded)
{
boolean ownsUltraPackage = DonationManager.Get(Player.getName()).OwnsUnknownPackage(serverInfo.ServerType + " ULTRA") || Client.GetRank().Has(Rank.ULTRA);
@ -287,14 +279,16 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
@Override
public void Clicked(Player player)
{
clearPage();
clear();
_onMainPage = true;
}
});
while (slot < getSize())
{
setItem(slot, null);
if (getItem(slot) != null)
setItem(slot, null);
slot++;
}
}

View File

@ -135,12 +135,6 @@ public class ServerMonitor
for (ServerGroup serverGroup : serverGroups)
{
handleGroupChanges(dedicatedServers, serverTracker, serverGroup, false);
if (serverGroup.getGenerateFreeVersions() && _count % 6 == 0)
{
handleGroupChanges(dedicatedServers, serverTracker, serverGroup, true);
}
}
int processWaits = 0;