Skip to content

[Player Counter] Use uuid for avatar image#129

Merged
Boy132 merged 2 commits intopelican-dev:mainfrom
LetterN:patch-2
May 4, 2026
Merged

[Player Counter] Use uuid for avatar image#129
Boy132 merged 2 commits intopelican-dev:mainfrom
LetterN:patch-2

Conversation

@LetterN
Copy link
Copy Markdown
Contributor

@LetterN LetterN commented May 1, 2026

UUID is stable, usernames are not.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed player avatar image retrieval to display correctly for each player.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 1, 2026

📝 Walkthrough

Walkthrough

The avatar image URL in the Players table is now generated using each player's unique ID instead of their name when constructing the cravatar.eu image path.

Changes

Avatar Image URL Update

Layer / File(s) Summary
Display Configuration
player-counter/src/Filament/Server/Pages/PlayersPage.php
Avatar image URL now uses $record['id'] instead of $record['name'] for the cravatar.eu image path.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A rabbit hops through avatar land,
Where names once reigned with steady hand,
But IDs shine with clearer light,
Each player's face now framed just right! 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately reflects the main change: updating avatar image URL generation to use UUID instead of username/name field for the cravatar.eu image path.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@Boy132
Copy link
Copy Markdown
Member

Boy132 commented May 1, 2026

This won't work. For one you didn't edit the "is_whitelisted" check so it will still compare the username with the uuid. Also, the uuid isn't always known - depending on ping or query.

@LetterN
Copy link
Copy Markdown
Contributor Author

LetterN commented May 2, 2026

(webedit pr issue) fixed it, should be correctly doing it now

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@player-counter/src/Filament/Server/Pages/PlayersPage.php`:
- Around line 141-143: The ImageColumn state currently uses $record['id'] which
may be the player name not a UUID; update the state closure in PlayersPage (the
ImageColumn::make('avatar')->state(...)) to prefer a real UUID field (e.g.,
$record['uuid'] or whatever MinecraftJavaQueryTypeSchema provides) and only fall
back to $record['id'] if no UUID exists or it does not match a UUID pattern;
ensure you reference the upstream GameQuery::runQuery /
MinecraftJavaQueryTypeSchema mapping so the state uses the canonical UUID when
present and otherwise uses a deterministic fallback (player name) so avatars
remain stable.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9e54ca83-fa47-4c1f-a11c-9911e53d385c

📥 Commits

Reviewing files that changed from the base of the PR and between 13bd696 and c28c5f1.

📒 Files selected for processing (1)
  • player-counter/src/Filament/Server/Pages/PlayersPage.php
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: PHPStan (8.3)
  • GitHub Check: PHPStan (8.4)
  • GitHub Check: PHPStan (8.2)
  • GitHub Check: PHPStan (8.5)

Comment thread player-counter/src/Filament/Server/Pages/PlayersPage.php
@LetterN
Copy link
Copy Markdown
Contributor Author

LetterN commented May 2, 2026

Also, the uuid isn't always known - depending on ping or query.

on query protocol name is the uuid (so should be fine), but ping gives reliable-enough uuid (unless client disables)

@Boy132 Boy132 changed the title [Player Counter, MC Java] use uuid instead of username [Player Counter] Use uuid for avatar image May 4, 2026
@Boy132 Boy132 merged commit c311f42 into pelican-dev:main May 4, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants