diff options
| author | Spp- <u84280@epreinf21.(none)> | 2011-07-29 14:18:28 +0200 |
|---|---|---|
| committer | Spp- <u84280@epreinf21.(none)> | 2011-07-29 14:18:28 +0200 |
| commit | e47b96af3e3a41eae71e3e3da7eeee8bd3de86bc (patch) | |
| tree | 07d5ff1e6e39d792dbe1a89cc373c06702817787 /src/server/game | |
| parent | 06b46ba203d30cc5e2abc9741b2fc737ebdd7c38 (diff) | |
Core: Append single character to stream as character, not as a string
Diffstat (limited to 'src/server/game')
24 files changed, 229 insertions, 234 deletions
diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 6cecdca5cc6..9c065bf6d4c 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -491,20 +491,20 @@ void AchievementMgr::SaveToDB(SQLTransaction& trans) /// next new/changed record prefix else { - ssdel << ", "; - ssins << ", "; + ssdel << ','; + ssins << ','; } // new/changed record data ssdel << iter->first; - ssins << "("<<GetPlayer()->GetGUIDLow() << ", " << iter->first << ", " << uint64(iter->second.date) << ")"; + ssins << '(' << GetPlayer()->GetGUIDLow() << ',' << iter->first << ',' << uint64(iter->second.date) << ')'; /// mark as saved in db iter->second.changed = false; } if (need_execute) - ssdel << ")"; + ssdel << ')'; if (need_execute) { @@ -535,7 +535,7 @@ void AchievementMgr::SaveToDB(SQLTransaction& trans) } /// next new/changed record prefix else - ssdel << ", "; + ssdel << ','; // new/changed record data ssdel << iter->first; @@ -552,10 +552,10 @@ void AchievementMgr::SaveToDB(SQLTransaction& trans) } /// next new/changed record prefix else - ssins << ", "; + ssins << ','; // new/changed record data - ssins << "(" << GetPlayer()->GetGUIDLow() << ", " << iter->first << ", " << iter->second.counter << ", " << iter->second.date << ")"; + ssins << '(' << GetPlayer()->GetGUIDLow() << ',' << iter->first << ',' << iter->second.counter << ',' << iter->second.date << ')'; } /// mark as updated in db @@ -563,7 +563,7 @@ void AchievementMgr::SaveToDB(SQLTransaction& trans) } if (need_execute_del) // DELETE ... IN (.... _)_ - ssdel << ")"; + ssdel << ')'; if (need_execute_del || need_execute_ins) { @@ -584,7 +584,7 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, PreparedQ Field* fields = achievementResult->Fetch(); uint32 achievementid = fields[0].GetUInt16(); - // don't must happen: cleanup at server startup in sAchievementMgr->LoadCompletedAchievements() + // must not happen: cleanup at server startup in sAchievementMgr->LoadCompletedAchievements() AchievementEntry const* achievement = sAchievementStore.LookupEntry(achievementid); if (!achievement) continue; diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index 26a6ced5cf0..44392e6b3b2 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -140,7 +140,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry *auction, SQLTransaction& std::ostringstream msgAuctionWonBody; msgAuctionWonBody.width(16); msgAuctionWonBody << std::right << std::hex << auction->owner; - msgAuctionWonBody << std::dec << ":" << auction->bid << ":" << auction->buyout; + msgAuctionWonBody << std::dec << ':' << auction->bid << ':' << auction->buyout; sLog->outDebug(LOG_FILTER_AUCTIONHOUSE, "AuctionWon body string : %s", msgAuctionWonBody.str().c_str()); // set owner to bidder (to prevent delete item with sender char deleting) @@ -181,8 +181,8 @@ void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry * auction, SQLTran msgAuctionSalePendingBody.width(16); msgAuctionSalePendingBody << std::right << std::hex << auction->bidder; - msgAuctionSalePendingBody << std::dec << ":" << auction->bid << ":" << auction->buyout; - msgAuctionSalePendingBody << ":" << auction->deposit << ":" << auctionCut << ":0:"; + msgAuctionSalePendingBody << std::dec << ':' << auction->bid << ':' << auction->buyout; + msgAuctionSalePendingBody << ':' << auction->deposit << ':' << auctionCut << ":0:"; msgAuctionSalePendingBody << secsToTimeBitFields(distrTime); sLog->outDebug(LOG_FILTER_AUCTIONHOUSE, "AuctionSalePending body string : %s", msgAuctionSalePendingBody.str().c_str()); @@ -209,8 +209,8 @@ void AuctionHouseMgr::SendAuctionSuccessfulMail(AuctionEntry * auction, SQLTrans auctionSuccessfulBody.width(16); auctionSuccessfulBody << std::right << std::hex << auction->bidder; - auctionSuccessfulBody << std::dec << ":" << auction->bid << ":" << auction->buyout; - auctionSuccessfulBody << ":" << auction->deposit << ":" << auctionCut; + auctionSuccessfulBody << std::dec << ':' << auction->bid << ':' << auction->buyout; + auctionSuccessfulBody << ':' << auction->deposit << ':' << auctionCut; sLog->outDebug(LOG_FILTER_AUCTIONHOUSE, "AuctionSuccessful body string : %s", auctionSuccessfulBody.str().c_str()); @@ -624,18 +624,10 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player // dbc local name if (temp) { - if (locdbc_idx >= 0) - { - // Append the suffix (ie: of the Monkey) to the name using localization - name += " "; - name += temp[locdbc_idx]; - } - else - { - // Invalid localization? Append the suffix using default enUS - name += " "; - name += temp[LOCALE_enUS]; - } + // Append the suffix (ie: of the Monkey) to the name using localization + // or default enUS if localization is invalid + name += ' '; + name += temp[locdbc_idx >= 0 ? locdbc_idx : LOCALE_enUS]; } } } @@ -885,4 +877,4 @@ bool AuctionEntry::LoadFromFieldList(Field* fields) } return true; -}
\ No newline at end of file +} diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp index 3f4927eb43d..c56b975acb9 100755 --- a/src/server/game/Chat/Channels/Channel.cpp +++ b/src/server/game/Chat/Channels/Channel.cpp @@ -103,7 +103,7 @@ void Channel::UpdateChannelInDB() const std::ostringstream banlist; BannedList::const_iterator iter; for (iter = banned.begin(); iter != banned.end(); ++iter) - banlist << (*iter) << " "; + banlist << (*iter) << ' '; std::string banListStr = banlist.str(); diff --git a/src/server/game/Chat/ChatLink.cpp b/src/server/game/Chat/ChatLink.cpp index 30f8a4374f7..dde8fdd15c8 100644 --- a/src/server/game/Chat/ChatLink.cpp +++ b/src/server/game/Chat/ChatLink.cpp @@ -173,7 +173,7 @@ inline std::string ItemChatLink::FormatName(uint8 index, ItemLocale const *local else ss << locale->Name[index]; if (suffixStrings) - ss << " " << suffixStrings[index]; + ss << ' ' << suffixStrings[index]; return ss.str(); } diff --git a/src/server/game/Chat/Commands/Level1.cpp b/src/server/game/Chat/Commands/Level1.cpp index 6936f3ef07e..74300e5d02f 100755 --- a/src/server/game/Chat/Commands/Level1.cpp +++ b/src/server/game/Chat/Commands/Level1.cpp @@ -512,9 +512,9 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args) // send area in "id - [name]" format std::ostringstream ss; if (m_session) - ss << areaEntry->ID << " - |cffffffff|Harea:" << areaEntry->ID << "|h[" << name << " " << localeNames[loc]<< "]|h|r"; + ss << areaEntry->ID << " - |cffffffff|Harea:" << areaEntry->ID << "|h[" << name << ' ' << localeNames[loc]<< "]|h|r"; else - ss << areaEntry->ID << " - " << name << " " << localeNames[loc]; + ss << areaEntry->ID << " - " << name << ' ' << localeNames[loc]; SendSysMessage (ss.str ().c_str()); @@ -575,7 +575,7 @@ bool ChatHandler::HandleLookupTeleCommand(const char * args) if (m_session) reply << " |cffffffff|Htele:" << itr->first << "|h[" << tele->name << "]|h|r\n"; else - reply << " " << itr->first << " " << tele->name << "\n"; + reply << " " << itr->first << ' ' << tele->name << "\n"; } if (reply.str().empty()) diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index 7362353b3cf..3c8c4325e72 100755 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -506,29 +506,30 @@ bool ChatHandler::HandleCharacterReputationCommand(const char* args) FactionStateList const& targetFSL = target->GetReputationMgr().GetStateList(); for (FactionStateList::const_iterator itr = targetFSL.begin(); itr != targetFSL.end(); ++itr) { - FactionEntry const *factionEntry = sFactionStore.LookupEntry(itr->second.ID); + const FactionState& faction = itr->second; + FactionEntry const *factionEntry = sFactionStore.LookupEntry(faction.ID); char const* factionName = factionEntry ? factionEntry->name[loc] : "#Not found#"; ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry); std::string rankName = GetTrinityString(ReputationRankStrIndex[rank]); std::ostringstream ss; if (m_session) - ss << itr->second.ID << " - |cffffffff|Hfaction:" << itr->second.ID << "|h[" << factionName << " " << localeNames[loc] << "]|h|r"; + ss << faction.ID << " - |cffffffff|Hfaction:" << faction.ID << "|h[" << factionName << ' ' << localeNames[loc] << "]|h|r"; else - ss << itr->second.ID << " - " << factionName << " " << localeNames[loc]; + ss << faction.ID << " - " << factionName << ' ' << localeNames[loc]; - ss << " " << rankName << " (" << target->GetReputationMgr().GetReputation(factionEntry) << ")"; + ss << ' ' << rankName << " (" << target->GetReputationMgr().GetReputation(factionEntry) << ')'; - if (itr->second.Flags & FACTION_FLAG_VISIBLE) + if (faction.Flags & FACTION_FLAG_VISIBLE) ss << GetTrinityString(LANG_FACTION_VISIBLE); - if (itr->second.Flags & FACTION_FLAG_AT_WAR) + if (faction.Flags & FACTION_FLAG_AT_WAR) ss << GetTrinityString(LANG_FACTION_ATWAR); - if (itr->second.Flags & FACTION_FLAG_PEACE_FORCED) + if (faction.Flags & FACTION_FLAG_PEACE_FORCED) ss << GetTrinityString(LANG_FACTION_PEACE_FORCED); - if (itr->second.Flags & FACTION_FLAG_HIDDEN) + if (faction.Flags & FACTION_FLAG_HIDDEN) ss << GetTrinityString(LANG_FACTION_HIDDEN); - if (itr->second.Flags & FACTION_FLAG_INVISIBLE_FORCED) + if (faction.Flags & FACTION_FLAG_INVISIBLE_FORCED) ss << GetTrinityString(LANG_FACTION_INVISIBLE_FORCED); - if (itr->second.Flags & FACTION_FLAG_INACTIVE) + if (faction.Flags & FACTION_FLAG_INACTIVE) ss << GetTrinityString(LANG_FACTION_INACTIVE); SendSysMessage(ss.str().c_str()); diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index dfe5e3edd7c..eb53d856385 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -1062,9 +1062,9 @@ bool ChatHandler::HandleLookupSpellCommand(const char *args) ss << GetTrinityString(LANG_SPELL_RANK) << rank; if (m_session) - ss << " " << localeNames[loc] << "]|h|r"; + ss << ' ' << localeNames[loc] << "]|h|r"; else - ss << " " << localeNames[loc]; + ss << ' ' << localeNames[loc]; if (talent) ss << GetTrinityString(LANG_TALENT); @@ -1426,16 +1426,16 @@ bool ChatHandler::HandleLookupFactionCommand(const char *args) // or "id - [faction] [no reputation]" format std::ostringstream ss; if (m_session) - ss << id << " - |cffffffff|Hfaction:" << id << "|h[" << name << " " << localeNames[loc] << "]|h|r"; + ss << id << " - |cffffffff|Hfaction:" << id << "|h[" << name << ' ' << localeNames[loc] << "]|h|r"; else - ss << id << " - " << name << " " << localeNames[loc]; + ss << id << " - " << name << ' ' << localeNames[loc]; if (repState) // and then target != NULL also { uint32 index = target->GetReputationMgr().GetReputationRankStrIndex(factionEntry); std::string rankName = GetTrinityString(index); - ss << " " << rankName << "|h|r (" << target->GetReputationMgr().GetReputation(factionEntry) << ")"; + ss << ' ' << rankName << "|h|r (" << target->GetReputationMgr().GetReputation(factionEntry) << ')'; if (repState->Flags & FACTION_FLAG_VISIBLE) ss << GetTrinityString(LANG_FACTION_VISIBLE); @@ -1589,9 +1589,9 @@ bool ChatHandler::HandleLookupMapCommand(const char *args) std::ostringstream ss; if (m_session) - ss << id << " - |cffffffff|Hmap:" << id << "|h[" << name << "]"; + ss << id << " - |cffffffff|Hmap:" << id << "|h[" << name << ']'; else // console - ss << id << " - [" << name << "]"; + ss << id << " - [" << name << ']'; if (MapInfo->IsContinent()) ss << GetTrinityString(LANG_CONTINENT); @@ -4029,7 +4029,7 @@ std::string GetTimeString(uint64 time) std::ostringstream ss; if (days) ss << days << "d "; if (hours) ss << hours << "h "; - ss << minute << "m"; + ss << minute << 'm'; return ss.str(); } diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 8f42fa3a0f3..b34ac0bc681 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -224,7 +224,11 @@ inline void LoadDBC(uint32& availableDbcLocales, StoreProblemList& errors, DBCSt if (!(availableDbcLocales & (1 << i))) continue; - std::string localizedName = dbcPath + localeNames[i] + "/" + filename; + std::string localizedName(dbcPath); + localizedName.append(localeNames[i]); + localizedName.push_back('/'); + localizedName.append(filename); + if (!storage.LoadStringsFrom(localizedName.c_str())) availableDbcLocales &= ~(1<<i); // mark as not available for speedup next checks } diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index aa27d5d3484..4b18decb6cc 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -1882,7 +1882,7 @@ std::string LFGMgr::ConcatenateGuids(LfgGuidList check) LfgGuidList::const_iterator it = check.begin(); o << (*it); for (++it; it != check.end(); ++it) - o << "|" << (*it); + o << '|' << (*it); return o.str(); } diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 40445dbc8fd..0896a6d603a 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -437,11 +437,11 @@ void Creature::Update(uint32 diff) switch(m_deathState) { case JUST_ALIVED: - // Don't must be called, see Creature::setDeathState JUST_ALIVED -> ALIVE promoting. + // Must not be called, see Creature::setDeathState JUST_ALIVED -> ALIVE promoting. sLog->outError("Creature (GUID: %u Entry: %u) in wrong state: JUST_ALIVED (4)", GetGUIDLow(), GetEntry()); break; case JUST_DIED: - // Don't must be called, see Creature::setDeathState JUST_DIED -> CORPSE promoting. + // Must not be called, see Creature::setDeathState JUST_DIED -> CORPSE promoting. sLog->outError("Creature (GUID: %u Entry: %u) in wrong state: JUST_DEAD (1)", GetGUIDLow(), GetEntry()); break; case DEAD: @@ -1052,7 +1052,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) dynamicflags = 0; } - // data->guid = guid don't must be update at save + // data->guid = guid must not be updated at save data.id = GetEntry(); data.mapid = mapid; data.phaseMask = phaseMask; @@ -1076,33 +1076,33 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) data.unit_flags = unit_flags; data.dynamicflags = dynamicflags; - // updated in DB + // update in DB SQLTransaction trans = WorldDatabase.BeginTransaction(); trans->PAppend("DELETE FROM creature WHERE guid = '%u'", m_DBTableGuid); std::ostringstream ss; ss << "INSERT INTO creature VALUES (" - << m_DBTableGuid << ", " - << GetEntry() << ", " - << mapid <<", " - << uint32(spawnMask) << ", " // cast to prevent save as symbol - << uint16(GetPhaseMask()) << ", " // prevent out of range error - << displayId <<", " - << GetEquipmentId() <<", " - << GetPositionX() << ", " - << GetPositionY() << ", " - << GetPositionZ() << ", " - << GetOrientation() << ", " - << m_respawnDelay << ", " //respawn time - << (float) m_respawnradius << ", " //spawn distance (float) - << (uint32) (0) << ", " //currentwaypoint - << GetHealth() << ", " //curhealth - << GetPower(POWER_MANA) << ", " //curmana - << GetDefaultMovementType() << ", " //default movement generator type - << npcflag << ", " - << unit_flags << ", " - << dynamicflags << ")"; + << m_DBTableGuid << ',' + << GetEntry() << ',' + << mapid << ',' + << uint32(spawnMask) << ',' // cast to prevent save as symbol + << uint16(GetPhaseMask()) << ',' // prevent out of range error + << displayId << ',' + << GetEquipmentId() << ',' + << GetPositionX() << ',' + << GetPositionY() << ',' + << GetPositionZ() << ',' + << GetOrientation() << ',' + << m_respawnDelay << ',' //respawn time + << (float) m_respawnradius << ',' //spawn distance (float) + << (uint32) (0) << ',' //currentwaypoint + << GetHealth() << ',' //curhealth + << GetPower(POWER_MANA) << ',' //curmana + << GetDefaultMovementType() << ',' //default movement generator type + << npcflag << ',' + << unit_flags << ',' + << dynamicflags << ')'; trans->Append(ss.str().c_str()); diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 10e7367bf0b..5d4eeb48111 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -668,7 +668,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) // update in loaded data (changing data only in this place) GameObjectData& data = sObjectMgr->NewGOData(m_DBTableGuid); - // data->guid = guid don't must be update at save + // data->guid = guid must not be updated at save data.id = GetEntry(); data.mapid = mapid; data.phaseMask = phaseMask; @@ -686,25 +686,25 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) data.spawnMask = spawnMask; data.artKit = GetGoArtKit(); - // updated in DB + // update in DB std::ostringstream ss; ss << "INSERT INTO gameobject VALUES (" - << m_DBTableGuid << ", " - << GetEntry() << ", " - << mapid << ", " - << uint32(spawnMask) << ", " // cast to prevent save as symbol - << uint16(GetPhaseMask()) << ", " // prevent out of range error - << GetPositionX() << ", " - << GetPositionY() << ", " - << GetPositionZ() << ", " - << GetOrientation() << ", " - << GetFloatValue(GAMEOBJECT_PARENTROTATION) << ", " - << GetFloatValue(GAMEOBJECT_PARENTROTATION+1) << ", " - << GetFloatValue(GAMEOBJECT_PARENTROTATION+2) << ", " - << GetFloatValue(GAMEOBJECT_PARENTROTATION+3) << ", " - << m_respawnDelayTime << ", " - << uint32(GetGoAnimProgress()) << ", " - << uint32(GetGoState()) << ")"; + << m_DBTableGuid << ',' + << GetEntry() << ',' + << mapid << ',' + << uint32(spawnMask) << ',' // cast to prevent save as symbol + << uint16(GetPhaseMask()) << ',' // prevent out of range error + << GetPositionX() << ',' + << GetPositionY() << ',' + << GetPositionZ() << ',' + << GetOrientation() << ',' + << GetFloatValue(GAMEOBJECT_PARENTROTATION) << ',' + << GetFloatValue(GAMEOBJECT_PARENTROTATION+1) << ',' + << GetFloatValue(GAMEOBJECT_PARENTROTATION+2) << ',' + << GetFloatValue(GAMEOBJECT_PARENTROTATION+3) << ',' + << m_respawnDelayTime << ',' + << uint32(GetGoAnimProgress()) << ',' + << uint32(GetGoState()) << ')'; SQLTransaction trans = WorldDatabase.BeginTransaction(); trans->PAppend("DELETE FROM gameobject WHERE guid = '%u'", m_DBTableGuid); diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index fe99951eec8..0478bf6a71b 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -330,7 +330,7 @@ void Item::SaveToDB(SQLTransaction& trans) std::ostringstream ssSpells; for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) - ssSpells << GetSpellCharges(i) << " "; + ssSpells << GetSpellCharges(i) << ' '; stmt->setString(++index, ssSpells.str()); stmt->setUInt32(++index, GetUInt32Value(ITEM_FIELD_FLAGS)); @@ -338,9 +338,9 @@ void Item::SaveToDB(SQLTransaction& trans) std::ostringstream ssEnchants; for (uint8 i = 0; i < MAX_ENCHANTMENT_SLOT; ++i) { - ssEnchants << GetEnchantmentId(EnchantmentSlot(i)) << " "; - ssEnchants << GetEnchantmentDuration(EnchantmentSlot(i)) << " "; - ssEnchants << GetEnchantmentCharges(EnchantmentSlot(i)) << " "; + ssEnchants << GetEnchantmentId(EnchantmentSlot(i)) << ' '; + ssEnchants << GetEnchantmentDuration(EnchantmentSlot(i)) << ' '; + ssEnchants << GetEnchantmentCharges(EnchantmentSlot(i)) << ' '; } stmt->setString(++index, ssEnchants.str()); diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index f1567c4dadb..36961f99ef2 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -155,7 +155,7 @@ std::string Object::_ConcatFields(uint16 startIndex, uint16 size) const { std::ostringstream ss; for (uint16 index = 0; index < size; ++index) - ss << GetUInt32Value(index + startIndex) << " "; + ss << GetUInt32Value(index + startIndex) << ' '; return ss.str(); } diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index fc9d7f64545..0f8da71ccaa 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -402,30 +402,30 @@ void Pet::SavePetToDB(PetSaveMode mode) std::ostringstream ss; ss << "INSERT INTO character_pet (id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType) " << "VALUES (" - << m_charmInfo->GetPetNumber() << ", " - << GetEntry() << ", " - << owner << ", " - << GetNativeDisplayId() << ", " - << uint32(getLevel()) << ", " - << GetUInt32Value(UNIT_FIELD_PETEXPERIENCE) << ", " - << uint32(GetReactState()) << ", " + << m_charmInfo->GetPetNumber() << ',' + << GetEntry() << ',' + << owner << ',' + << GetNativeDisplayId() << ',' + << uint32(getLevel()) << ',' + << GetUInt32Value(UNIT_FIELD_PETEXPERIENCE) << ',' + << uint32(GetReactState()) << ',' << uint32(mode) << ", '" << name.c_str() << "', " - << uint32(HasByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED) ? 0 : 1) << ", " - << curhealth << ", " - << curmana << ", " + << uint32(HasByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED) ? 0 : 1) << ',' + << curhealth << ',' + << curmana << ',' << GetPower(POWER_HAPPINESS) << ", '"; for (uint32 i = ACTION_BAR_INDEX_START; i < ACTION_BAR_INDEX_END; ++i) { - ss << uint32(m_charmInfo->GetActionBarEntry(i)->GetType()) << " " - << uint32(m_charmInfo->GetActionBarEntry(i)->GetAction()) << " "; + ss << uint32(m_charmInfo->GetActionBarEntry(i)->GetType()) << ' ' + << uint32(m_charmInfo->GetActionBarEntry(i)->GetAction()) << ' '; }; ss << "', " - << time(NULL) << ", " - << GetUInt32Value(UNIT_CREATED_BY_SPELL) << ", " - << uint32(getPetType()) << ")"; + << time(NULL) << ',' + << GetUInt32Value(UNIT_CREATED_BY_SPELL) << ',' + << uint32(getPetType()) << ')'; trans->Append(ss.str().c_str()); CharacterDatabase.CommitTransaction(trans); @@ -1640,7 +1640,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/) uint32 id = fields[0].GetUInt32(); if (need_comma) - ss << ", "; + ss << ','; ss << id; @@ -1661,7 +1661,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/) continue; if (need_execute) - ss << ", "; + ss << ','; ss << spell; @@ -1672,7 +1672,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/) if (!need_execute) return; - ss << ")"; + ss << ')'; CharacterDatabase.Execute(ss.str().c_str()); } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index c293aef5f71..06ca30bf9cb 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -258,7 +258,7 @@ std::string PlayerTaxi::SaveTaxiDestinationsToString() std::ostringstream ss; for (size_t i=0; i < m_TaxiDestinations.size(); ++i) - ss << m_TaxiDestinations[i] << " "; + ss << m_TaxiDestinations[i] << ' '; return ss.str(); } @@ -278,10 +278,10 @@ uint32 PlayerTaxi::GetCurrentTaxiPath() const std::ostringstream& operator<< (std::ostringstream& ss, PlayerTaxi const& taxi) { - ss << "'"; + ss << '\''; for (uint8 i = 0; i < TaxiMaskSize; ++i) - ss << taxi.m_taximask[i] << " "; - ss << "'"; + ss << taxi.m_taximask[i] << ' '; + ss << '\''; return ss; } @@ -4288,8 +4288,8 @@ void Player::_SaveSpellCooldowns(SQLTransaction& trans) } // next new/changed record prefix else - ss << ", "; - ss << "(" << GetGUIDLow() << ", " << itr->first << ", " << itr->second.itemid << ", " << uint64(itr->second.end) << ")"; + ss << ','; + ss << '(' << GetGUIDLow() << ',' << itr->first << ',' << itr->second.itemid << ',' << uint64(itr->second.end) << ')'; ++itr; } else @@ -11895,7 +11895,7 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update // save data std::ostringstream ss; for (AllowedLooterSet::iterator itr = allowedLooters->begin(); itr != allowedLooters->end(); ++itr) - ss << *itr << " "; + ss << *itr << ' '; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_ITEM_BOP_TRADE); stmt->setUInt32(0, pItem->GetGUIDLow()); @@ -18187,118 +18187,118 @@ void Player::SaveToDB() "death_expire_time, taxi_path, arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, " "todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, health, power1, power2, power3, " "power4, power5, power6, power7, latency, speccount, activespec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars) VALUES (" - << GetGUIDLow() << ", " + << GetGUIDLow() << ',' << GetSession()->GetAccountId() << ", '" << sql_name << "', " - << uint32(getRace()) << ", " - << uint32(getClass()) << ", " - << uint32(getGender()) << ", " - << uint32(getLevel()) << ", " - << GetUInt32Value(PLAYER_XP) << ", " - << GetMoney() << ", " - << GetUInt32Value(PLAYER_BYTES) << ", " - << GetUInt32Value(PLAYER_BYTES_2) << ", " - << GetUInt32Value(PLAYER_FLAGS) << ", "; + << uint32(getRace()) << ',' + << uint32(getClass()) << ',' + << uint32(getGender()) << ',' + << uint32(getLevel()) << ',' + << GetUInt32Value(PLAYER_XP) << ',' + << GetMoney() << ',' + << GetUInt32Value(PLAYER_BYTES) << ',' + << GetUInt32Value(PLAYER_BYTES_2) << ',' + << GetUInt32Value(PLAYER_FLAGS) << ','; if (!IsBeingTeleported()) { - ss << GetMapId() << ", " - << (uint32)GetInstanceId() << ", " - << uint32(uint8(GetDungeonDifficulty()) | uint8(GetRaidDifficulty()) << 4) << ", " - << finiteAlways(GetPositionX()) << ", " - << finiteAlways(GetPositionY()) << ", " - << finiteAlways(GetPositionZ()) << ", " - << finiteAlways(GetOrientation()) << ", "; + ss << GetMapId() << ',' + << (uint32)GetInstanceId() << ',' + << uint32(uint8(GetDungeonDifficulty()) | uint8(GetRaidDifficulty()) << 4) << ',' + << finiteAlways(GetPositionX()) << ',' + << finiteAlways(GetPositionY()) << ',' + << finiteAlways(GetPositionZ()) << ',' + << finiteAlways(GetOrientation()) << ','; } else { - ss << GetTeleportDest().GetMapId() << ", " - << (uint32)0 << ", " - << uint32(uint8(GetDungeonDifficulty()) | uint8(GetRaidDifficulty()) << 4) << ", " - << finiteAlways(GetTeleportDest().GetPositionX()) << ", " - << finiteAlways(GetTeleportDest().GetPositionY()) << ", " - << finiteAlways(GetTeleportDest().GetPositionZ()) << ", " - << finiteAlways(GetTeleportDest().GetOrientation()) << ", "; + ss << GetTeleportDest().GetMapId() << ',' + << (uint32)0 << ',' + << uint32(uint8(GetDungeonDifficulty()) | uint8(GetRaidDifficulty()) << 4) << ',' + << finiteAlways(GetTeleportDest().GetPositionX()) << ',' + << finiteAlways(GetTeleportDest().GetPositionY()) << ',' + << finiteAlways(GetTeleportDest().GetPositionZ()) << ',' + << finiteAlways(GetTeleportDest().GetOrientation()) << ','; } - ss << m_taxi << ", "; // string with TaxiMaskSize numbers + ss << m_taxi << ','; // string with TaxiMaskSize numbers - ss << (IsInWorld() ? 1 : 0) << ", "; + ss << (IsInWorld() ? 1 : 0) << ','; - ss << uint32(m_cinematic) << ", "; + ss << uint32(m_cinematic) << ','; - ss << m_Played_time[PLAYED_TIME_TOTAL] << ", "; - ss << m_Played_time[PLAYED_TIME_LEVEL] << ", "; + ss << m_Played_time[PLAYED_TIME_TOTAL] << ','; + ss << m_Played_time[PLAYED_TIME_LEVEL] << ','; - ss << finiteAlways(m_rest_bonus) << ", "; - ss << uint32(time(NULL)) << ", "; - ss << (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) ? 1 : 0) << ", "; + ss << finiteAlways(m_rest_bonus) << ','; + ss << uint32(time(NULL)) << ','; + ss << (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) ? 1 : 0) << ','; //save, far from tavern/city //save, but in tavern/city - ss << m_resetTalentsCost << ", "; - ss << uint32(m_resetTalentsTime) << ", "; + ss << m_resetTalentsCost << ','; + ss << uint32(m_resetTalentsTime) << ','; - ss << finiteAlways(m_movementInfo.t_pos.GetPositionX()) << ", "; - ss << finiteAlways(m_movementInfo.t_pos.GetPositionY()) << ", "; - ss << finiteAlways(m_movementInfo.t_pos.GetPositionZ()) << ", "; - ss << finiteAlways(m_movementInfo.t_pos.GetOrientation()) << ", "; + ss << finiteAlways(m_movementInfo.t_pos.GetPositionX()) << ','; + ss << finiteAlways(m_movementInfo.t_pos.GetPositionY()) << ','; + ss << finiteAlways(m_movementInfo.t_pos.GetPositionZ()) << ','; + ss << finiteAlways(m_movementInfo.t_pos.GetOrientation()) << ','; if (m_transport) ss << m_transport->GetGUIDLow(); else - ss << "0"; - ss << ", "; + ss << '0'; + ss << ','; - ss << m_ExtraFlags << ", "; + ss << m_ExtraFlags << ','; - ss << uint32(m_stableSlots) << ", "; // to prevent save uint8 as char + ss << uint32(m_stableSlots) << ','; // to prevent save uint8 as char - ss << uint32(m_atLoginFlags) << ", "; + ss << uint32(m_atLoginFlags) << ','; - ss << GetZoneId() << ", "; + ss << GetZoneId() << ','; ss << uint32(m_deathExpireTime) << ", '"; ss << m_taxi.SaveTaxiDestinationsToString() << "', "; - ss << GetArenaPoints() << ", "; + ss << GetArenaPoints() << ','; - ss << GetHonorPoints() << ", "; + ss << GetHonorPoints() << ','; - ss << GetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION) << ", "; + ss << GetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION) << ','; - ss << GetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION) << ", "; + ss << GetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION) << ','; - ss << GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS) << ", "; + ss << GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS) << ','; - ss << GetUInt16Value(PLAYER_FIELD_KILLS, 0) << ", "; + ss << GetUInt16Value(PLAYER_FIELD_KILLS, 0) << ','; - ss << GetUInt16Value(PLAYER_FIELD_KILLS, 1) << ", "; + ss << GetUInt16Value(PLAYER_FIELD_KILLS, 1) << ','; - ss << GetUInt32Value(PLAYER_CHOSEN_TITLE) << ", "; + ss << GetUInt32Value(PLAYER_CHOSEN_TITLE) << ','; - ss << GetUInt64Value(PLAYER_FIELD_KNOWN_CURRENCIES) << ", "; + ss << GetUInt64Value(PLAYER_FIELD_KNOWN_CURRENCIES) << ','; - ss << GetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX) << ", "; + ss << GetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX) << ','; - ss << (uint16)(GetUInt32Value(PLAYER_BYTES_3) & 0xFFFE) << ", "; + ss << (uint16)(GetUInt32Value(PLAYER_BYTES_3) & 0xFFFE) << ','; ss << GetHealth(); for (uint32 i = 0; i < MAX_POWERS; ++i) - ss << ", " << GetPower(Powers(i)); - ss << ", "; + ss << ',' << GetPower(Powers(i)); + ss << ','; ss << GetSession()->GetLatency(); - ss << ", "; + ss << ','; ss << uint32(m_specsCount); - ss << ", "; + ss << ','; ss << uint32(m_activeSpec) << ", '"; for (uint32 i = 0; i < PLAYER_EXPLORED_ZONES_SIZE; ++i) - ss << GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + i) << " "; + ss << GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + i) << ' '; // cache equipment... ss << "', '"; for (uint32 i = 0; i < EQUIPMENT_SLOT_END * 2; ++i) - ss << GetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + i) << " "; + ss << GetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + i) << ' '; // ...and bags for enum opcode for (uint32 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) @@ -18306,19 +18306,19 @@ void Player::SaveToDB() if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) ss << item->GetEntry(); else - ss << "0"; + ss << '0'; ss << " 0 "; } - ss << "', "; + ss << "',"; ss << GetUInt32Value(PLAYER_AMMO_ID) << ", '"; for (uint32 i = 0; i < KNOWN_TITLES_SIZE*2; ++i) - ss << GetUInt32Value(PLAYER__FIELD_KNOWN_TITLES + i) << " "; + ss << GetUInt32Value(PLAYER__FIELD_KNOWN_TITLES + i) << ' '; - ss << "', "; + ss << "',"; ss << uint32(GetByteValue(PLAYER_FIELD_BYTES, 2)); - ss << ")"; + ss << ')'; SQLTransaction trans = CharacterDatabase.BeginTransaction(); @@ -18785,25 +18785,25 @@ void Player::_SaveStats(SQLTransaction& trans) ss << "INSERT INTO character_stats (guid, maxhealth, maxpower1, maxpower2, maxpower3, maxpower4, maxpower5, maxpower6, maxpower7, " "strength, agility, stamina, intellect, spirit, armor, resHoly, resFire, resNature, resFrost, resShadow, resArcane, " "blockPct, dodgePct, parryPct, critPct, rangedCritPct, spellCritPct, attackPower, rangedAttackPower, spellPower, resilience) VALUES (" - << GetGUIDLow() << ", " - << GetMaxHealth() << ", "; + << GetGUIDLow() << ',' + << GetMaxHealth() << ','; for (uint8 i = 0; i < MAX_POWERS; ++i) - ss << GetMaxPower(Powers(i)) << ", "; + ss << GetMaxPower(Powers(i)) << ','; for (uint8 i = 0; i < MAX_STATS; ++i) - ss << GetStat(Stats(i)) << ", "; + ss << GetStat(Stats(i)) << ','; // armor + school resistances for (int i = 0; i < MAX_SPELL_SCHOOL; ++i) - ss << GetResistance(SpellSchools(i)) << ", "; - ss << GetFloatValue(PLAYER_BLOCK_PERCENTAGE) << ", " - << GetFloatValue(PLAYER_DODGE_PERCENTAGE) << ", " - << GetFloatValue(PLAYER_PARRY_PERCENTAGE) << ", " - << GetFloatValue(PLAYER_CRIT_PERCENTAGE) << ", " - << GetFloatValue(PLAYER_RANGED_CRIT_PERCENTAGE) << ", " - << GetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1) << ", " - << GetUInt32Value(UNIT_FIELD_ATTACK_POWER) << ", " - << GetUInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER) << ", " - << GetBaseSpellPowerBonus() << ", " - << GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + CR_CRIT_TAKEN_SPELL) << ")"; + ss << GetResistance(SpellSchools(i)) << ','; + ss << GetFloatValue(PLAYER_BLOCK_PERCENTAGE) << ',' + << GetFloatValue(PLAYER_DODGE_PERCENTAGE) << ',' + << GetFloatValue(PLAYER_PARRY_PERCENTAGE) << ',' + << GetFloatValue(PLAYER_CRIT_PERCENTAGE) << ',' + << GetFloatValue(PLAYER_RANGED_CRIT_PERCENTAGE) << ',' + << GetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1) << ',' + << GetUInt32Value(UNIT_FIELD_ATTACK_POWER) << ',' + << GetUInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER) << ',' + << GetBaseSpellPowerBonus() << ',' + << GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + CR_CRIT_TAKEN_SPELL) << ')'; trans->Append(ss.str().c_str()); } @@ -18878,10 +18878,10 @@ void Player::SendAttackSwingNotInRange() void Player::SavePositionInDB(uint32 mapid, float x, float y, float z, float o, uint32 zone, uint64 guid) { std::ostringstream ss; - ss << "UPDATE characters SET position_x='"<<x<<"', position_y='"<<y - << "', position_z='"<<z<<"', orientation='"<<o<<"', map='"<<mapid - << "', zone='"<<zone<<"', trans_x='0', trans_y='0', trans_z='0', " - << "transguid='0', taxi_path='' WHERE guid='"<< GUID_LOPART(guid) <<"'"; + ss << "UPDATE characters SET position_x='" << x << "', position_y='" << y + << "', position_z='" << z << "', orientation='" << o << "', map='" << mapid + << "', zone='" << zone << "', trans_x='0', trans_y='0', trans_z='0', " + << "transguid='0', taxi_path='' WHERE guid='" << GUID_LOPART(guid) << '\''; sLog->outDebug(LOG_FILTER_UNITS, "%s", ss.str().c_str()); CharacterDatabase.Execute(ss.str().c_str()); } diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index c7800b0223c..2fe38b0a953 100755 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -244,7 +244,7 @@ std::string InstanceScript::GetBossSaveData() { std::ostringstream saveStream; for (std::vector<BossInfo>::iterator i = bosses.begin(); i != bosses.end(); ++i) - saveStream << (uint32)i->state << " "; + saveStream << (uint32)i->state << ' '; return saveStream.str(); } diff --git a/src/server/game/Pools/PoolMgr.cpp b/src/server/game/Pools/PoolMgr.cpp index 1c239fc0438..e77639060aa 100755 --- a/src/server/game/Pools/PoolMgr.cpp +++ b/src/server/game/Pools/PoolMgr.cpp @@ -790,7 +790,7 @@ void PoolMgr::LoadFromDB() std::ostringstream ss; ss<< "The pool(s) "; for (std::set<uint32>::const_iterator itr=checkedPools.begin(); itr != checkedPools.end(); ++itr) - ss << *itr << " "; + ss << *itr << ' '; ss << "create(s) a circular reference, which can cause the server to freeze.\nRemoving the last link between mother pool " << poolItr->first << " and child pool " << poolItr->second; sLog->outErrorDb("%s", ss.str().c_str()); diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp index ff6757a5237..c022d81404c 100755 --- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp @@ -1738,12 +1738,12 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) if (playerClass != CLASS_DEATH_KNIGHT) { for (uint8 i = 0; i < numFullTaximasks; ++i) - taximaskstream << uint32(sAllianceTaxiNodesMask[i]) << " "; + taximaskstream << uint32(sAllianceTaxiNodesMask[i]) << ' '; } else { for (uint8 i = 0; i < numFullTaximasks; ++i) - taximaskstream << uint32(sAllianceTaxiNodesMask[i] | sDeathKnightTaxiNodesMask[i]) << " "; + taximaskstream << uint32(sAllianceTaxiNodesMask[i] | sDeathKnightTaxiNodesMask[i]) << ' '; } } else @@ -1751,19 +1751,19 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) if (playerClass != CLASS_DEATH_KNIGHT) { for (uint8 i = 0; i < numFullTaximasks; ++i) - taximaskstream << uint32(sHordeTaxiNodesMask[i]) << " "; + taximaskstream << uint32(sHordeTaxiNodesMask[i]) << ' '; } else { for (uint8 i = 0; i < numFullTaximasks; ++i) - taximaskstream << uint32(sHordeTaxiNodesMask[i] | sDeathKnightTaxiNodesMask[i]) << " "; + taximaskstream << uint32(sHordeTaxiNodesMask[i] | sDeathKnightTaxiNodesMask[i]) << ' '; } } uint32 numEmptyTaximasks = 11 - numFullTaximasks; for (uint8 i = 0; i < numEmptyTaximasks; ++i) taximaskstream << "0 "; - taximaskstream << "0"; + taximaskstream << '0'; std::string taximask = taximaskstream.str(); trans->PAppend("UPDATE `characters` SET `taximask`= '%s' WHERE `guid` = '%u'", taximask.c_str(), lowGuid); } @@ -1784,7 +1784,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) if (requiredRaces & RACEMASK_ALLIANCE) { quests << uint32(qinfo->GetQuestId()); - quests << ","; + quests << ','; } } else // if (team == BG_TEAM_HORDE) @@ -1792,7 +1792,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) if (requiredRaces & RACEMASK_HORDE) { quests << uint32(qinfo->GetQuestId()); - quests << ","; + quests << ','; } } } diff --git a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp index ce73bc02e7b..74c51a4f726 100755 --- a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp @@ -516,10 +516,9 @@ void WorldSession::HandleStandStateChangeOpcode(WorldPacket & recv_data) void WorldSession::HandleContactListOpcode(WorldPacket & recv_data) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_CONTACT_LIST"); uint32 unk; recv_data >> unk; - sLog->outDebug(LOG_FILTER_NETWORKIO, "unk value is %u", unk); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_CONTACT_LIST - Unk: %d", unk); _player->GetSocial()->SendSocialList(_player); } @@ -537,7 +536,7 @@ void WorldSession::HandleAddFriendOpcode(WorldPacket & recv_data) if (!normalizePlayerName(friendName)) return; - CharacterDatabase.EscapeString(friendName); // prevent SQL injection - normal name don't must changed by this call + CharacterDatabase.EscapeString(friendName); // prevent SQL injection - normal name must not be changed by this call sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: %s asked to add friend : '%s'", GetPlayer()->GetName(), friendName.c_str()); @@ -626,7 +625,7 @@ void WorldSession::HandleAddIgnoreOpcode(WorldPacket & recv_data) if (!normalizePlayerName(IgnoreName)) return; - CharacterDatabase.EscapeString(IgnoreName); // prevent SQL injection - normal name don't must changed by this call + CharacterDatabase.EscapeString(IgnoreName); // prevent SQL injection - normal name must not be changed by this call sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: %s asked to Ignore: '%s'", GetPlayer()->GetName(), IgnoreName.c_str()); diff --git a/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp b/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp index 757fa4082f8..b0ab7ec6e9f 100755 --- a/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp @@ -225,12 +225,12 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) do { Field *fields = result->Fetch(); - ssInvalidPetitionGUIDs << "'" << fields[0].GetUInt32() << "' , "; + ssInvalidPetitionGUIDs << '\'' << fields[0].GetUInt32() << "' , "; } while (result->NextRow()); } // delete petitions with the same guid as this one - ssInvalidPetitionGUIDs << "'" << charter->GetGUIDLow() << "'"; + ssInvalidPetitionGUIDs << '\'' << charter->GetGUIDLow() << '\''; sLog->outDebug(LOG_FILTER_NETWORKIO, "Invalid petition GUIDs: %s", ssInvalidPetitionGUIDs.str().c_str()); CharacterDatabase.EscapeString(name); diff --git a/src/server/game/Server/Protocol/WorldLog.cpp b/src/server/game/Server/Protocol/WorldLog.cpp index 1a11a1efb88..5c7026797ed 100755 --- a/src/server/game/Server/Protocol/WorldLog.cpp +++ b/src/server/game/Server/Protocol/WorldLog.cpp @@ -45,7 +45,7 @@ void WorldLog::Initialize() if (!logsDir.empty()) { if ((logsDir.at(logsDir.length()-1) != '/') && (logsDir.at(logsDir.length()-1) != '\\')) - logsDir.append("/"); + logsDir.push_back('/'); } std::string logname = sConfig->GetStringDefault("WorldLogFile", ""); diff --git a/src/server/game/Tools/CharacterDatabaseCleaner.cpp b/src/server/game/Tools/CharacterDatabaseCleaner.cpp index 9e367ec8653..e77d07f0762 100644 --- a/src/server/game/Tools/CharacterDatabaseCleaner.cpp +++ b/src/server/game/Tools/CharacterDatabaseCleaner.cpp @@ -79,7 +79,6 @@ void CharacterDatabaseCleaner::CheckUnique(const char* column, const char* table std::ostringstream ss; do { - Field *fields = result->Fetch(); uint32 id = fields[0].GetUInt32(); @@ -92,7 +91,7 @@ void CharacterDatabaseCleaner::CheckUnique(const char* column, const char* table found = true; } else - ss << ", "; + ss << ','; ss << id; } @@ -101,7 +100,7 @@ void CharacterDatabaseCleaner::CheckUnique(const char* column, const char* table if (found) { - ss << ")"; + ss << ')'; CharacterDatabase.Execute(ss.str().c_str()); } } diff --git a/src/server/game/Tools/PlayerDump.cpp b/src/server/game/Tools/PlayerDump.cpp index 4a1c525167b..86fb5cce425 100755 --- a/src/server/game/Tools/PlayerDump.cpp +++ b/src/server/game/Tools/PlayerDump.cpp @@ -91,7 +91,7 @@ bool findnth(std::string &str, int n, std::string::size_type &s, std::string::si do { - e = str.find("'", s); + e = str.find('\'', s); if (e == std::string::npos) return false; } while (str[e-1] == '\\'); @@ -100,7 +100,7 @@ bool findnth(std::string &str, int n, std::string::size_type &s, std::string::si do { s = e+4; - e = str.find("'", s); + e = str.find('\'', s); if (e == std::string::npos) return false; } while (str[e-1] == '\\'); } @@ -202,14 +202,14 @@ std::string CreateDumpString(char const* tableName, QueryResult result) Field *fields = result->Fetch(); for (uint32 i = 0; i < result->GetFieldCount(); ++i) { - if (i == 0) ss << "'"; + if (i == 0) ss << '\''; else ss << ", '"; std::string s = fields[i].GetString(); CharacterDatabase.EscapeString(s); ss << s; - ss << "'"; + ss << '\''; } ss << ");"; return ss.str(); @@ -218,7 +218,7 @@ std::string CreateDumpString(char const* tableName, QueryResult result) std::string PlayerDumpWriter::GenerateWhereStr(char const* field, uint32 guid) { std::ostringstream wherestr; - wherestr << field << " = '" << guid << "'"; + wherestr << field << " = '" << guid << '\''; return wherestr.str(); } diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 6eed9573711..b795bcfdd24 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1103,7 +1103,7 @@ void World::LoadConfigSettings(bool reload) ///- Read the "Data" directory from the config file std::string dataPath = sConfig->GetStringDefault("DataDir", "./"); if (dataPath.at(dataPath.length()-1) != '/' && dataPath.at(dataPath.length()-1) != '\\') - dataPath.append("/"); + dataPath.push_back('/'); if (reload) { |
