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 | |
parent | 06b46ba203d30cc5e2abc9741b2fc737ebdd7c38 (diff) |
Core: Append single character to stream as character, not as a string
Diffstat (limited to 'src')
70 files changed, 434 insertions, 426 deletions
diff --git a/src/server/authserver/Realms/RealmList.cpp b/src/server/authserver/Realms/RealmList.cpp index 5a9da78a659..7fb9aadb14c 100755 --- a/src/server/authserver/Realms/RealmList.cpp +++ b/src/server/authserver/Realms/RealmList.cpp @@ -46,7 +46,7 @@ void RealmList::UpdateRealm(uint32 ID, const std::string& name, const std::strin // Append port to IP address. std::ostringstream ss; - ss << address << ":" << port; + ss << address << ':' << port; realm.address = ss.str(); realm.gamebuild = build; } diff --git a/src/server/collision/Maps/MapTree.cpp b/src/server/collision/Maps/MapTree.cpp index 632b4138c85..c8a0a19d6e6 100644 --- a/src/server/collision/Maps/MapTree.cpp +++ b/src/server/collision/Maps/MapTree.cpp @@ -95,9 +95,9 @@ namespace VMAP { std::stringstream tilefilename; tilefilename.fill('0'); - tilefilename << std::setw(3) << mapID << "_"; - //tilefilename << std::setw(2) << tileX << "_" << std::setw(2) << tileY << ".vmtile"; - tilefilename << std::setw(2) << tileY << "_" << std::setw(2) << tileX << ".vmtile"; + tilefilename << std::setw(3) << mapID << '_'; + //tilefilename << std::setw(2) << tileX << '_' << std::setw(2) << tileY << ".vmtile"; + tilefilename << std::setw(2) << tileY << '_' << std::setw(2) << tileX << ".vmtile"; return tilefilename.str(); } @@ -129,7 +129,7 @@ namespace VMAP { if (iBasePath.length() > 0 && (iBasePath[iBasePath.length()-1] != '/' || iBasePath[iBasePath.length()-1] != '\\')) { - iBasePath.append("/"); + iBasePath.push_back('/'); } } @@ -242,7 +242,7 @@ namespace VMAP { std::string basePath = vmapPath; if (basePath.length() > 0 && (basePath[basePath.length()-1] != '/' || basePath[basePath.length()-1] != '\\')) - basePath.append("/"); + basePath.push_back('/'); std::string fullname = basePath + VMapManager2::getMapFileName(mapID); bool success = true; FILE *rf = fopen(fullname.c_str(), "rb"); diff --git a/src/server/collision/Maps/TileAssembler.cpp b/src/server/collision/Maps/TileAssembler.cpp index c6000100d0b..4509caa8154 100644 --- a/src/server/collision/Maps/TileAssembler.cpp +++ b/src/server/collision/Maps/TileAssembler.cpp @@ -112,7 +112,7 @@ namespace VMAP // write map tree file std::stringstream mapfilename; - mapfilename << iDestDir << "/" << std::setfill('0') << std::setw(3) << map_iter->first << ".vmtree"; + mapfilename << iDestDir << '/' << std::setfill('0') << std::setw(3) << map_iter->first << ".vmtree"; FILE *mapfile = fopen(mapfilename.str().c_str(), "wb"); if (!mapfile) { @@ -153,10 +153,10 @@ namespace VMAP uint32 nSpawns = tileEntries.count(tile->first); std::stringstream tilefilename; tilefilename.fill('0'); - tilefilename << iDestDir << "/" << std::setw(3) << map_iter->first << "_"; + tilefilename << iDestDir << '/' << std::setw(3) << map_iter->first << '_'; uint32 x, y; StaticMapTree::unpackTileID(tile->first, x, y); - tilefilename << std::setw(2) << x << "_" << std::setw(2) << y << ".vmtile"; + tilefilename << std::setw(2) << x << '_' << std::setw(2) << y << ".vmtile"; FILE *tilefile = fopen(tilefilename.str().c_str(), "wb"); // file header if (success && fwrite(VMAP_MAGIC, 1, 8, tilefile) != 8) success = false; @@ -242,7 +242,10 @@ namespace VMAP bool TileAssembler::calculateTransformedBound(ModelSpawn &spawn) { - std::string modelFilename = iSrcDir + "/" + spawn.name; + std::string modelFilename(iSrcDir); + modelFilename.push_back('/'); + modelFilename.append(spawn.name); + ModelPosition modelPosition; modelPosition.iDir = spawn.iRot; modelPosition.iScale = spawn.iScale; @@ -358,7 +361,7 @@ namespace VMAP bool success = true; std::string filename = iSrcDir; if (filename.length() >0) - filename.append("/"); + filename.push_back('/'); filename.append(pModelFilename); FILE *rf = fopen(filename.c_str(), "rb"); @@ -496,7 +499,11 @@ namespace VMAP if (!groupsArray.empty()) { model.setGroupModels(groupsArray); - success = model.writeFile(iDestDir + "/" + pModelFilename + ".vmo"); + + std::string filename(iSrcDir); + filename.push_back('/'); + filename.append(pModelFilename).append(".vmo"); + success = model.writeFile(filename); } //std::cout << "readRawFile2: '" << pModelFilename << "' tris: " << nElements << " nodes: " << nNodes << std::endl; diff --git a/src/server/collision/Models/ModelInstance.cpp b/src/server/collision/Models/ModelInstance.cpp index e9258fdb522..957b15e9282 100644 --- a/src/server/collision/Models/ModelInstance.cpp +++ b/src/server/collision/Models/ModelInstance.cpp @@ -49,7 +49,7 @@ namespace VMAP // std::cout << "Ray crosses bound of '" << name << "'\n"; /* std::cout << "ray from:" << pRay.origin().x << ", " << pRay.origin().y << ", " << pRay.origin().z << " dir:" << pRay.direction().x << ", " << pRay.direction().y << ", " << pRay.direction().z - << " t/tmax:" << time << "/" << pMaxDist; + << " t/tmax:" << time << '/' << pMaxDist; std::cout << "\nBound lo:" << iBound.low().x << ", " << iBound.low().y << ", " << iBound.low().z << " hi: " << iBound.high().x << ", " << iBound.high().y << ", " << iBound.high().z << std::endl; */ // child bounds are defined in object space: 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) { diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp index 8393d338e93..1fa697f3f44 100644 --- a/src/server/scripts/Commands/cs_go.cpp +++ b/src/server/scripts/Commands/cs_go.cpp @@ -101,7 +101,7 @@ public: if (!tEntry) return false; - whereClause << "WHERE id = '" << tEntry << "'"; + whereClause << "WHERE id = '" << tEntry << '\''; } else { @@ -114,11 +114,11 @@ public: { std::string name = pParam1; WorldDatabase.EscapeString(name); - whereClause << ", creature_template WHERE creature.id = creature_template.entry AND creature_template.name "_LIKE_" '" << name << "'"; + whereClause << ", creature_template WHERE creature.id = creature_template.entry AND creature_template.name "_LIKE_" '" << name << '\''; } else { - whereClause << "WHERE guid = '" << guid << "'"; + whereClause << "WHERE guid = '" << guid << '\''; } } //sLog->outError("DEBUG: %s", whereClause.c_str()); diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp index 204012224d5..c51ab45acea 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -254,13 +254,13 @@ public: initString =false; } else - eventFilter << ", " << *itr; + eventFilter << ',' << *itr; } if (!initString) eventFilter << "))"; else - eventFilter << ")"; + eventFilter << ')'; result = WorldDatabase.PQuery("SELECT gameobject.guid, id, position_x, position_y, position_z, orientation, map, phaseMask, " "(POW(position_x - %f, 2) + POW(position_y - %f, 2) + POW(position_z - %f, 2)) AS order_ FROM gameobject " diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp index d78fefa1592..aef3e1b3502 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp @@ -50,14 +50,14 @@ public: { mob_water_elementalAI(Creature* c) : ScriptedAI(c) {} - uint32 uiWaterBoltTimer; - uint64 uiBalindaGUID; - uint32 uiResetTimer; + uint32 waterBoltTimer; + uint64 balindaGUID; + uint32 resetTimer; void Reset() { - uiWaterBoltTimer = 3*IN_MILLISECONDS; - uiResetTimer = 5*IN_MILLISECONDS; + waterBoltTimer = 3*IN_MILLISECONDS; + resetTimer = 5*IN_MILLISECONDS; } void UpdateAI(const uint32 diff) @@ -65,20 +65,20 @@ public: if (!UpdateVictim()) return; - if (uiWaterBoltTimer < diff) + if (waterBoltTimer < diff) { DoCast(me->getVictim(), SPELL_WATERBOLT); - uiWaterBoltTimer = 5*IN_MILLISECONDS; - } else uiWaterBoltTimer -= diff; + waterBoltTimer = 5*IN_MILLISECONDS; + } else waterBoltTimer -= diff; // check if creature is not outside of building - if (uiResetTimer < diff) + if (resetTimer < diff) { - if (Creature* pBalinda = Unit::GetCreature(*me, uiBalindaGUID)) + if (Creature* pBalinda = Unit::GetCreature(*me, balindaGUID)) if (me->GetDistance2d(pBalinda->GetHomePosition().GetPositionX(), pBalinda->GetHomePosition().GetPositionY()) > 50) EnterEvadeMode(); - uiResetTimer = 5*IN_MILLISECONDS; - } else uiResetTimer -= diff; + resetTimer = 5*IN_MILLISECONDS; + } else resetTimer -= diff; DoMeleeAttackIfReady(); } @@ -97,27 +97,27 @@ public: struct boss_balindaAI : public ScriptedAI { - boss_balindaAI(Creature* c) : ScriptedAI(c), Summons(me) {} + boss_balindaAI(Creature* c) : ScriptedAI(c), summons(me) {} - uint32 uiArcaneExplosionTimer; - uint32 uiConeOfColdTimer; - uint32 uiFireBoltTimer; - uint32 uiFrostboltTimer; - uint32 uiResetTimer; - uint32 uiWaterElementalTimer; + uint32 arcaneExplosionTimer; + uint32 coneOfColdTimer; + uint32 fireBoltTimer; + uint32 frostboltTimer; + uint32 resetTimer; + uint32 waterElementalTimer; - SummonList Summons; + SummonList summons; void Reset() { - uiArcaneExplosionTimer = urand(5*IN_MILLISECONDS, 15*IN_MILLISECONDS); - uiConeOfColdTimer = 8*IN_MILLISECONDS; - uiFireBoltTimer = 1*IN_MILLISECONDS; - uiFrostboltTimer = 4*IN_MILLISECONDS; - uiResetTimer = 5*IN_MILLISECONDS; - uiWaterElementalTimer = 0; - - Summons.DespawnAll(); + arcaneExplosionTimer = urand(5*IN_MILLISECONDS, 15*IN_MILLISECONDS); + coneOfColdTimer = 8*IN_MILLISECONDS; + fireBoltTimer = 1*IN_MILLISECONDS; + frostboltTimer = 4*IN_MILLISECONDS; + resetTimer = 5*IN_MILLISECONDS; + waterElementalTimer = 0; + + summons.DespawnAll(); } void EnterCombat(Unit* /*who*/) @@ -132,15 +132,15 @@ public: void JustSummoned(Creature* summoned) { - CAST_AI(mob_water_elemental::mob_water_elementalAI, summoned->AI())->uiBalindaGUID = me->GetGUID(); + CAST_AI(mob_water_elemental::mob_water_elementalAI, summoned->AI())->balindaGUID = me->GetGUID(); summoned->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true)); summoned->setFaction(me->getFaction()); - Summons.Summon(summoned); + summons.Summon(summoned); } void JustDied(Unit* /*Killer*/) { - Summons.DespawnAll(); + summons.DespawnAll(); } void UpdateAI(const uint32 diff) @@ -148,47 +148,47 @@ public: if (!UpdateVictim()) return; - if (uiWaterElementalTimer < diff) + if (waterElementalTimer < diff) { - if (Summons.empty()) + if (summons.empty()) me->SummonCreature(NPC_WATER_ELEMENTAL, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45*IN_MILLISECONDS); - uiWaterElementalTimer = 50*IN_MILLISECONDS; - } else uiWaterElementalTimer -= diff; + waterElementalTimer = 50*IN_MILLISECONDS; + } else waterElementalTimer -= diff; - if (uiArcaneExplosionTimer < diff) + if (arcaneExplosionTimer < diff) { DoCast(me->getVictim(), SPELL_ARCANE_EXPLOSION); - uiArcaneExplosionTimer = urand(5*IN_MILLISECONDS, 15*IN_MILLISECONDS); - } else uiArcaneExplosionTimer -= diff; + arcaneExplosionTimer = urand(5*IN_MILLISECONDS, 15*IN_MILLISECONDS); + } else arcaneExplosionTimer -= diff; - if (uiConeOfColdTimer < diff) + if (coneOfColdTimer < diff) { DoCast(me->getVictim(), SPELL_CONE_OF_COLD); - uiConeOfColdTimer = urand(10*IN_MILLISECONDS, 20*IN_MILLISECONDS); - } else uiConeOfColdTimer -= diff; + coneOfColdTimer = urand(10*IN_MILLISECONDS, 20*IN_MILLISECONDS); + } else coneOfColdTimer -= diff; - if (uiFireBoltTimer < diff) + if (fireBoltTimer < diff) { DoCast(me->getVictim(), SPELL_FIREBALL); - uiFireBoltTimer = urand(5*IN_MILLISECONDS, 9*IN_MILLISECONDS); - } else uiFireBoltTimer -= diff; + fireBoltTimer = urand(5*IN_MILLISECONDS, 9*IN_MILLISECONDS); + } else fireBoltTimer -= diff; - if (uiFrostboltTimer < diff) + if (frostboltTimer < diff) { DoCast(me->getVictim(), SPELL_FROSTBOLT); - uiFrostboltTimer = urand(4*IN_MILLISECONDS, 12*IN_MILLISECONDS); - } else uiFrostboltTimer -= diff; + frostboltTimer = urand(4*IN_MILLISECONDS, 12*IN_MILLISECONDS); + } else frostboltTimer -= diff; // check if creature is not outside of building - if (uiResetTimer < diff) + if (resetTimer < diff) { if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50) { EnterEvadeMode(); DoScriptText(YELL_EVADE, me); } - uiResetTimer = 5*IN_MILLISECONDS; - } else uiResetTimer -= diff; + resetTimer = 5*IN_MILLISECONDS; + } else resetTimer -= diff; DoMeleeAttackIfReady(); } @@ -204,4 +204,4 @@ void AddSC_boss_balinda() { new boss_balinda; new mob_water_elemental; -};
\ No newline at end of file +}; diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp index 9a5956f41b1..95d15ceb4bd 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp @@ -265,8 +265,8 @@ public: OUT_SAVE_INST_DATA; std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " - << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " " << GhostKillCount; + saveStream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' ' + << m_auiEncounter[3] << ' ' << m_auiEncounter[4] << ' ' << m_auiEncounter[5] << ' ' << GhostKillCount; str_data = saveStream.str(); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp index 2b0806f9e5e..05ad283a428 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp @@ -170,9 +170,9 @@ public: OUT_SAVE_INST_DATA; std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " - << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " " << m_auiEncounter[6] << " " - << m_auiEncounter[7] << " " << m_auiEncounter[8] << " " << m_auiEncounter[9] << " " << m_auiEncounter[10] << " " << m_auiEncounter[11]; + saveStream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' ' + << m_auiEncounter[3] << ' ' << m_auiEncounter[4] << ' ' << m_auiEncounter[5] << ' ' << m_auiEncounter[6] << ' ' + << m_auiEncounter[7] << ' ' << m_auiEncounter[8] << ' ' << m_auiEncounter[9] << ' ' << m_auiEncounter[10] << ' ' << m_auiEncounter[11]; strSaveData = saveStream.str(); diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp index 583cd5fc791..b08a73c320b 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp @@ -181,7 +181,7 @@ public: OUT_SAVE_INST_DATA; std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3]; + saveStream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' ' << m_auiEncounter[3]; str_data = saveStream.str(); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp index f5f407d4218..618ac8b7c27 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp @@ -367,8 +367,8 @@ class instance_stratholme : public InstanceMapScript OUT_SAVE_INST_DATA; std::ostringstream saveStream; - saveStream << EncounterState[0] << " " << EncounterState[1] << " " << EncounterState[2] << " " - << EncounterState[3] << " " << EncounterState[4] << " " << EncounterState[5]; + saveStream << EncounterState[0] << ' ' << EncounterState[1] << ' ' << EncounterState[2] << ' ' + << EncounterState[3] << ' ' << EncounterState[4] << ' ' << EncounterState[5]; OUT_SAVE_INST_DATA_COMPLETE; return saveStream.str(); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp index 4ad483d7fb7..fb412b018f2 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp @@ -273,8 +273,8 @@ public: { OUT_SAVE_INST_DATA; std::ostringstream stream; - stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " - << m_auiEncounter[4] << " " << m_auiEncounter[5]; + stream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' ' << m_auiEncounter[3] << ' ' + << m_auiEncounter[4] << ' ' << m_auiEncounter[5]; char* out = new char[stream.str().length() + 1]; strcpy(out, stream.str().c_str()); if (out) diff --git a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp index 5a16c21d21c..ea1a260b3af 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp @@ -377,7 +377,7 @@ class instance_uldaman : public InstanceMapScript OUT_SAVE_INST_DATA; std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2]; + saveStream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2]; str_data = saveStream.str(); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp index 2759d595b4d..35d103f2bb7 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp @@ -179,7 +179,7 @@ class instance_zulaman : public InstanceMapScript std::string GetSaveData() { std::ostringstream ss; - ss << "S " << BossKilled << " " << ChestLooted << " " << QuestMinute; + ss << "S " << BossKilled << ' ' << ChestLooted << ' ' << QuestMinute; char* data = new char[ss.str().length()+1]; strcpy(data, ss.str().c_str()); //sLog->outError("TSCR: Zul'aman saved, %s.", data); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp index 847a1f36ed8..282b0192f57 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp @@ -267,10 +267,10 @@ public: OUT_SAVE_INST_DATA; std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " - << m_auiEncounter[3] << " " << m_auiEncounter[4] - << " " << allianceRetreat << " " << hordeRetreat - << " " << RaidDamage; + saveStream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' ' + << m_auiEncounter[3] << ' ' << m_auiEncounter[4] + << ' ' << allianceRetreat << ' ' << hordeRetreat + << ' ' << RaidDamage; str_data = saveStream.str(); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp index f0b871e0cc0..d69036f3819 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp @@ -248,8 +248,8 @@ class instance_culling_of_stratholme : public InstanceMapScript OUT_SAVE_INST_DATA; std::ostringstream saveStream; - saveStream << "C S " << _encounterState[0] << " " << _encounterState[1] << " " - << _encounterState[2] << " " << _encounterState[3] << " " << _encounterState[4]; + saveStream << "C S " << _encounterState[0] << ' ' << _encounterState[1] << ' ' + << _encounterState[2] << ' ' << _encounterState[3] << ' ' << _encounterState[4]; OUT_SAVE_INST_DATA_COMPLETE; return saveStream.str(); diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp index 738c4761bc2..60cd1b5f82a 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp @@ -60,7 +60,7 @@ public: std::ostringstream saveStream; saveStream << "T C " << m_auiEncounter[0] - << " " << uiGongWaves; + << ' ' << uiGongWaves; str_data = saveStream.str(); diff --git a/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp b/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp index bb9c56724a8..945b8b7bc63 100644 --- a/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp +++ b/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp @@ -108,9 +108,9 @@ public: OUT_SAVE_INST_DATA; std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " - << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " " - << m_auiEncounter[6] << " " << m_auiEncounter[7] << " " << m_auiEncounter[8]; + saveStream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' ' + << m_auiEncounter[3] << ' ' << m_auiEncounter[4] << ' ' << m_auiEncounter[5] << ' ' + << m_auiEncounter[6] << ' ' << m_auiEncounter[7] << ' ' << m_auiEncounter[8]; OUT_SAVE_INST_DATA_COMPLETE; return saveStream.str(); diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp index 383689b3ec8..997b11fb084 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp @@ -164,7 +164,7 @@ public: OUT_SAVE_INST_DATA; std::ostringstream saveStream; - saveStream << "A N " << auiEncounter[0] << " " << auiEncounter[1] << " " + saveStream << "A N " << auiEncounter[0] << ' ' << auiEncounter[1] << ' ' << auiEncounter[2]; OUT_SAVE_INST_DATA_COMPLETE; diff --git a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/instance_ahnkahet.cpp b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/instance_ahnkahet.cpp index b10a49b7116..f9922009b1f 100644 --- a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/instance_ahnkahet.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/instance_ahnkahet.cpp @@ -249,9 +249,9 @@ public: OUT_SAVE_INST_DATA; std::ostringstream saveStream; - saveStream << "A K " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " - << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " - << spheres[0] << " " << spheres[1]; + saveStream << "A K " << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' + << m_auiEncounter[2] << ' ' << m_auiEncounter[3] << ' ' << m_auiEncounter[4] << ' ' + << spheres[0] << ' ' << spheres[1]; str_data = saveStream.str(); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp index 5f22a0fa3f9..426b41c3f02 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp @@ -60,8 +60,8 @@ enum eSpells enum eModels { - MODEL_SKELETON = 29846, - MODEL_GHOST = 21300 + MODEL_SKELETON = 29846, + MODEL_GHOST = 21300 }; enum ePhases @@ -325,7 +325,7 @@ public: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true)) { if (target && target->isAlive()) - DoCast(target, (SPELL_LEAP)); + DoCast(target, (SPELL_LEAP)); } uiAttackTimer = 3500; } else uiAttackTimer -= uiDiff; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp index e05f2044f74..884da9fc119 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp @@ -286,11 +286,11 @@ public: std::ostringstream saveStream; saveStream << "T C " << m_auiEncounter[0] - << " " << m_auiEncounter[1] - << " " << m_auiEncounter[2] - << " " << m_auiEncounter[3] - << " " << uiGrandChampionsDeaths - << " " << uiMovementDone; + << ' ' << m_auiEncounter[1] + << ' ' << m_auiEncounter[2] + << ' ' << m_auiEncounter[3] + << ' ' << uiGrandChampionsDeaths + << ' ' << uiMovementDone; str_data = saveStream.str(); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp index e6ab05a75e9..8c9741f407f 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp @@ -284,7 +284,7 @@ public: switch (uiId) { - case 0: // JUMP!? Fuck! THAT'S BEEZARR! Would someone PLEASE make MotionMaster->Move* work better? + case 0: if (m_bTargetDied) me->DespawnOrUnsummon(); break; @@ -728,7 +728,7 @@ public: switch (uiId) { - case 0: // JUMP!? Fuck! THAT'S BEEZARR! Would someone PLEASE make MotionMaster->Move* work better? + case 0: if (me->GetDistance2d(ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY()) < 6.0f) { // Middle of the room diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp index 8a404c447fd..e4d7d051676 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp @@ -619,7 +619,7 @@ class instance_trial_of_the_crusader : public InstanceMapScript std::ostringstream saveStream; for (uint8 i = 0; i < MAX_ENCOUNTERS; ++i) - saveStream << EncounterStatus[i] << " "; + saveStream << EncounterStatus[i] << ' '; saveStream << TrialCounter; SaveDataBuffer = saveStream.str(); diff --git a/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp b/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp index 8be1d4b7538..22f129c8418 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp @@ -191,8 +191,8 @@ public: std::string str_data; std::ostringstream saveStream; - saveStream << "D K " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " - << m_auiEncounter[2] << " " << m_auiEncounter[3]; + saveStream << "D K " << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' + << m_auiEncounter[2] << ' ' << m_auiEncounter[3]; str_data = saveStream.str(); diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp index 8cf78c92810..f86acaf623a 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp @@ -274,7 +274,7 @@ public: OUT_SAVE_INST_DATA; std::ostringstream saveStream; - saveStream << "H R 1 " << uiEncounter[0] << " " << uiEncounter[1] << " " << uiEncounter[2]; + saveStream << "H R 1 " << uiEncounter[0] << ' ' << uiEncounter[1] << ' ' << uiEncounter[2]; OUT_SAVE_INST_DATA_COMPLETE; return saveStream.str(); diff --git a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp index 46e979cee9b..8eca03a2075 100644 --- a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp +++ b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp @@ -366,11 +366,11 @@ public: OUT_SAVE_INST_DATA; std::ostringstream saveStream; - saveStream << "G D " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " - << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " - << (uiSladRanStatue ? GetObjState(uiSladRanStatue) : GO_STATE_ACTIVE) << " " << (uiMoorabiStatue ? GetObjState(uiMoorabiStatue) : GO_STATE_ACTIVE) << " " - << (uiDrakkariColossusStatue ? GetObjState(uiDrakkariColossusStatue) : GO_STATE_ACTIVE) << " " << (uiGalDarahStatue ? GetObjState(uiGalDarahStatue) : GO_STATE_READY) << " " - << (uiBridge ? GetObjState(uiBridge) : GO_STATE_ACTIVE) << " " << (uiCollision ? GetObjState(uiCollision) : GO_STATE_READY); + saveStream << "G D " << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' + << m_auiEncounter[2] << ' ' << m_auiEncounter[3] << ' ' << m_auiEncounter[4] << ' ' + << (uiSladRanStatue ? GetObjState(uiSladRanStatue) : GO_STATE_ACTIVE) << ' ' << (uiMoorabiStatue ? GetObjState(uiMoorabiStatue) : GO_STATE_ACTIVE) << ' ' + << (uiDrakkariColossusStatue ? GetObjState(uiDrakkariColossusStatue) : GO_STATE_ACTIVE) << ' ' << (uiGalDarahStatue ? GetObjState(uiGalDarahStatue) : GO_STATE_READY) << ' ' + << (uiBridge ? GetObjState(uiBridge) : GO_STATE_ACTIVE) << ' ' << (uiCollision ? GetObjState(uiCollision) : GO_STATE_READY); str_data = saveStream.str(); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp index 7890f2fd8fa..890fb66cb2b 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp @@ -1013,8 +1013,8 @@ class instance_icecrown_citadel : public InstanceMapScript OUT_SAVE_INST_DATA; std::ostringstream saveStream; - saveStream << "I C " << GetBossSaveData() << HeroicAttempts << " " - << ColdflameJetsState << " " << BloodQuickeningState << " " << BloodQuickeningMinutes; + saveStream << "I C " << GetBossSaveData() << HeroicAttempts << ' ' + << ColdflameJetsState << ' ' << BloodQuickeningState << ' ' << BloodQuickeningMinutes; OUT_SAVE_INST_DATA_COMPLETE; return saveStream.str(); diff --git a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp index 5b0571a7dcd..f57a81f4296 100644 --- a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp +++ b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp @@ -371,7 +371,7 @@ public: std::string GetSaveData() { std::ostringstream saveStream; - saveStream << GetBossSaveData() << " " << gothikDoorState; + saveStream << GetBossSaveData() << ' ' << gothikDoorState; return saveStream.str(); } diff --git a/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp b/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp index 9f2a0c05ae4..5ab6a96dff3 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp @@ -206,7 +206,7 @@ public: OUT_SAVE_INST_DATA; std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " + saveStream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' ' << m_auiEncounter[3]; strInstData = saveStream.str(); diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp index 92a6e590b36..0fefb28e9ab 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp @@ -210,8 +210,8 @@ public: OUT_SAVE_INST_DATA; std::ostringstream saveStream; - saveStream << "H L " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " - << m_auiEncounter[2] << " " << m_auiEncounter[3]; + saveStream << "H L " << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' + << m_auiEncounter[2] << ' ' << m_auiEncounter[3]; OUT_SAVE_INST_DATA_COMPLETE; return saveStream.str(); diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp index e28d082062f..9285d852404 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp @@ -225,7 +225,7 @@ public: OUT_SAVE_INST_DATA; std::ostringstream saveStream; - saveStream << "H S " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3]; + saveStream << "H S " << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' ' << m_auiEncounter[3]; str_data = saveStream.str(); diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp index 94f17de43f0..b8e595a3452 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp @@ -261,8 +261,8 @@ public: OUT_SAVE_INST_DATA; std::ostringstream saveStream; - saveStream << "U K " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " - << m_auiEncounter[2] << " " << forge_event[0] << " " << forge_event[1] << " " << forge_event[2]; + saveStream << "U K " << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' + << m_auiEncounter[2] << ' ' << forge_event[0] << ' ' << forge_event[1] << ' ' << forge_event[2]; str_data = saveStream.str(); diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp index 60259a8c413..e2c5dc5d341 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp @@ -211,8 +211,8 @@ public: OUT_SAVE_INST_DATA; std::ostringstream saveStream; - saveStream << "U P " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " - << m_auiEncounter[2] << " " << m_auiEncounter[3]; + saveStream << "U P " << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' + << m_auiEncounter[2] << ' ' << m_auiEncounter[3]; str_data = saveStream.str(); diff --git a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp index f4e1489c8ce..b6e40f21c6e 100644 --- a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp @@ -617,10 +617,10 @@ public: std::ostringstream saveStream; saveStream << "V H " << (uint16)m_auiEncounter[0] - << " " << (uint16)m_auiEncounter[1] - << " " << (uint16)m_auiEncounter[2] - << " " << (uint16)uiFirstBoss - << " " << (uint16)uiSecondBoss; + << ' ' << (uint16)m_auiEncounter[1] + << ' ' << (uint16)m_auiEncounter[2] + << ' ' << (uint16)uiFirstBoss + << ' ' << (uint16)uiSecondBoss; str_data = saveStream.str(); diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp index a7309ba146c..70c97b9073c 100644 --- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp +++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp @@ -144,12 +144,10 @@ public: // TODO: Find better way to handle emote // Emote - std::string *emote = new std::string(EMOTE_FOCUSES_ON); - emote->append(target->GetName()); - emote->append("!"); - const char* text = emote->c_str(); - me->MonsterTextEmote(text, 0, true); - delete emote; + std::string emote(EMOTE_FOCUSES_ON); + emote.append(target->GetName()); + emote.push_back('!'); + me->MonsterTextEmote(emote.c_str(), 0, true); } FocusFire_Timer = 15000+(rand()%5000); } else FocusFire_Timer -= diff; diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp index 5558a98f559..3288c1336e9 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp @@ -167,8 +167,8 @@ public: OUT_SAVE_INST_DATA; std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " - << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4]; + saveStream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' + << m_auiEncounter[2] << ' ' << m_auiEncounter[3] << ' ' << m_auiEncounter[4]; str_data = saveStream.str(); diff --git a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp index 3b8e86293eb..4feca05c111 100644 --- a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp +++ b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp @@ -284,10 +284,10 @@ public: OUT_SAVE_INST_DATA; std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " - << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4] - << " " << m_auiEncounter[5] << " " << m_auiEncounter[6] << " " << m_auiEncounter[7] - << " " << m_auiEncounter[8]; + saveStream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' + << m_auiEncounter[2] << ' ' << m_auiEncounter[3] << ' ' << m_auiEncounter[4] + << ' ' << m_auiEncounter[5] << ' ' << m_auiEncounter[6] << ' ' << m_auiEncounter[7] + << ' ' << m_auiEncounter[8]; str_data = saveStream.str(); diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp index 73719c14163..88350e4ea0b 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp @@ -383,8 +383,8 @@ class instance_serpent_shrine : public InstanceMapScript { OUT_SAVE_INST_DATA; std::ostringstream stream; - stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " - << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " " << TrashCount; + stream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' ' + << m_auiEncounter[3] << ' ' << m_auiEncounter[4] << ' ' << m_auiEncounter[5] << ' ' << TrashCount; OUT_SAVE_INST_DATA_COMPLETE; return stream.str(); } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp index 451983eeaf4..88496899bb1 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp @@ -200,7 +200,7 @@ public: { OUT_SAVE_INST_DATA; std::ostringstream stream; - stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3]; + stream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' ' << m_auiEncounter[3]; char* out = new char[stream.str().length() + 1]; strcpy(out, stream.str().c_str()); if (out) diff --git a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp index 20159b41a58..79b6be51d5c 100644 --- a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp +++ b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp @@ -100,9 +100,12 @@ public: { case 184468: MaulgarDoor = go->GetGUID(); - if (m_auiEncounter[0] == DONE) HandleGameObject(0, true, go); + if (m_auiEncounter[0] == DONE) + HandleGameObject(0, true, go); + break; + case 184662: + GruulDoor = go->GetGUID(); break; - case 184662: GruulDoor = go->GetGUID(); break; } } @@ -159,7 +162,7 @@ public: { OUT_SAVE_INST_DATA; std::ostringstream stream; - stream << m_auiEncounter[0] << " " << m_auiEncounter[1]; + stream << m_auiEncounter[0] << ' ' << m_auiEncounter[1]; char* out = new char[stream.str().length() + 1]; strcpy(out, stream.str().c_str()); if (out) diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp index 5abc7303c12..8c15bbace2d 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp @@ -94,44 +94,49 @@ class instance_blood_furnace : public InstanceMapScript { switch(creature->GetEntry()) { - case 17381: The_MakerGUID = creature->GetGUID(); break; - case 17380: BroggokGUID = creature->GetGUID(); break; - case 17377: Kelidan_The_BreakerGUID = creature->GetGUID(); break; + case 17381: + The_MakerGUID = creature->GetGUID(); + break; + case 17380: + BroggokGUID = creature->GetGUID(); + break; + case 17377: + Kelidan_The_BreakerGUID = creature->GetGUID(); + break; } } void OnGameObjectCreate(GameObject* go) { - - if (go->GetEntry() == 181766) //Final exit door - Door1GUID = go->GetGUID(); - if (go->GetEntry() == 181811) //The Maker Front door - Door2GUID = go->GetGUID(); - if (go->GetEntry() == 181812) //The Maker Rear door - Door3GUID = go->GetGUID(); - if (go->GetEntry() == 181822) //Broggok Front door - Door4GUID = go->GetGUID(); - if (go->GetEntry() == 181819) //Broggok Rear door - Door5GUID = go->GetGUID(); - if (go->GetEntry() == 181823) //Kelidan exit door - Door6GUID = go->GetGUID(); - - if (go->GetEntry() == 181813) //The Maker prison cell front right - PrisonCell1GUID = go->GetGUID(); - if (go->GetEntry() == 181814) //The Maker prison cell back right - PrisonCell2GUID = go->GetGUID(); - if (go->GetEntry() == 181816) //The Maker prison cell front left - PrisonCell3GUID = go->GetGUID(); - if (go->GetEntry() == 181815) //The Maker prison cell back left - PrisonCell4GUID = go->GetGUID(); - if (go->GetEntry() == 181821) //Broggok prison cell front right - PrisonCell5GUID = go->GetGUID(); - if (go->GetEntry() == 181818) //Broggok prison cell back right - PrisonCell6GUID = go->GetGUID(); - if (go->GetEntry() == 181820) //Broggok prison cell front left - PrisonCell7GUID = go->GetGUID(); - if (go->GetEntry() == 181817) //Broggok prison cell back left - PrisonCell8GUID = go->GetGUID(); + if (go->GetEntry() == 181766) //Final exit door + Door1GUID = go->GetGUID(); + if (go->GetEntry() == 181811) //The Maker Front door + Door2GUID = go->GetGUID(); + if (go->GetEntry() == 181812) //The Maker Rear door + Door3GUID = go->GetGUID(); + if (go->GetEntry() == 181822) //Broggok Front door + Door4GUID = go->GetGUID(); + if (go->GetEntry() == 181819) //Broggok Rear door + Door5GUID = go->GetGUID(); + if (go->GetEntry() == 181823) //Kelidan exit door + Door6GUID = go->GetGUID(); + + if (go->GetEntry() == 181813) //The Maker prison cell front right + PrisonCell1GUID = go->GetGUID(); + if (go->GetEntry() == 181814) //The Maker prison cell back right + PrisonCell2GUID = go->GetGUID(); + if (go->GetEntry() == 181816) //The Maker prison cell front left + PrisonCell3GUID = go->GetGUID(); + if (go->GetEntry() == 181815) //The Maker prison cell back left + PrisonCell4GUID = go->GetGUID(); + if (go->GetEntry() == 181821) //Broggok prison cell front right + PrisonCell5GUID = go->GetGUID(); + if (go->GetEntry() == 181818) //Broggok prison cell back right + PrisonCell6GUID = go->GetGUID(); + if (go->GetEntry() == 181820) //Broggok prison cell front left + PrisonCell7GUID = go->GetGUID(); + if (go->GetEntry() == 181817) //Broggok prison cell back left + PrisonCell8GUID = go->GetGUID(); } uint64 GetData64(uint32 data) @@ -174,7 +179,7 @@ class instance_blood_furnace : public InstanceMapScript OUT_SAVE_INST_DATA; std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2]; + saveStream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2]; str_data = saveStream.str(); diff --git a/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp b/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp index 1444dd2c1c4..8af59582a18 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp @@ -165,7 +165,7 @@ class instance_the_eye : public InstanceMapScript { OUT_SAVE_INST_DATA; std::ostringstream stream; - stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3]; + stream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' ' << m_auiEncounter[3]; char* out = new char[stream.str().length() + 1]; strcpy(out, stream.str().c_str()); if (out) diff --git a/src/server/shared/Database/PreparedStatement.cpp b/src/server/shared/Database/PreparedStatement.cpp index 343976c3ffa..22ca31fc20a 100755 --- a/src/server/shared/Database/PreparedStatement.cpp +++ b/src/server/shared/Database/PreparedStatement.cpp @@ -340,12 +340,12 @@ std::string MySQLPreparedStatement::getQueryString(const char *query) pos = queryString.find("?", pos); std::stringstream replace; - replace << "'"; + replace << '\''; switch (m_stmt->statement_data[i].type) { case TYPE_BOOL: - replace << (m_stmt->statement_data[i].data.boolean ? "1" : "0"); + replace << (m_stmt->statement_data[i].data.boolean ? '1' : '0'); break; case TYPE_UI8: case TYPE_UI16: @@ -373,7 +373,7 @@ std::string MySQLPreparedStatement::getQueryString(const char *query) replace << m_stmt->statement_data[i].str; break; } - replace << "'"; + replace << '\''; queryString.replace(pos, 1, replace.str()); } diff --git a/src/server/shared/Logging/Log.cpp b/src/server/shared/Logging/Log.cpp index ac74f893d58..b1318bf4aef 100755 --- a/src/server/shared/Logging/Log.cpp +++ b/src/server/shared/Logging/Log.cpp @@ -120,7 +120,7 @@ void Log::Initialize() m_logsDir = sConfig->GetStringDefault("LogsDir", ""); if (!m_logsDir.empty()) if ((m_logsDir.at(m_logsDir.length() - 1) != '/') && (m_logsDir.at(m_logsDir.length() - 1) != '\\')) - m_logsDir.append("/"); + m_logsDir.push_back('/'); m_logsTimestamp = "_" + GetTimestampStr(); @@ -183,7 +183,7 @@ void Log::Initialize() m_dumpsDir = sConfig->GetStringDefault("CharLogDump.SeparateDir", ""); if (!m_dumpsDir.empty()) if ((m_dumpsDir.at(m_dumpsDir.length() - 1) != '/') && (m_dumpsDir.at(m_dumpsDir.length() - 1) != '\\')) - m_dumpsDir.append("/"); + m_dumpsDir.push_back('/'); } } diff --git a/src/server/shared/Utilities/Util.cpp b/src/server/shared/Utilities/Util.cpp index 3cea21f7928..47e18943f75 100755 --- a/src/server/shared/Utilities/Util.cpp +++ b/src/server/shared/Utilities/Util.cpp @@ -182,7 +182,7 @@ uint32 TimeStringToSecs(const std::string& timestring) uint32 buffer = 0; uint32 multiplier = 0; - for (std::string::const_iterator itr = timestring.begin(); itr != timestring.end(); itr++ ) + for (std::string::const_iterator itr = timestring.begin(); itr != timestring.end(); ++itr) { if(isdigit(*itr)) { @@ -318,11 +318,11 @@ bool Utf8toWStr(const std::string& utf8str, std::wstring& wstr) { try { - size_t len = utf8::distance(utf8str.c_str(), utf8str.c_str()+utf8str.size()); - wstr.resize(len); - - if (len) + if (size_t len = utf8::distance(utf8str.c_str(), utf8str.c_str()+utf8str.size())) + { + wstr.resize(len); utf8::utf8to16(utf8str.c_str(), utf8str.c_str()+utf8str.size(), &wstr[0]); + } } catch(std::exception) { |