Skip to content

Console use guid lookup when player offline#266

Merged
billy1arm merged 1 commit intomangoszero:masterfrom
bozimmerman:console_player_lookup
Mar 9, 2026
Merged

Console use guid lookup when player offline#266
billy1arm merged 1 commit intomangoszero:masterfrom
bozimmerman:console_player_lookup

Conversation

@bozimmerman
Copy link
Contributor

@bozimmerman bozimmerman commented Mar 8, 2026

This is a quality of life change for admin console commands that target players. If you select an offline player and use a command that targets players, it will correctly resolve them so the command works. See the commit message for more details, but that's the gist of it.

Not really an important change. Just something that annoyed me exactly ONE time, and I was ornery enough at the time to change it.


This change is Reviewable

Copilot AI review requested due to automatic review settings March 8, 2026 04:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves admin console command targeting by allowing console-selected players who have since gone offline to still be resolved via a stored GUID, enabling commands that accept offline targets to work as expected.

Changes:

  • Adds a GUID fallback path for console-selected players when the selected player is now offline.
  • Enhances player_name resolution for offline console targets by looking up the name from the GUID via ObjectMgr.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@AppVeyorBot
Copy link

When a console command is issued without a player name argument,
ExtractPlayerTarget normally resolves the target via getSelectedPlayer(),
which only returns online players. This change falls back to the stored
console selection GUID when the selected player is offline, and looks up
their name from the database if needed.

This primarily benefits commands that require a player GUID or name but
do not need a live Player pointer -- such as teleport or account queries.
Commands that operate on a live Player object will still fail for offline
targets. Impact is therefore limited to that subset of no-argument console
commands.
@bozimmerman bozimmerman force-pushed the console_player_lookup branch from fae136c to 73f13de Compare March 8, 2026 18:13
@AppVeyorBot
Copy link

@billy1arm billy1arm merged commit 82db102 into mangoszero:master Mar 9, 2026
8 checks passed
@bozimmerman bozimmerman deleted the console_player_lookup branch March 9, 2026 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants