mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
fix(character): always write the GM, activity and social blocks on construction
Live wrote all three optional blocks of the character component in every player construction (9,726 LOT 1 constructions: gm_pvp_info with is_gm false and gm_level 0 for civilians, current_activity Some(None) on 9,620, social_info always Some with guild 0 and an empty name). DLU wrote each one only after something set its dirty flag, so civilians got none of them. Serializations are unchanged (still only when dirty). Writing the social block every time exposed two bugs in it: the guild ID was never initialized (now 0), and the guild name was written with sizeof(wchar_t) (4 on Linux) bits per character, reading past the end of the UTF-16 string; it is now written as 16-bit characters. Test: ReplicaConstructionTest.CharacterConstructionAlwaysWritesGmActivityAndSocialBlocks. Check in game: log in as a civilian and as a GM, with a second player watching; both see each other normally (name tags, GM tag/level for the GM, no PvP flag), and starting a quickbuild or pet taming still shows the activity to the other player. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -452,7 +452,7 @@ private:
|
||||
/**
|
||||
* The guild this character is in
|
||||
*/
|
||||
LWOOBJID m_GuildID;
|
||||
LWOOBJID m_GuildID = LWOOBJID_EMPTY;
|
||||
|
||||
/**
|
||||
* The name of the guild this character is in
|
||||
|
||||
Reference in New Issue
Block a user