Jump to content

[9308][PATCH] Fixed SMSG_CHAR_ENUM opcode for character first login


Auntie Mangos

Recommended Posts

* What bug does the patch fix? What features does the patch add?

See src/game/Player.cpp:

     *p_data << uint32(char_flags);                          // character flags
    // character customize flags
    *p_data << uint32(atLoginFlags & AT_LOGIN_CUSTOMIZE ? CHAR_CUSTOMIZE_FLAG_CUSTOMIZE : CHAR_CUSTOMIZE_FLAG_NONE);
    *p_data << uint8(1);                                    // unknown

The unknown field looks like a character first login flag.

When the character is at first login, it will be sent 1, the client could play cinematic but doesn't show game tips when loading map, else send 0, the client could show game tips.

This should fix the bug that game tips never be shown since 3.0, which are very useful for newbies.

* For which repository revision was the patch created?

[9162]

* Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

Yes.

http://getmangos.eu/community/showthread.php?7118-%5BBUG%5D-Client-Game-tips-are-not-work-since-3-0&highlight=

* Who has been writing this patch? Please include either forum user names or email addresses.

daveh

Patch:

diff --git a/src/game/CharacterHandler.cpp b/src/game/CharacterHandler.cpp
index f0fecc1..765a7c9 100644
--- a/src/game/CharacterHandler.cpp
+++ b/src/game/CharacterHandler.cpp
@@ -456,6 +456,8 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
    if ((have_same_race && skipCinematics == CINEMATICS_SKIP_SAME_RACE) || skipCinematics == CINEMATICS_SKIP_ALL)
        pNewChar->setCinematic(1);                          // not show intro

+    pNewChar->SetAtLoginFlag(AT_LOGIN_FIRST);
+
    // Player created, save it now
    pNewChar->SaveToDB();
    charcount += 1;
@@ -768,6 +770,9 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder *holder)
        SendNotification(LANG_RESET_TALENTS);
    }

+    if (pCurrChar->HasAtLoginFlag(AT_LOGIN_FIRST))
+        pCurrChar->RemoveAtLoginFlag(AT_LOGIN_FIRST);
+
    // show time before shutdown if shutdown planned.
    if(sWorld.IsShutdowning())
        sWorld.ShutdownMsg(true,pCurrChar);
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 2a33142..0715694 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -1486,7 +1486,7 @@ bool Player::BuildEnumData( QueryResult * result, WorldPacket * p_data )
    *p_data << uint32(char_flags);                          // character flags
    // character customize flags
    *p_data << uint32(atLoginFlags & AT_LOGIN_CUSTOMIZE ? CHAR_CUSTOMIZE_FLAG_CUSTOMIZE : CHAR_CUSTOMIZE_FLAG_NONE);
-    *p_data << uint8(1);                                    // unknown
+    *p_data << uint8(atLoginFlags & AT_LOGIN_FIRST ? 1 : 0); // character first login

    // Pets info
    {
diff --git a/src/game/Player.h b/src/game/Player.h
index 44a3bcb..a677f6f 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -563,6 +563,7 @@ enum AtLoginFlags
    AT_LOGIN_RESET_TALENTS     = 0x04,
    AT_LOGIN_CUSTOMIZE         = 0x08,
    AT_LOGIN_RESET_PET_TALENTS = 0x10,
+    AT_LOGIN_FIRST             = 0x20,
};

typedef std::map<uint32, QuestStatusData> QuestStatusMap;

Link to comment
Share on other sites

  • 40 years later...
  • 3 weeks later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use