SQL: Characters db storage type cleanup No. 2
This commit is contained in:
@@ -3144,12 +3144,12 @@ bool ChatHandler::HandleBanInfoCharacterCommand(const char *args)
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
time_t unbandate = time_t(fields[3].GetUInt64());
|
||||
time_t unbandate = time_t(fields[3].GetUInt32());
|
||||
bool active = false;
|
||||
if (fields[2].GetUInt8() && (!fields[1].GetUInt64() || unbandate >= time(NULL)))
|
||||
if (fields[2].GetUInt8() && (!fields[1].GetUInt32() || unbandate >= time(NULL)))
|
||||
active = true;
|
||||
bool permanent = (fields[1].GetUInt64() == uint64(0));
|
||||
std::string bantime = permanent ? GetTrinityString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetUInt64(), true);
|
||||
bool permanent = (fields[1].GetUInt32() == uint32(0));
|
||||
std::string bantime = permanent ? GetTrinityString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetUInt32(), true);
|
||||
PSendSysMessage(LANG_BANINFO_HISTORYENTRY,
|
||||
fields[0].GetCString(), bantime.c_str(), active ? GetTrinityString(LANG_BANINFO_YES) : GetTrinityString(LANG_BANINFO_NO), fields[4].GetCString(), fields[5].GetCString());
|
||||
}
|
||||
@@ -3273,10 +3273,10 @@ bool ChatHandler::HandleBanListCharacterCommand(const char *args)
|
||||
Field* banFields = banInfo->Fetch();
|
||||
do
|
||||
{
|
||||
time_t t_ban = banFields[0].GetUInt64();
|
||||
time_t t_ban = time_t(banFields[0].GetUInt32());
|
||||
tm* aTm_ban = localtime(&t_ban);
|
||||
|
||||
if (banFields[0].GetUInt64() == banFields[1].GetUInt64())
|
||||
if (banFields[0].GetUInt32() == banFields[1].GetUInt32())
|
||||
{
|
||||
PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d| permanent |%-15.15s|%-15.15s|",
|
||||
char_name.c_str(), aTm_ban->tm_year%100, aTm_ban->tm_mon+1, aTm_ban->tm_mday, aTm_ban->tm_hour, aTm_ban->tm_min,
|
||||
@@ -3284,7 +3284,7 @@ bool ChatHandler::HandleBanListCharacterCommand(const char *args)
|
||||
}
|
||||
else
|
||||
{
|
||||
time_t t_unban = banFields[1].GetUInt64();
|
||||
time_t t_unban = time_t(banFields[1].GetUInt32());
|
||||
tm* aTm_unban = localtime(&t_unban);
|
||||
PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d|%02d-%02d-%02d %02d:%02d|%-15.15s|%-15.15s|",
|
||||
char_name.c_str(), aTm_ban->tm_year%100, aTm_ban->tm_mon+1, aTm_ban->tm_mday, aTm_ban->tm_hour, aTm_ban->tm_min,
|
||||
|
||||
@@ -16070,10 +16070,12 @@ void Player::_LoadBGData(PreparedQueryResult result)
|
||||
|
||||
Field* fields = result->Fetch();
|
||||
// Expecting only one row
|
||||
/* bgInstanceID, bgTeam, x, y, z, o, map, taxi[0], taxi[1], mountSpell */
|
||||
// 0 1 2 3 4 5 6 7 8 9
|
||||
// SELECT instance_id, team, join_x, join_y, join_z, join_o, join_map, taxi_start, taxi_end, mount_spell FROM character_battleground_data WHERE guid = ?
|
||||
|
||||
m_bgData.bgInstanceID = fields[0].GetUInt32();
|
||||
m_bgData.bgTeam = fields[1].GetUInt32();
|
||||
m_bgData.joinPos = WorldLocation(fields[6].GetUInt32(), // Map
|
||||
m_bgData.bgTeam = fields[1].GetUInt16();
|
||||
m_bgData.joinPos = WorldLocation(fields[6].GetUInt16(), // Map
|
||||
fields[2].GetFloat(), // X
|
||||
fields[3].GetFloat(), // Y
|
||||
fields[4].GetFloat(), // Z
|
||||
@@ -16845,7 +16847,11 @@ void Player::_LoadAuras(PreparedQueryResult result, uint32 timediff)
|
||||
{
|
||||
sLog->outDebug("Loading auras for player %u",GetGUIDLow());
|
||||
|
||||
//QueryResult *result = CharacterDatabase.PQuery("SELECT caster_guid,spell,effect_mask,recalculate_mask,stackcount,amount0,amount1,amount2,base_amount0,base_amount1,base_amount2,maxduration,remaintime,remaincharges FROM character_aura WHERE guid = '%u'",GetGUIDLow());
|
||||
/* 0 1 2 3 4 5 6 7 8 9 10
|
||||
QueryResult *result = CharacterDatabase.PQuery("SELECT caster_guid,spell,effect_mask,recalculate_mask,stackcount,amount0,amount1,amount2,base_amount0,base_amount1,base_amount2,
|
||||
11 12 13
|
||||
maxduration,remaintime,remaincharges FROM character_aura WHERE guid = '%u'",GetGUIDLow());
|
||||
*/
|
||||
|
||||
if (result)
|
||||
{
|
||||
@@ -23963,12 +23969,12 @@ void Player::_LoadGlyphs(PreparedQueryResult result)
|
||||
if (spec >= m_specsCount)
|
||||
continue;
|
||||
|
||||
m_Glyphs[spec][0] = fields[1].GetUInt32();
|
||||
m_Glyphs[spec][1] = fields[2].GetUInt32();
|
||||
m_Glyphs[spec][2] = fields[3].GetUInt32();
|
||||
m_Glyphs[spec][3] = fields[4].GetUInt32();
|
||||
m_Glyphs[spec][4] = fields[5].GetUInt32();
|
||||
m_Glyphs[spec][5] = fields[6].GetUInt32();
|
||||
m_Glyphs[spec][0] = fields[1].GetUInt16();
|
||||
m_Glyphs[spec][1] = fields[2].GetUInt16();
|
||||
m_Glyphs[spec][2] = fields[3].GetUInt16();
|
||||
m_Glyphs[spec][3] = fields[4].GetUInt16();
|
||||
m_Glyphs[spec][4] = fields[5].GetUInt16();
|
||||
m_Glyphs[spec][5] = fields[6].GetUInt16();
|
||||
}
|
||||
while (result->NextRow());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user