100 CharacterDatabase.
Execute(
"DELETE FROM arena_team_member WHERE arenaTeamId NOT IN (SELECT arenaTeamId FROM arena_team)");
103 QueryResult result =
CharacterDatabase.
Query(
"SELECT arenaTeamId, name, captainGuid, type, backgroundColor, emblemStyle, emblemColor, borderStyle, borderColor, "
105 "rating, weekGames, weekWins, seasonGames, seasonWins, rank FROM arena_team ORDER BY arenaTeamId ASC");
109 TC_LOG_INFO(
"server.loading",
">> Loaded 0 arena teams. DB table `arena_team` is empty!");
115 "SELECT arenaTeamId, atm.guid, atm.weekGames, atm.weekWins, atm.seasonGames, atm.seasonWins, c.name, class, personalRating, matchMakerRating FROM arena_team_member atm"
116 " INNER JOIN arena_team ate USING (arenaTeamId)"
117 " LEFT JOIN characters AS c ON atm.guid = c.guid"
118 " LEFT JOIN character_arena_stats AS cas ON c.guid = cas.guid AND (cas.slot = 0 AND ate.type = 2 OR cas.slot = 1 AND ate.type = 3 OR cas.slot = 2 AND ate.type = 5)"
119 " ORDER BY atm.arenateamid ASC");
137 while (result->NextRow());
void Execute(const char *sql)
Definition: DatabaseWorkerPool.h:87
void Disband(WorldSession *session)
Definition: ArenaTeam.cpp:336
bool LoadMembersFromDB(QueryResult arenaTeamMembersResult)
Definition: ArenaTeam.cpp:206
uint32 getMSTime()
Definition: Timer.h:24
arena_t NULL
Definition: jemalloc_internal.h:624
uint32_t uint32
Definition: Define.h:150
std::shared_ptr< ResultSet > QueryResult
Definition: QueryResult.h:61
void AddArenaTeam(ArenaTeam *arenaTeam)
Definition: ArenaTeamMgr.cpp:75
Definition: ArenaTeam.h:112
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition: Timer.h:42
QueryResult Query(const char *sql, T *connection=nullptr)
Definition: DatabaseWorkerPool.cpp:113
bool LoadArenaTeamFromDB(QueryResult arenaTeamDataResult)
Definition: ArenaTeam.cpp:180
CharacterDatabaseWorkerPool CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
#define TC_LOG_INFO(filterType__,...)
Definition: Log.h:201