Merge branch 'master' of github.com:TrinityCore/TrinityCore

This commit is contained in:
Shocker
2011-04-08 23:20:10 +03:00
8 changed files with 46 additions and 57 deletions
+9 -9
View File
@@ -828,19 +828,19 @@ void ArenaTeam::SaveToDB()
for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr)
{
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_ARENA_TEAM_MEMBER);
stmt->setUInt16(0, itr->WeekGames);
stmt->setUInt16(1, itr->WeekWins);
stmt->setUInt16(2, itr->SeasonGames);
stmt->setUInt16(3, itr->SeasonWins);
stmt->setUInt32(4, GetId());
stmt->setUInt16(5, GUID_LOPART(itr->Guid));
stmt->setUInt16(0, itr->PersonalRating);
stmt->setUInt16(1, itr->WeekGames);
stmt->setUInt16(2, itr->WeekWins);
stmt->setUInt16(3, itr->SeasonGames);
stmt->setUInt16(4, itr->SeasonWins);
stmt->setUInt32(5, GetId());
stmt->setUInt16(6, GUID_LOPART(itr->Guid));
trans->Append(stmt);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_ARENA_TEAM_MEMBER_STATS);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_CHARACTER_ARENA_STATS);
stmt->setUInt32(0, GUID_LOPART(itr->Guid));
stmt->setUInt8(1, GetSlot());
stmt->setUInt16(2, itr->PersonalRating);
stmt->setUInt16(3, itr->MatchMakerRating);
stmt->setUInt16(2, itr->MatchMakerRating);
trans->Append(stmt);
}
+19 -32
View File
@@ -16230,36 +16230,6 @@ void Player::_LoadArenaTeamInfo(PreparedQueryResult result)
// arenateamid, played_week, played_season, personal_rating
memset((void*)&m_uint32Values[PLAYER_FIELD_ARENA_TEAM_INFO_1_1], 0, sizeof(uint32) * MAX_ARENA_SLOT * ARENA_TEAM_END);
if (!result)
return;
do
{
Field* fields = result->Fetch();
uint32 arenaTeamId = fields[0].GetUInt32();
ArenaTeam* arenaTeam = sObjectMgr->GetArenaTeamById(arenaTeamId);
if (!arenaTeam)
{
sLog->outError("Player::_LoadArenaTeamInfo: couldn't load arenateam %u", arenaTeamId);
continue;
}
uint8 arenaSlot = arenaTeam->GetSlot();
SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_ID, arenaTeamId);
SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_TYPE, arenaTeam->GetType());
SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_MEMBER, (arenaTeam->GetCaptain() == GetGUID()) ? 0 : 1);
SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_GAMES_WEEK, uint32(fields[1].GetUInt16()));
SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_GAMES_SEASON, uint32(fields[2].GetUInt16()));
SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_WINS_SEASON, uint32(fields[3].GetUInt16()));
}
while (result->NextRow());
}
void Player::_LoadArenaStatsInfo(PreparedQueryResult result)
{
uint16 personalRatingCache[] = {0, 0, 0};
if (result)
@@ -16268,7 +16238,25 @@ void Player::_LoadArenaStatsInfo(PreparedQueryResult result)
{
Field* fields = result->Fetch();
personalRatingCache[fields[0].GetUInt8()] = fields[1].GetUInt16();
uint32 arenaTeamId = fields[0].GetUInt32();
ArenaTeam* arenaTeam = sObjectMgr->GetArenaTeamById(arenaTeamId);
if (!arenaTeam)
{
sLog->outError("Player::_LoadArenaTeamInfo: couldn't load arenateam %u", arenaTeamId);
continue;
}
uint8 arenaSlot = arenaTeam->GetSlot();
personalRatingCache[arenaSlot] = fields[1].GetUInt16();
SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_ID, arenaTeamId);
SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_TYPE, arenaTeam->GetType());
SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_MEMBER, (arenaTeam->GetCaptain() == GetGUID()) ? 0 : 1);
SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_GAMES_WEEK, uint32(fields[1].GetUInt16()));
SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_GAMES_SEASON, uint32(fields[2].GetUInt16()));
SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_WINS_SEASON, uint32(fields[3].GetUInt16()));
}
while (result->NextRow());
}
@@ -16531,7 +16519,6 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
_LoadGroup(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADGROUP));
_LoadArenaTeamInfo(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADARENAINFO));
_LoadArenaStatsInfo(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADARENASTATS));
SetArenaPoints(fields[39].GetUInt32());
+3 -5
View File
@@ -797,10 +797,9 @@ enum PlayerLoginQueryIndex
PLAYER_LOGIN_QUERY_LOADSKILLS = 25,
PLAYER_LOGIN_QUERY_LOADWEKLYQUESTSTATUS = 26,
PLAYER_LOGIN_QUERY_LOADRANDOMBG = 27,
PLAYER_LOGIN_QUERY_LOADARENASTATS = 28,
PLAYER_LOGIN_QUERY_LOADBANNED = 29,
PLAYER_LOGIN_QUERY_LOADQUESTSTATUSREW = 30,
PLAYER_LOGIN_QUERY_LOADINSTANCELOCKTIMES = 31,
PLAYER_LOGIN_QUERY_LOADBANNED = 28,
PLAYER_LOGIN_QUERY_LOADQUESTSTATUSREW = 29,
PLAYER_LOGIN_QUERY_LOADINSTANCELOCKTIMES = 30,
MAX_PLAYER_LOGIN_QUERY,
};
@@ -2494,7 +2493,6 @@ class Player : public Unit, public GridObject<Player>
bool _LoadHomeBind(PreparedQueryResult result);
void _LoadDeclinedNames(PreparedQueryResult result);
void _LoadArenaTeamInfo(PreparedQueryResult result);
void _LoadArenaStatsInfo(PreparedQueryResult result);
void _LoadEquipmentSets(PreparedQueryResult result);
void _LoadBGData(PreparedQueryResult result);
void _LoadGlyphs(PreparedQueryResult result);
@@ -178,10 +178,6 @@ bool LoginQueryHolder::Initialize()
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADRANDOMBG, stmt);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_ARENASTATS);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADARENASTATS, stmt);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_BANNED);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADBANNED, stmt);