Core/Packets: Added SMSG_TUTORIAL_FLAGS

This commit is contained in:
Intel
2014-11-16 00:30:31 +02:00
parent 3bd83ff164
commit d87504dee5
3 changed files with 22 additions and 4 deletions

View File

@@ -41,3 +41,11 @@ WorldPacket const* WorldPackets::Misc::UITime::Write()
return &_worldPacket;
}
WorldPacket const* WorldPackets::Misc::TutorialFlags::Write()
{
for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i)
_worldPacket << TutorialData[i];
return &_worldPacket;
}

View File

@@ -64,6 +64,16 @@ namespace WorldPackets
uint32 Time = 0;
};
class TutorialFlags : public ServerPacket
{
public:
TutorialFlags() : ServerPacket(SMSG_WORLD_STATE_UI_TIMER_UPDATE, 32) { }
WorldPacket const* Write() override;
uint32 TutorialData[8];
};
}
}

View File

@@ -50,6 +50,7 @@
#include "BattlenetServerManager.h"
#include "CharacterPackets.h"
#include "ClientConfigPackets.h"
#include "MiscPackets.h"
namespace {
@@ -767,10 +768,9 @@ void WorldSession::LoadTutorialsData()
void WorldSession::SendTutorialsData()
{
WorldPacket data(SMSG_TUTORIAL_FLAGS, 4 * MAX_ACCOUNT_TUTORIAL_VALUES);
for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i)
data << m_Tutorials[i];
SendPacket(&data);
WorldPackets::Misc::TutorialFlags packet;
memcpy(packet.TutorialData, m_Tutorials, sizeof(packet.TutorialData));
SendPacket(packet.Write());
}
void WorldSession::SaveTutorialsData(SQLTransaction &trans)