Core: Append single character to stream as character, not as a string

This commit is contained in:
Spp-
2011-07-29 14:18:28 +02:00
parent 06b46ba203
commit e47b96af3e
70 changed files with 432 additions and 424 deletions
+1 -1
View File
@@ -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();
+1 -1
View File
@@ -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();
}
+3 -3
View File
@@ -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())
+11 -10
View File
@@ -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());
+8 -8
View File
@@ -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();
}