SQL: Characters db storage type cleanup No. 7 (final) - Note:

- It is _strongly_ recommended to extensively test the recent changes before applying them to live data

- To fully resync the character db layout with TC releases it is recommended to dump the characters table with
mysqldump --no-data characters > characters_database_livedata.sql
and use a diff tool to compare it against sql/base/characters_database.sql
This commit is contained in:
leak
2011-01-20 02:11:49 +01:00
parent c59ea4726e
commit f7af49291b
16 changed files with 108 additions and 50 deletions
+2 -2
View File
@@ -1108,7 +1108,7 @@ void Pet::_LoadSpellCooldowns()
Field *fields = result->Fetch();
uint32 spell_id = fields[0].GetUInt32();
time_t db_time = (time_t)fields[1].GetUInt64();
time_t db_time = time_t(fields[1].GetUInt32());
if (!sSpellStore.LookupEntry(spell_id))
{
@@ -1147,7 +1147,7 @@ void Pet::_SaveSpellCooldowns(SQLTransaction& trans)
m_CreatureSpellCooldowns.erase(itr++);
else
{
trans->PAppend("INSERT INTO pet_spell_cooldown (guid,spell,time) VALUES ('%u', '%u', '" UI64FMTD "')", m_charmInfo->GetPetNumber(), itr->first, uint64(itr->second));
trans->PAppend("INSERT INTO pet_spell_cooldown (guid,spell,time) VALUES ('%u', '%u', '%u')", m_charmInfo->GetPetNumber(), itr->first, uint32(itr->second));
++itr;
}
}
+2 -2
View File
@@ -17272,8 +17272,8 @@ void Player::_LoadMail()
m->subject = fields[4].GetString();
m->body = fields[5].GetString();
bool has_items = fields[6].GetBool();
m->expire_time = (time_t)fields[7].GetUInt64();
m->deliver_time = (time_t)fields[8].GetUInt64();
m->expire_time = time_t(fields[7].GetUInt32());
m->deliver_time = time_t(fields[8].GetUInt32());
m->money = fields[9].GetUInt32();
m->COD = fields[10].GetUInt32();
m->checked = fields[11].GetUInt32();
+1 -1
View File
@@ -5701,7 +5701,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
m->sender = fields[2].GetUInt32();
m->receiver = fields[3].GetUInt32();
bool has_items = fields[4].GetBool();
m->expire_time = (time_t)fields[5].GetUInt64();
m->expire_time = time_t(fields[5].GetUInt32());
m->deliver_time = 0;
m->COD = fields[6].GetUInt32();
m->checked = fields[7].GetUInt32();
@@ -260,7 +260,7 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket & recv_data)
return;
}
Field *fields = result->Fetch();
uint32 type = fields[0].GetUInt32();
uint32 type = fields[0].GetUInt8();
// if guild petition and has guild => error, return;
if (type == GUILD_CHARTER_TYPE && _player->GetGuildId())
@@ -394,7 +394,7 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data)
if (result)
{
Field* fields = result->Fetch();
type = fields[0].GetUInt32();
type = fields[0].GetUInt8();
}
else
{
@@ -614,7 +614,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data)
return;
Field *fields = result->Fetch();
type = fields[0].GetUInt32();
type = fields[0].GetUInt8();
sLog->outDebug("OFFER PETITION: type %u, GUID1 %u, to player id: %u", type, GUID_LOPART(petitionguid), GUID_LOPART(plguid));
@@ -716,7 +716,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
Field *fields = result->Fetch();
ownerguidlo = fields[0].GetUInt32();
name = fields[1].GetString();
type = fields[2].GetUInt32();
type = fields[2].GetUInt8();
}
else
{
+1 -1
View File
@@ -2772,7 +2772,7 @@ void World::LoadWorldStates()
do
{
Field *fields = result->Fetch();
m_worldstates[fields[0].GetUInt32()] = fields[1].GetUInt64();
m_worldstates[fields[0].GetUInt32()] = fields[1].GetUInt32();
++count;
}
while (result->NextRow());