Skip to content

let admins see clan tags in FFA#4459

Open
ryanbarlow97 wants to merge 1 commit into
mainfrom
admin-clan-tags-ffa
Open

let admins see clan tags in FFA#4459
ryanbarlow97 wants to merge 1 commit into
mainfrom
admin-clan-tags-ffa

Conversation

@ryanbarlow97

@ryanbarlow97 ryanbarlow97 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Resolves #4446

Description:

left is an admin, right is a normal player:
image

admin can see their own tag, and the UON tag, the non-admin can only see their own tag.

Please complete the following:

  • I have added screenshots for all UI updates
  • I process any text displayed to the user through translateText() and I've added it to the en.json file
  • I have added relevant tests to the test directory

Please put your Discord username so you can be contacted if a bug or regression is found:

w.o.n

@ryanbarlow97 ryanbarlow97 added this to the v33 milestone Jun 30, 2026
@ryanbarlow97 ryanbarlow97 self-assigned this Jun 30, 2026
@ryanbarlow97 ryanbarlow97 requested a review from a team as a code owner June 30, 2026 16:54
Copilot AI review requested due to automatic review settings June 30, 2026 16:54
@ryanbarlow97 ryanbarlow97 added the UI/UX UI/UX changes including assets, menus, QoL, etc. label Jun 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5f2f4d1b-9ffd-4d0b-a118-642d2e79a859

📥 Commits

Reviewing files that changed from the base of the PR and between cd5f8a6 and 02ab98f.

📒 Files selected for processing (2)
  • src/server/GameServer.ts
  • tests/server/AdminClanTags.test.ts

Walkthrough

startInfoFor in GameServer gains an isAdmin boolean parameter. When isAdmin is true and the game mode is FFA, real clan tags are returned instead of null. The call site in sendStartGameMsg now passes isAdminRole(client.role). A new test file adds six cases covering admin/non-admin visibility, Team mode guard, no mutation of stored data, and anonymizeNames interaction.

Changes

Admin clan-tag reveal in FFA

Layer / File(s) Summary
startInfoFor signature and clan-tag reveal logic
src/server/GameServer.ts
Imports GameMode, changes startInfoFor(viewer, isAdmin) to conditionally return real clan tags when the viewer is an admin and game mode is FFA; sendStartGameMsg passes isAdminRole(client.role) to the updated function.
Admin clan-tag test suite
tests/server/AdminClanTags.test.ts
Adds makeGame helper with disableClanTags and stripped wireGameStartInfo, plus six tests: admin sees tags in FFA, non-admin does not, Team mode blocks reveal, gameStartInfo is not mutated, and anonymizeNames still hides usernames while admins see clan tags.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • openfrontio/OpenFrontIO#4000: Both PRs modify clan-tag visibility in GameServer using disableClanTags and clanTag stripping, with this PR adding admin/FFA exceptions on top of that foundation.

Suggested labels

Feature

Suggested reviewers

  • evanpelle

Poem

🏷️ Admins peek behind the curtain's veil,
Clan tags revealed when FFA's the tale.
Team mode stays blind, no cheating peeks through,
Six tests stand guard to keep the logic true.
Simple flag, clean code — the right thing to do! ✅

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: admins can now see clan tags in FFA.
Description check ✅ Passed The description is related to the change and its screenshots and tests.
Linked Issues check ✅ Passed The code and tests satisfy #4446 by showing clan tags to admins in FFA during live games.
Out of Scope Changes check ✅ Passed The changes stay focused on FFA clan-tag visibility and related tests, with no clear out-of-scope work.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

UI/UX UI/UX changes including assets, menus, QoL, etc.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

Allow admins to see clan tags in ffa during game.

2 participants