public static void LeaveAllArenaTeams(ObjectGuid guid) { PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_PLAYER_ARENA_TEAMS); stmt.AddValue(0, guid.GetCounter()); SQLResult result = DB.Characters.Query(stmt); if (result.IsEmpty()) { return; } do { uint arenaTeamId = result.Read <uint>(0); if (arenaTeamId != 0) { ArenaTeam arenaTeam = Global.ArenaTeamMgr.GetArenaTeamById(arenaTeamId); if (arenaTeam != null) { arenaTeam.DelMember(guid, true); } } }while (result.NextRow()); }
public static void LeaveAllArenaTeams(ObjectGuid guid) { CharacterCacheEntry characterInfo = Global.CharacterCacheStorage.GetCharacterCacheByGuid(guid); if (characterInfo == null) { return; } for (byte i = 0; i < SharedConst.MaxArenaSlot; ++i) { uint arenaTeamId = characterInfo.ArenaTeamId[i]; if (arenaTeamId != 0) { ArenaTeam arenaTeam = Global.ArenaTeamMgr.GetArenaTeamById(arenaTeamId); if (arenaTeam != null) { arenaTeam.DelMember(guid, true); } } } }