Core/Packets: updated SMSG_BINDPOINTUPDATE, SMSG_INVALIDATE_PLAYER, SMSG_LOGIN_SETTIMESPEED, SMSG_WORLD_SERVER_INFO
This commit is contained in:
@@ -28,7 +28,6 @@
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "BattlegroundScore.h"
|
||||
#include "CellImpl.h"
|
||||
#include "Channel.h"
|
||||
#include "ChannelMgr.h"
|
||||
#include "CharacterDatabaseCleaner.h"
|
||||
#include "CharacterPackets.h"
|
||||
@@ -16830,6 +16829,17 @@ void Player::SetHomebind(WorldLocation const& loc, uint32 areaId)
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
|
||||
void Player::SendBindPointUpdate()
|
||||
{
|
||||
WorldPackets::Misc::BindPointUpdate packet;
|
||||
packet.BindPosition.x = m_homebindX;
|
||||
packet.BindPosition.y = m_homebindY;
|
||||
packet.BindPosition.z = m_homebindZ;
|
||||
packet.BindMapID = m_homebindMapId;
|
||||
packet.BindAreaID = m_homebindAreaId;
|
||||
SendDirectMessage(packet.Write());
|
||||
}
|
||||
|
||||
uint32 Player::GetUInt32ValueFromArray(Tokenizer const& data, uint16 index)
|
||||
{
|
||||
if (index >= data.size())
|
||||
@@ -22972,65 +22982,71 @@ void Player::SendInitialPacketsBeforeAddToMap()
|
||||
|
||||
// guild bank list wtf?
|
||||
|
||||
/// SMSG_SPELL_CATEGORY_COOLDOWN
|
||||
GetSession()->SendSpellCategoryCooldowns();
|
||||
|
||||
// Homebind
|
||||
WorldPacket data(SMSG_BINDPOINTUPDATE, 5*4);
|
||||
data << m_homebindX << m_homebindY << m_homebindZ;
|
||||
data << (uint32) m_homebindMapId;
|
||||
data << (uint32) m_homebindAreaId;
|
||||
GetSession()->SendPacket(&data);
|
||||
/// SMSG_BINDPOINTUPDATE
|
||||
SendBindPointUpdate();
|
||||
|
||||
// SMSG_SET_PROFICIENCY
|
||||
// SMSG_SET_PCT_SPELL_MODIFIER
|
||||
// SMSG_SET_FLAT_SPELL_MODIFIER
|
||||
// SMSG_UPDATE_AURA_DURATION
|
||||
|
||||
/// SMSG_TALENTS_INFO
|
||||
SendTalentsInfoData();
|
||||
|
||||
data.Initialize(SMSG_WORLD_SERVER_INFO, 1 + 1 + 4 + 4);
|
||||
data.WriteBit(0); // HasRestrictedLevel
|
||||
data.WriteBit(0); // HasRestrictedMoney
|
||||
data.WriteBit(0); // IneligibleForLoot
|
||||
data.FlushBits();
|
||||
//if (IneligibleForLoot)
|
||||
// data << uint32(0); // EncounterMask
|
||||
|
||||
data << uint8(0); // IsOnTournamentRealm
|
||||
//if (HasRestrictedMoney)
|
||||
// data << uint32(100000); // RestrictedMoney (starter accounts)
|
||||
//if (HasRestrictedLevel)
|
||||
// data << uint32(20); // RestrictedLevel (starter accounts)
|
||||
|
||||
data << uint32(sWorld->GetNextWeeklyQuestsResetTime() - WEEK); // LastWeeklyReset (not instance reset)
|
||||
data << uint32(GetMap()->GetDifficulty());
|
||||
GetSession()->SendPacket(&data);
|
||||
|
||||
/// SMSG_INITIAL_SPELLS
|
||||
SendKnownSpells();
|
||||
|
||||
WorldPackets::Spell::SendUnlearnSpells packet;
|
||||
GetSession()->SendPacket(packet.Write());
|
||||
/// SMSG_SEND_UNLEARN_SPELLS
|
||||
{
|
||||
WorldPackets::Spell::SendUnlearnSpells packet;
|
||||
SendDirectMessage(packet.Write());
|
||||
}
|
||||
|
||||
/// SMSG_ACTION_BUTTONS
|
||||
SendInitialActionButtons();
|
||||
m_reputationMgr->SendInitialReputations();
|
||||
m_achievementMgr->SendAllAchievementData(this);
|
||||
|
||||
/// SMSG_INITIALIZE_FACTIONS
|
||||
m_reputationMgr->SendInitialReputations();
|
||||
/// SMSG_SET_FORCED_REACTIONS
|
||||
m_reputationMgr->SendForceReactions();
|
||||
|
||||
SendCurrencies();
|
||||
SendEquipmentSetList();
|
||||
|
||||
data.Initialize(SMSG_LOGIN_SETTIMESPEED, 4 + 4 + 4);
|
||||
data.AppendPackedTime(sWorld->GetGameTime());
|
||||
data << float(0.01666667f); // game speed
|
||||
data << uint32(0); // added in 3.1.2
|
||||
GetSession()->SendPacket(&data);
|
||||
m_achievementMgr->SendAllAchievementData(this);
|
||||
|
||||
GetReputationMgr().SendForceReactions(); // SMSG_SET_FORCED_REACTIONS
|
||||
/// SMSG_LOGIN_SETTIMESPEED
|
||||
{
|
||||
static float const TimeSpeed = 0.01666667f;
|
||||
WorldPackets::Misc::LoginSetTimeSpeed packet;
|
||||
packet.NewSpeed = TimeSpeed;
|
||||
packet.GameTime = sWorld->GetGameTime();
|
||||
packet.ServerTime = sWorld->GetGameTime();
|
||||
packet.GameTimeHolidayOffset = 0; /// @todo
|
||||
packet.ServerTimeHolidayOffset = 0; /// @todo
|
||||
SendDirectMessage(packet.Write());
|
||||
}
|
||||
|
||||
/// SMSG_WORLD_SERVER_INFO
|
||||
{
|
||||
WorldPackets::Misc::WorldServerInfo packet;
|
||||
packet.IneligibleForLootMask.Clear(); /// @todo
|
||||
packet.WeeklyReset = sWorld->GetNextWeeklyQuestsResetTime() - WEEK;
|
||||
packet.InstanceGroupSize.Clear(); /// @todo
|
||||
packet.IsTournamentRealm = 0; /// @todo
|
||||
packet.RestrictedAccountMaxLevel.Clear(); /// @todo
|
||||
packet.RestrictedAccountMaxMoney.Clear(); /// @todo
|
||||
packet.DifficultyID = GetMap()->GetDifficulty();
|
||||
SendDirectMessage(packet.Write());
|
||||
}
|
||||
|
||||
// SMSG_TALENTS_INFO x 2 for pet (unspent points and talents in separate packets...)
|
||||
// SMSG_PET_GUIDS
|
||||
// SMSG_UPDATE_WORLD_STATE
|
||||
// SMSG_POWER_UPDATE
|
||||
|
||||
SendCurrencies();
|
||||
SetMover(this);
|
||||
}
|
||||
|
||||
@@ -25417,7 +25433,7 @@ void Player::CompletedAchievement(AchievementEntry const* entry)
|
||||
bool Player::LearnTalent(uint32 talentId)
|
||||
{
|
||||
uint8 group = GetActiveTalentGroup();
|
||||
|
||||
|
||||
// check if talent specialization is learnt
|
||||
if (!GetTalentSpec(group))
|
||||
return false;
|
||||
@@ -25498,7 +25514,7 @@ void Player::LearnTalentSpecialization(uint32 talentSpec)
|
||||
if (masterySpell->IsPassive() && IsNeedCastPassiveSpellAtLearn(masterySpell))
|
||||
CastSpell(this, masterySpell->Id, true);
|
||||
}
|
||||
|
||||
|
||||
SendTalentsInfoData();
|
||||
}
|
||||
|
||||
|
||||
@@ -2368,6 +2368,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
void SaveRecallPosition();
|
||||
|
||||
void SetHomebind(WorldLocation const& loc, uint32 areaId);
|
||||
void SendBindPointUpdate();
|
||||
|
||||
// Homebind coordinates
|
||||
uint32 m_homebindMapId;
|
||||
|
||||
@@ -130,7 +130,7 @@ namespace WorldPackets
|
||||
class Chat final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
Chat() : ServerPacket(SMSG_MESSAGECHAT, 1+1+8+8+8+8+8+4+4+4+1+4+20) { }
|
||||
Chat() : ServerPacket(SMSG_MESSAGECHAT, 100) { }
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
@@ -138,7 +138,7 @@ namespace WorldPackets
|
||||
uint8 Language = LANG_UNIVERSAL;
|
||||
ObjectGuid SenderGUID;
|
||||
ObjectGuid SenderGuildGUID;
|
||||
ObjectGuid SenderAccountGUID; // Not in JAM messages but appears in packet?
|
||||
ObjectGuid SenderAccountGUID;
|
||||
ObjectGuid TargetGUID;
|
||||
ObjectGuid PartyGUID;
|
||||
uint32 SenderVirtualAddress;
|
||||
@@ -158,7 +158,7 @@ namespace WorldPackets
|
||||
class Emote final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
Emote() : ServerPacket(SMSG_EMOTE, 8+4) { }
|
||||
Emote() : ServerPacket(SMSG_EMOTE, 18 + 4) { }
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
@@ -181,12 +181,12 @@ namespace WorldPackets
|
||||
class STextEmote final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
STextEmote() : ServerPacket(SMSG_TEXT_EMOTE, 8+8+4+4) { }
|
||||
STextEmote() : ServerPacket(SMSG_TEXT_EMOTE, 3 * 18 + 2 * 4) { }
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
ObjectGuid SourceGUID;
|
||||
ObjectGuid SourceAccountGUID; // Not in JAM
|
||||
ObjectGuid SourceAccountGUID;
|
||||
ObjectGuid TargetGUID;
|
||||
int32 SoundIndex;
|
||||
int32 EmoteID;
|
||||
|
||||
@@ -17,6 +17,35 @@
|
||||
|
||||
#include "MiscPackets.h"
|
||||
|
||||
WorldPacket const* WorldPackets::Misc::BindPointUpdate::Write()
|
||||
{
|
||||
_worldPacket << float(BindPosition.x);
|
||||
_worldPacket << float(BindPosition.y);
|
||||
_worldPacket << float(BindPosition.z);
|
||||
_worldPacket << uint32(BindMapID);
|
||||
_worldPacket << uint32(BindAreaID);
|
||||
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
WorldPacket const* WorldPackets::Misc::InvalidatePlayer::Write()
|
||||
{
|
||||
_worldPacket << Guid;
|
||||
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
WorldPacket const* WorldPackets::Misc::LoginSetTimeSpeed::Write()
|
||||
{
|
||||
_worldPacket.AppendPackedTime(ServerTime);
|
||||
_worldPacket.AppendPackedTime(GameTime);
|
||||
_worldPacket << float(NewSpeed);
|
||||
_worldPacket << uint32(ServerTimeHolidayOffset);
|
||||
_worldPacket << uint32(GameTimeHolidayOffset);
|
||||
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
void WorldPackets::Misc::ViolenceLevel::Read()
|
||||
{
|
||||
_worldPacket >> ViolenceLvl;
|
||||
@@ -44,8 +73,34 @@ WorldPacket const* WorldPackets::Misc::UITime::Write()
|
||||
|
||||
WorldPacket const* WorldPackets::Misc::TutorialFlags::Write()
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i)
|
||||
_worldPacket << TutorialData[i];
|
||||
_worldPacket.append(TutorialData, MAX_ACCOUNT_TUTORIAL_VALUES);
|
||||
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
WorldPacket const* WorldPackets::Misc::WorldServerInfo::Write()
|
||||
{
|
||||
_worldPacket << uint32(DifficultyID);
|
||||
_worldPacket << uint8(IsTournamentRealm);
|
||||
_worldPacket << uint32(WeeklyReset);
|
||||
_worldPacket.WriteBit(IneligibleForLootMask.HasValue);
|
||||
_worldPacket.WriteBit(InstanceGroupSize.HasValue);
|
||||
_worldPacket.WriteBit(RestrictedAccountMaxLevel.HasValue);
|
||||
_worldPacket.WriteBit(RestrictedAccountMaxMoney.HasValue);
|
||||
|
||||
if (IneligibleForLootMask.HasValue)
|
||||
_worldPacket << uint32(IneligibleForLootMask.value);
|
||||
|
||||
if (InstanceGroupSize.HasValue)
|
||||
_worldPacket << uint32(InstanceGroupSize.value);
|
||||
|
||||
if (RestrictedAccountMaxLevel.HasValue)
|
||||
_worldPacket << uint32(RestrictedAccountMaxLevel.value);
|
||||
|
||||
if (RestrictedAccountMaxMoney.HasValue)
|
||||
_worldPacket << uint32(RestrictedAccountMaxMoney.value);
|
||||
|
||||
_worldPacket.FlushBits();
|
||||
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
@@ -19,11 +19,49 @@
|
||||
#define MiscPackets_h__
|
||||
|
||||
#include "Packet.h"
|
||||
#include "ObjectGuid.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
namespace WorldPackets
|
||||
{
|
||||
namespace Misc
|
||||
{
|
||||
class BindPointUpdate final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
BindPointUpdate() : ServerPacket(SMSG_BINDPOINTUPDATE, 20) { }
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
uint32 BindMapID = MAPID_INVALID;
|
||||
G3D::Vector3 BindPosition;
|
||||
uint32 BindAreaID = 0;
|
||||
};
|
||||
|
||||
class InvalidatePlayer final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
InvalidatePlayer() : ServerPacket(SMSG_INVALIDATE_PLAYER, 18) { }
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
ObjectGuid Guid;
|
||||
};
|
||||
|
||||
class LoginSetTimeSpeed final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
LoginSetTimeSpeed() : ServerPacket(SMSG_LOGIN_SETTIMESPEED, 20) { }
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
float NewSpeed = 0.0f;
|
||||
int32 ServerTimeHolidayOffset = 0;
|
||||
uint32 GameTime = 0;
|
||||
uint32 ServerTime = 0;
|
||||
int32 GameTimeHolidayOffset = 0;
|
||||
};
|
||||
|
||||
class ViolenceLevel final : public ClientPacket
|
||||
{
|
||||
public:
|
||||
@@ -54,7 +92,7 @@ namespace WorldPackets
|
||||
uint32 ClientTime = 0; // Client ticks in ms
|
||||
uint32 SequenceIndex = 0; // Same index as in request
|
||||
};
|
||||
|
||||
|
||||
class UITime final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
@@ -64,15 +102,34 @@ namespace WorldPackets
|
||||
|
||||
uint32 Time = 0;
|
||||
};
|
||||
|
||||
|
||||
class TutorialFlags : public ServerPacket
|
||||
{
|
||||
public:
|
||||
TutorialFlags() : ServerPacket(SMSG_TUTORIAL_FLAGS, 32) { }
|
||||
TutorialFlags() : ServerPacket(SMSG_TUTORIAL_FLAGS, 32)
|
||||
{
|
||||
std::memset(TutorialData, 0, sizeof(TutorialData));
|
||||
}
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
uint32 TutorialData[8];
|
||||
uint32 TutorialData[MAX_ACCOUNT_TUTORIAL_VALUES];
|
||||
};
|
||||
|
||||
class WorldServerInfo final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
WorldServerInfo() : ServerPacket(SMSG_WORLD_SERVER_INFO, 26) { }
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
Optional<uint32> IneligibleForLootMask; ///< Encountermask?
|
||||
uint32 WeeklyReset = 0; ///< UnixTime of last Weekly Reset Time
|
||||
Optional<uint32> InstanceGroupSize;
|
||||
uint8 IsTournamentRealm = 0;
|
||||
Optional<uint32> RestrictedAccountMaxLevel;
|
||||
Optional<uint32> RestrictedAccountMaxMoney;
|
||||
uint32 DifficultyID = 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace WorldPackets
|
||||
class InitializeFactions final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
InitializeFactions() : ServerPacket(SMSG_INITIALIZE_FACTIONS)
|
||||
InitializeFactions() : ServerPacket(SMSG_INITIALIZE_FACTIONS, 1312)
|
||||
{
|
||||
for (uint16 i = 0; i < FactionCount; ++i)
|
||||
{
|
||||
|
||||
@@ -58,7 +58,10 @@ namespace WorldPackets
|
||||
class UpdateActionButtons final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
UpdateActionButtons() : ServerPacket(SMSG_ACTION_BUTTONS, MAX_ACTION_BUTTONS*8+1) { }
|
||||
UpdateActionButtons() : ServerPacket(SMSG_ACTION_BUTTONS, MAX_ACTION_BUTTONS * 8 + 1)
|
||||
{
|
||||
std::memset(ActionButtons, 0, sizeof(ActionButtons));
|
||||
}
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
|
||||
@@ -767,7 +767,7 @@ void OpcodeTable::Initialize()
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_BATTLE_PET_JOURNAL_LOCK_ACQUIRED, STATUS_UNHANDLED);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_BATTLE_PET_NAME_QUERY_RESPONSE, STATUS_UNHANDLED);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_BINDER_CONFIRM, STATUS_UNHANDLED);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_BINDPOINTUPDATE, STATUS_UNHANDLED);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_BINDPOINTUPDATE, STATUS_NEVER);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_BINDZONEREPLY, STATUS_UNHANDLED);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_BREAK_TARGET, STATUS_UNHANDLED);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_BUY_BANK_SLOT_RESULT, STATUS_UNHANDLED);
|
||||
@@ -1010,7 +1010,7 @@ void OpcodeTable::Initialize()
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_INSTANCE_RESET_FAILED, STATUS_UNHANDLED);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_INSTANCE_SAVE_CREATED, STATUS_UNHANDLED);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_INVALIDATE_DANCE, STATUS_UNHANDLED);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_INVALIDATE_PLAYER, STATUS_UNHANDLED);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_INVALIDATE_PLAYER, STATUS_NEVER);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_INVALID_PROMOTION_CODE, STATUS_UNHANDLED);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_INVENTORY_CHANGE_FAILURE, STATUS_UNHANDLED);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_ITEM_ADD_PASSIVE, STATUS_UNHANDLED);
|
||||
@@ -1052,7 +1052,7 @@ void OpcodeTable::Initialize()
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LF_GUILD_RECRUIT_LIST_UPDATED, STATUS_UNHANDLED);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LIST_INVENTORY, STATUS_UNHANDLED);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LOAD_CUF_PROFILES, STATUS_UNHANDLED);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LOGIN_SETTIMESPEED, STATUS_UNHANDLED);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LOGIN_SETTIMESPEED, STATUS_NEVER);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LOGIN_VERIFY_WORLD, STATUS_NEVER);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LOGOUT_CANCEL_ACK, STATUS_NEVER);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LOGOUT_COMPLETE, STATUS_NEVER);
|
||||
@@ -1416,7 +1416,7 @@ void OpcodeTable::Initialize()
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_WEEKLY_SPELL_USAGE_UPDATE, STATUS_UNHANDLED);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_WHO, STATUS_UNHANDLED);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_WHOIS, STATUS_UNHANDLED);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_WORLD_SERVER_INFO, STATUS_UNHANDLED);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_WORLD_SERVER_INFO, STATUS_NEVER);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_NEVER);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_XP_GAIN_ABORTED, STATUS_UNHANDLED);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_ZONE_UNDER_ATTACK, STATUS_UNHANDLED);
|
||||
|
||||
@@ -695,7 +695,7 @@ void WorldSession::LoadAccountData(PreparedQueryResult result, uint32 mask)
|
||||
{
|
||||
for (uint32 i = 0; i < NUM_ACCOUNT_DATA_TYPES; ++i)
|
||||
if (mask & (1 << i))
|
||||
m_accountData[i] = AccountData();
|
||||
_accountData[i] = AccountData();
|
||||
|
||||
if (!result)
|
||||
return;
|
||||
@@ -718,20 +718,20 @@ void WorldSession::LoadAccountData(PreparedQueryResult result, uint32 mask)
|
||||
continue;
|
||||
}
|
||||
|
||||
m_accountData[type].Time = time_t(fields[1].GetUInt32());
|
||||
m_accountData[type].Data = fields[2].GetString();
|
||||
_accountData[type].Time = time_t(fields[1].GetUInt32());
|
||||
_accountData[type].Data = fields[2].GetString();
|
||||
}
|
||||
while (result->NextRow());
|
||||
}
|
||||
|
||||
void WorldSession::SetAccountData(AccountDataType type, time_t tm, std::string const& data)
|
||||
void WorldSession::SetAccountData(AccountDataType type, uint32 time, std::string const& data)
|
||||
{
|
||||
if ((1 << type) & GLOBAL_CACHE_MASK)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_ACCOUNT_DATA);
|
||||
stmt->setUInt32(0, GetAccountId());
|
||||
stmt->setUInt8(1, type);
|
||||
stmt->setUInt32(2, uint32(tm));
|
||||
stmt->setUInt32(2, time);
|
||||
stmt->setString(3, data);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
@@ -744,24 +744,24 @@ void WorldSession::SetAccountData(AccountDataType type, time_t tm, std::string c
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_PLAYER_ACCOUNT_DATA);
|
||||
stmt->setUInt64(0, m_GUIDLow);
|
||||
stmt->setUInt8(1, type);
|
||||
stmt->setUInt32(2, uint32(tm));
|
||||
stmt->setUInt32(2, time);
|
||||
stmt->setString(3, data);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
|
||||
m_accountData[type].Time = tm;
|
||||
m_accountData[type].Data = data;
|
||||
_accountData[type].Time = time_t(time);
|
||||
_accountData[type].Data = data;
|
||||
}
|
||||
|
||||
void WorldSession::LoadTutorialsData()
|
||||
{
|
||||
memset(m_Tutorials, 0, sizeof(uint32) * MAX_ACCOUNT_TUTORIAL_VALUES);
|
||||
memset(_tutorials, 0, sizeof(uint32) * MAX_ACCOUNT_TUTORIAL_VALUES);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_TUTORIALS);
|
||||
stmt->setUInt32(0, GetAccountId());
|
||||
if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
|
||||
for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i)
|
||||
m_Tutorials[i] = (*result)[i].GetUInt32();
|
||||
_tutorials[i] = (*result)[i].GetUInt32();
|
||||
|
||||
m_TutorialsChanged = false;
|
||||
}
|
||||
@@ -769,11 +769,11 @@ void WorldSession::LoadTutorialsData()
|
||||
void WorldSession::SendTutorialsData()
|
||||
{
|
||||
WorldPackets::Misc::TutorialFlags packet;
|
||||
memcpy(packet.TutorialData, m_Tutorials, sizeof(packet.TutorialData));
|
||||
memcpy(packet.TutorialData, _tutorials, sizeof(_tutorials));
|
||||
SendPacket(packet.Write());
|
||||
}
|
||||
|
||||
void WorldSession::SaveTutorialsData(SQLTransaction &trans)
|
||||
void WorldSession::SaveTutorialsData(SQLTransaction& trans)
|
||||
{
|
||||
if (!m_TutorialsChanged)
|
||||
return;
|
||||
@@ -784,7 +784,7 @@ void WorldSession::SaveTutorialsData(SQLTransaction &trans)
|
||||
// Modify data in DB
|
||||
stmt = CharacterDatabase.GetPreparedStatement(hasTutorials ? CHAR_UPD_TUTORIALS : CHAR_INS_TUTORIALS);
|
||||
for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i)
|
||||
stmt->setUInt32(i, m_Tutorials[i]);
|
||||
stmt->setUInt32(i, _tutorials[i]);
|
||||
stmt->setUInt32(MAX_ACCOUNT_TUTORIAL_VALUES, GetAccountId());
|
||||
trans->Append(stmt);
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ namespace WorldPackets
|
||||
{
|
||||
class QueryGuildInfo;
|
||||
}
|
||||
|
||||
|
||||
namespace Talent
|
||||
{
|
||||
class SetSpecialization;
|
||||
@@ -180,6 +180,20 @@ enum AccountDataType
|
||||
|
||||
#define REGISTERED_ADDON_PREFIX_SOFTCAP 64
|
||||
|
||||
enum Tutorials
|
||||
{
|
||||
TUTORIAL_TALENT = 0,
|
||||
TUTORIAL_SPEC = 1,
|
||||
TUTORIAL_GLYPH = 2,
|
||||
TUTORIAL_SPELLBOOK = 3,
|
||||
TUTORIAL_PROFESSIONS = 4,
|
||||
TUTORIAL_CORE_ABILITITES = 5,
|
||||
TUTORIAL_PET_JOURNAL = 6,
|
||||
TUTORIAL_WHAT_HAS_CHANGED = 7
|
||||
};
|
||||
|
||||
#define MAX_ACCOUNT_TUTORIAL_VALUES 8
|
||||
|
||||
struct AccountData
|
||||
{
|
||||
time_t Time = 0;
|
||||
@@ -398,8 +412,8 @@ class WorldSession
|
||||
bool CheckStableMaster(ObjectGuid guid);
|
||||
|
||||
// Account Data
|
||||
AccountData const* GetAccountData(AccountDataType type) const { return &m_accountData[type]; }
|
||||
void SetAccountData(AccountDataType type, time_t tm, std::string const& data);
|
||||
AccountData const* GetAccountData(AccountDataType type) const { return &_accountData[type]; }
|
||||
void SetAccountData(AccountDataType type, uint32 time, std::string const& data);
|
||||
void LoadGlobalAccountData();
|
||||
void LoadAccountData(PreparedQueryResult result, uint32 mask);
|
||||
|
||||
@@ -1194,8 +1208,8 @@ class WorldSession
|
||||
LocaleConstant m_sessionDbLocaleIndex;
|
||||
std::atomic<uint32> m_latency;
|
||||
std::atomic<uint32> m_clientTimeDelay;
|
||||
AccountData m_accountData[NUM_ACCOUNT_DATA_TYPES];
|
||||
uint32 m_Tutorials[MAX_ACCOUNT_TUTORIAL_VALUES];
|
||||
AccountData _accountData[NUM_ACCOUNT_DATA_TYPES];
|
||||
uint32 _tutorials[MAX_ACCOUNT_TUTORIAL_VALUES];
|
||||
bool m_TutorialsChanged;
|
||||
AddonsList m_addonsList;
|
||||
std::vector<std::string> _registeredAddonPrefixes;
|
||||
|
||||
@@ -5668,21 +5668,13 @@ void Spell::EffectBind(SpellEffIndex effIndex)
|
||||
homeLoc = player->GetWorldLocation();
|
||||
|
||||
player->SetHomebind(homeLoc, areaId);
|
||||
|
||||
// binding
|
||||
WorldPacket data(SMSG_BINDPOINTUPDATE, 4 + 4 + 4 + 4 + 4);
|
||||
data << float(homeLoc.GetPositionX());
|
||||
data << float(homeLoc.GetPositionY());
|
||||
data << float(homeLoc.GetPositionZ());
|
||||
data << uint32(homeLoc.GetMapId());
|
||||
data << uint32(areaId);
|
||||
player->SendDirectMessage(&data);
|
||||
player->SendBindPointUpdate();
|
||||
|
||||
TC_LOG_DEBUG("spells", "EffectBind: New homebind X: %f, Y: %f, Z: %f, MapId: %u, AreaId: %u",
|
||||
homeLoc.GetPositionX(), homeLoc.GetPositionY(), homeLoc.GetPositionZ(), homeLoc.GetMapId(), areaId);
|
||||
|
||||
// zone update
|
||||
data.Initialize(SMSG_PLAYERBOUND, 8 + 4);
|
||||
WorldPacket data(SMSG_PLAYERBOUND, 8 + 4);
|
||||
data << m_caster->GetGUID();
|
||||
data << uint32(areaId);
|
||||
player->SendDirectMessage(&data);
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include "LFGMgr.h"
|
||||
#include "MapManager.h"
|
||||
#include "Memory.h"
|
||||
#include "MiscPackets.h"
|
||||
#include "MMapFactory.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "OutdoorPvPMgr.h"
|
||||
@@ -3307,9 +3308,9 @@ void World::UpdateCharacterInfo(ObjectGuid const& guid, std::string const& name,
|
||||
if (race != RACE_NONE)
|
||||
itr->second.Race = race;
|
||||
|
||||
WorldPacket data(SMSG_INVALIDATE_PLAYER, 8);
|
||||
data << guid;
|
||||
SendGlobalMessage(&data);
|
||||
WorldPackets::Misc::InvalidatePlayer data;
|
||||
data.Guid = guid;
|
||||
SendGlobalMessage(data.Write());
|
||||
}
|
||||
|
||||
void World::UpdateCharacterInfoLevel(ObjectGuid const& guid, uint8 level)
|
||||
|
||||
@@ -118,7 +118,6 @@ const uint8 TOTAL_LOCALES = 9;
|
||||
#define DEFAULT_LOCALE LOCALE_enUS
|
||||
|
||||
#define MAX_LOCALES 8
|
||||
#define MAX_ACCOUNT_TUTORIAL_VALUES 8
|
||||
|
||||
extern char const* localeNames[TOTAL_LOCALES];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user