Core/Packets: updated SMSG_BINDPOINTUPDATE, SMSG_INVALIDATE_PLAYER, SMSG_LOGIN_SETTIMESPEED, SMSG_WORLD_SERVER_INFO

This commit is contained in:
joschiwald
2014-11-19 02:12:47 +01:00
parent dbb102e647
commit b7baee390c
13 changed files with 226 additions and 88 deletions
+13 -13
View File
@@ -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);