Skip to content

Commit

Permalink
Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
ramon-bernardo committed Nov 25, 2024
1 parent 317569a commit 737751d
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/iologindata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,8 @@ bool IOLoginData::loadPlayer(Player* player, DBResult_ptr result)
}

if ((result = tfs::db::store_query(
fmt::format("SELECT `guild_id`, `rank_id`, `nick` FROM `guild_membership` WHERE `player_id` = {:d}",
player->getGUID())))) {
fmt::format("SELECT `guild_id`, `rank_id`, `nick` FROM `guild_membership` WHERE `player_id` = {:d}",
player->getGUID())))) {
uint32_t guildId = result->getNumber<uint32_t>("guild_id");
uint32_t playerRankId = result->getNumber<uint32_t>("rank_id");
player->guildNick = result->getString("nick");
Expand All @@ -313,7 +313,7 @@ bool IOLoginData::loadPlayer(Player* player, DBResult_ptr result)
auto rank = guild->getRankById(playerRankId);
if (!rank) {
if ((result = tfs::db::store_query(fmt::format(
"SELECT `id`, `name`, `level` FROM `guild_ranks` WHERE `id` = {:d}", playerRankId)))) {
"SELECT `id`, `name`, `level` FROM `guild_ranks` WHERE `id` = {:d}", playerRankId)))) {
guild->addRank(result->getNumber<uint32_t>("id"), result->getString("name"),
result->getNumber<uint16_t>("level"));
}
Expand All @@ -328,14 +328,14 @@ bool IOLoginData::loadPlayer(Player* player, DBResult_ptr result)
player->guildWarVector = getWarList(guildId);

if ((result = tfs::db::store_query(fmt::format(
"SELECT COUNT(*) AS `members` FROM `guild_membership` WHERE `guild_id` = {:d}", guildId)))) {
"SELECT COUNT(*) AS `members` FROM `guild_membership` WHERE `guild_id` = {:d}", guildId)))) {
guild->setMemberCount(result->getNumber<uint32_t>("members"));
}
}
}

if ((result = tfs::db::store_query(fmt::format(
"SELECT `player_id`, `name` FROM `player_spells` WHERE `player_id` = {:d}", player->getGUID())))) {
"SELECT `player_id`, `name` FROM `player_spells` WHERE `player_id` = {:d}", player->getGUID())))) {
do {
player->learnedInstantSpellList.emplace_front(result->getString("name"));
} while (result->next());
Expand All @@ -346,8 +346,8 @@ bool IOLoginData::loadPlayer(Player* player, DBResult_ptr result)
std::map<uint8_t, Container*> openContainersList;

if ((result = tfs::db::store_query(fmt::format(
"SELECT `pid`, `sid`, `itemtype`, `count`, `attributes` FROM `player_items` WHERE `player_id` = {:d} ORDER BY `sid` DESC",
player->getGUID())))) {
"SELECT `pid`, `sid`, `itemtype`, `count`, `attributes` FROM `player_items` WHERE `player_id` = {:d} ORDER BY `sid` DESC",
player->getGUID())))) {
loadItems(itemMap, result);

for (ItemMap::const_reverse_iterator it = itemMap.rbegin(), end = itemMap.rend(); it != end; ++it) {
Expand Down Expand Up @@ -388,8 +388,8 @@ bool IOLoginData::loadPlayer(Player* player, DBResult_ptr result)
itemMap.clear();

if ((result = tfs::db::store_query(fmt::format(
"SELECT `pid`, `sid`, `itemtype`, `count`, `attributes` FROM `player_depotitems` WHERE `player_id` = {:d} ORDER BY `sid` DESC",
player->getGUID())))) {
"SELECT `pid`, `sid`, `itemtype`, `count`, `attributes` FROM `player_depotitems` WHERE `player_id` = {:d} ORDER BY `sid` DESC",
player->getGUID())))) {
loadItems(itemMap, result);

for (ItemMap::const_reverse_iterator it = itemMap.rbegin(), end = itemMap.rend(); it != end; ++it) {
Expand Down Expand Up @@ -420,8 +420,8 @@ bool IOLoginData::loadPlayer(Player* player, DBResult_ptr result)
itemMap.clear();

if ((result = tfs::db::store_query(fmt::format(
"SELECT `pid`, `sid`, `itemtype`, `count`, `attributes` FROM `player_inboxitems` WHERE `player_id` = {:d} ORDER BY `sid` DESC",
player->getGUID())))) {
"SELECT `pid`, `sid`, `itemtype`, `count`, `attributes` FROM `player_inboxitems` WHERE `player_id` = {:d} ORDER BY `sid` DESC",
player->getGUID())))) {
loadItems(itemMap, result);

for (ItemMap::const_reverse_iterator it = itemMap.rbegin(), end = itemMap.rend(); it != end; ++it) {
Expand Down Expand Up @@ -450,8 +450,8 @@ bool IOLoginData::loadPlayer(Player* player, DBResult_ptr result)
itemMap.clear();

if ((result = tfs::db::store_query(fmt::format(
"SELECT `pid`, `sid`, `itemtype`, `count`, `attributes` FROM `player_storeinboxitems` WHERE `player_id` = {:d} ORDER BY `sid` DESC",
player->getGUID())))) {
"SELECT `pid`, `sid`, `itemtype`, `count`, `attributes` FROM `player_storeinboxitems` WHERE `player_id` = {:d} ORDER BY `sid` DESC",
player->getGUID())))) {
loadItems(itemMap, result);

for (ItemMap::const_reverse_iterator it = itemMap.rbegin(), end = itemMap.rend(); it != end; ++it) {
Expand All @@ -478,31 +478,31 @@ bool IOLoginData::loadPlayer(Player* player, DBResult_ptr result)

// load storage map
if ((result = tfs::db::store_query(
fmt::format("SELECT `key`, `value` FROM `player_storage` WHERE `player_id` = {:d}", player->getGUID())))) {
fmt::format("SELECT `key`, `value` FROM `player_storage` WHERE `player_id` = {:d}", player->getGUID())))) {
do {
player->setStorageValue(result->getNumber<uint32_t>("key"), result->getNumber<int32_t>("value"), true);
} while (result->next());
}

// load vip list
if ((result = tfs::db::store_query(
fmt::format("SELECT `player_id` FROM `account_viplist` WHERE `account_id` = {:d}", player->getAccount())))) {
if ((result = tfs::db::store_query(fmt::format(
"SELECT `player_id` FROM `account_viplist` WHERE `account_id` = {:d}", player->getAccount())))) {
do {
player->addVIPInternal(result->getNumber<uint32_t>("player_id"));
} while (result->next());
}

// load outfits & addons
if ((result = tfs::db::store_query(fmt::format(
"SELECT `outfit_id`, `addons` FROM `player_outfits` WHERE `player_id` = {:d}", player->getGUID())))) {
"SELECT `outfit_id`, `addons` FROM `player_outfits` WHERE `player_id` = {:d}", player->getGUID())))) {
do {
player->addOutfit(result->getNumber<uint16_t>("outfit_id"), result->getNumber<uint8_t>("addons"));
} while (result->next());
}

// load mounts
if ((result = tfs::db::store_query(
fmt::format("SELECT `mount_id` FROM `player_mounts` WHERE `player_id` = {:d}", player->getGUID())))) {
fmt::format("SELECT `mount_id` FROM `player_mounts` WHERE `player_id` = {:d}", player->getGUID())))) {
do {
player->tameMount(result->getNumber<uint16_t>("mount_id"));
} while (result->next());
Expand Down

0 comments on commit 737751d

Please sign in to comment.