MPS rank todo

This commit is contained in:
Chiss 2014-12-18 13:06:57 +11:00
parent 60f567a3fb
commit 437c1aeabe
3 changed files with 14 additions and 9 deletions

View File

@ -29,7 +29,7 @@ public class EditRotationPage extends BasePage
int slot = 9;
List<GameType> enabledGames = Plugin.GetServerConfig().GameList;
for (GameType type : _manager.getAvailableGames())
for (GameType type : _manager.getAvailableGames(Player))
{
addGameButton(slot, type, enabledGames.contains(type));
slot++;

View File

@ -25,7 +25,7 @@ public class SetGamePage extends BasePage
addBackButton(4);
int slot = 9;
for (GameType type : _manager.getAvailableGames())
for (GameType type : _manager.getAvailableGames(Player))
{
addGameButton(slot, type);
slot++;

View File

@ -324,21 +324,20 @@ public class GameHostManager implements Listener
Manager.GetGame().Announce(C.cGreen + C.Bold + _host.getName() + " has stopped the game.");
}
public boolean hasRank(Rank rank)
public boolean hasRank(Player player, Rank rank)
{
//TODO
return true;
return Manager.GetClients().Get(player).GetRank().Has(rank);
}
public List<GameType> getAvailableGames()
public List<GameType> getAvailableGames(Player player)
{
List<GameType> games = new ArrayList<GameType>();
if (hasRank(Rank.ULTRA))
if (hasRank(player, Rank.ULTRA))
games.addAll(ultraGames);
if (hasRank(Rank.HERO))
if (hasRank(player, Rank.HERO))
games.addAll(heroGames);
if (hasRank(Rank.MODERATOR))
if (hasRank(player, Rank.MODERATOR))
games.addAll(legendGames);
return games;
@ -356,4 +355,10 @@ public class GameHostManager implements Listener
_onlineAdmins.add(player);
UtilPlayer.message(player, F.main("Server", "You were given admin privileges for this private server"));
}
public boolean isAdminOnline()
{
return _onlineAdmins.isEmpty();
}
}