Commentator player role

- Added "Commentator" player role (flag: "c").  This permits for users to be granted just the rights to see all currently active tables, with no restrictions on visibility.
- Squashed a couple of hidden references to hard-coded player roles
- Updated the competitive label for the upcoming WC matches
This commit is contained in:
Christian 'ketura' McCarty
2023-10-13 23:39:28 -05:00
parent 305d92f394
commit 771648dfdc
4 changed files with 6 additions and 4 deletions

View File

@@ -393,7 +393,7 @@ public class HallRequestHandler extends LotroServerRequestHandler implements Uri
_hallServer.signupUserForHall(resourceOwner, new SerializeHallInfoVisitor(doc, hall));
for (Map.Entry<String, LotroFormat> format : _formatLibrary.getHallFormats().entrySet()) {
//playtest formats are opt-in
if (format.getKey().startsWith("test") && !player.getType().contains("p"))
if (format.getKey().startsWith("test") && !player.hasType(Player.Type.PLAY_TESTER))
continue;
Element formatElem = doc.createElement("format");

View File

@@ -645,7 +645,7 @@ var GempLotrHallUI = Class.extend({
//TODO: Replace this with an actual fix on the server side
if(name.includes("Casual - WC")) {
name = "<td>Competitive - 2023 World Championship Walk-on Qualifiers</td>"
name = "<td><b>Group Stage - 2023 World Championship</b></td>"
}
row.append(name);
row.append("<td>" + statusDescription + "</td>");

View File

@@ -16,7 +16,7 @@ public class Player {
LEAGUE_ADMIN("l"),
PLAY_TESTER("p"),
//PLAY_TESTING_ADMIN("t"),
//COMMENTATOR("c"),
COMMENTATOR("c"),
//COMMENTATOR_ADMIN("m"),
UNBANNED("n"),
USER("u");

View File

@@ -546,7 +546,9 @@ public class HallServer extends AbstractServer {
}
protected void processHall(Player player, HallInfoVisitor visitor) {
final boolean isAdmin = player.getType().contains("a");
//Commentators are users permitted to watch tournament matches for the purposes of stream broadcasting.
//TODO: enhance this logic to not apply to tournaments that the commentator is themselves participating in
final boolean isAdmin = player.hasType(Player.Type.ADMIN) || player.hasType(Player.Type.COMMENTATOR);
_hallDataAccessLock.readLock().lock();
try {