CharDB Schema/Cleanup: cleanup character_tutorial table:

* rename table to account_tutorial, because it holds account specific data;
* rename column account to accountId;
* introduce prepared statements for table.
This commit is contained in:
Azazel
2011-02-25 00:45:57 +06:00
parent 20ab3e4bda
commit bcd7e45e12
10 changed files with 102 additions and 88 deletions
@@ -947,33 +947,29 @@ void WorldSession::HandleMeetingStoneInfo(WorldPacket & /*recv_data*/)
void WorldSession::HandleTutorialFlag(WorldPacket & recv_data)
{
uint32 iFlag;
recv_data >> iFlag;
uint32 data;
recv_data >> data;
uint32 wInt = (iFlag / 32);
if (wInt >= 8)
{
//sLog->outError("CHEATER? Account:[%d] Guid[%u] tried to send wrong CMSG_TUTORIAL_FLAG", GetAccountId(),GetGUID());
uint8 index = uint8(data / 32);
if (index >= MAX_ACCOUNT_TUTORIAL_VALUES)
return;
}
uint32 rInt = (iFlag % 32);
uint32 tutflag = GetTutorialInt(wInt);
tutflag |= (1 << rInt);
SetTutorialInt(wInt, tutflag);
uint32 value = (data % 32);
//sLog->outDebug("Received Tutorial Flag Set {%u}.", iFlag);
uint32 flag = GetTutorialInt(index);
flag |= (1 << value);
SetTutorialInt(index, flag);
}
void WorldSession::HandleTutorialClear(WorldPacket & /*recv_data*/)
{
for (int i = 0; i < MAX_CHARACTER_TUTORIAL_VALUES; ++i)
for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i)
SetTutorialInt(i, 0xFFFFFFFF);
}
void WorldSession::HandleTutorialReset(WorldPacket & /*recv_data*/)
{
for (int i = 0; i < MAX_CHARACTER_TUTORIAL_VALUES; ++i)
for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i)
SetTutorialInt(i, 0x00000000);
}