mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
Updated to new client build
This commit is contained in:
parent
2197da6407
commit
e6a66cdc54
18 changed files with 360 additions and 188 deletions
|
|
@ -566,6 +566,58 @@ void WorldSession::SetAccountData(uint32 type, time_t time_, std::string data)
|
|||
CharacterDatabase.CommitTransaction ();
|
||||
}
|
||||
|
||||
void WorldSession::LoadTutorialsData()
|
||||
{
|
||||
for ( int aX = 0 ; aX < 8 ; ++aX )
|
||||
m_Tutorials[ aX ] = 0;
|
||||
|
||||
QueryResult *result = CharacterDatabase.PQuery("SELECT tut0,tut1,tut2,tut3,tut4,tut5,tut6,tut7 FROM character_tutorial WHERE account = '%u'", GetAccountId());
|
||||
|
||||
if(result)
|
||||
{
|
||||
do
|
||||
{
|
||||
Field *fields = result->Fetch();
|
||||
|
||||
for (int iI = 0; iI < 8; iI++)
|
||||
m_Tutorials[iI] = fields[iI].GetUInt32();
|
||||
}
|
||||
while( result->NextRow() );
|
||||
|
||||
delete result;
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSession::SendTutorialsData()
|
||||
{
|
||||
WorldPacket data(SMSG_TUTORIAL_FLAGS, 4*8);
|
||||
for(uint32 i = 0; i < 8; ++i)
|
||||
data << m_Tutorials[i];
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
void WorldSession::SaveTutorialsData()
|
||||
{
|
||||
uint32 Rows=0;
|
||||
// it's better than rebuilding indexes multiple times
|
||||
QueryResult *result = CharacterDatabase.PQuery("SELECT count(*) AS r FROM character_tutorial WHERE account = '%u'", GetAccountId());
|
||||
if(result)
|
||||
{
|
||||
Rows = result->Fetch()[0].GetUInt32();
|
||||
delete result;
|
||||
}
|
||||
|
||||
if (Rows)
|
||||
{
|
||||
CharacterDatabase.PExecute("UPDATE character_tutorial SET tut0='%u', tut1='%u', tut2='%u', tut3='%u', tut4='%u', tut5='%u', tut6='%u', tut7='%u' WHERE account = '%u'",
|
||||
m_Tutorials[0], m_Tutorials[1], m_Tutorials[2], m_Tutorials[3], m_Tutorials[4], m_Tutorials[5], m_Tutorials[6], m_Tutorials[7], GetAccountId());
|
||||
}
|
||||
else
|
||||
{
|
||||
CharacterDatabase.PExecute("INSERT INTO character_tutorial (account,tut0,tut1,tut2,tut3,tut4,tut5,tut6,tut7) VALUES ('%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u')", GetAccountId(), m_Tutorials[0], m_Tutorials[1], m_Tutorials[2], m_Tutorials[3], m_Tutorials[4], m_Tutorials[5], m_Tutorials[6], m_Tutorials[7]);
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo *mi)
|
||||
{
|
||||
CHECK_PACKET_SIZE(data, data.rpos()+4+2+4+4+4+4+4);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue