mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 16:10:36 +00:00
The PlayerLocation-taking C_PlayerInfo accessors. Resolve the location to a unit token - unit locations use their token, GUID locations via Unit::Identity::TokenFromGUID (while the GUID has a live token) - then: - GetName / GetSex / IsConnected tail-call the engine's Script_UnitName / Script_UnitSex / Script_UnitIsConnected (the GetFactionInfoByID forward-the-return pattern), reusing all vanilla unit logic. GetSex must go through the engine because the raw UNIT_FIELD_BYTES_0 gender byte is 0/1 while the API reports 2/3. IsConnected defaults to the local player when called with no location. - GetRace / GetClass read UNIT_FIELD_BYTES_0 for the numeric ids vanilla's UnitRace / UnitClass don't return (login-time mirror globals for "player", else the descriptor bytes); GetClass resolves className / classFile from ChrClasses.dbc like C_CreatureInfo.GetClassInfo. classID/raceID round-trip with C_CreatureInfo. Only the unit and guid location kinds resolve on 1.12; the chat/who/BG/ community/voice kinds return nil. New file - player/Info.cpp is the separate NameCache/GetPlayerInfoByGUID module. Adds the three Script_Unit* offsets from raw_globals.txt.