try some more stuff

This commit is contained in:
DarthArgus
2014-10-27 20:33:41 -07:00
parent 154aa76d66
commit 0c4829542d
6 changed files with 16 additions and 15 deletions
@@ -95,7 +95,7 @@ public:
unsigned submitRequest(GenericRequest *req, GenericResponse *res);
GenericConnection *getNextActiveConnection();
std::string &getGameCode() { return m_game; }
void addIdentifier(std::string id) { m_gameIdentifiers.push_back(id);}
void addIdentifier(const std::string &id) { m_gameIdentifiers.push_back(id);}
protected:
std::vector<GenericConnection *> m_serverConnections;
@@ -36,9 +36,9 @@ public:
unsigned getID() const { return m_id; }
std::string getData() const { return m_XMLdata; }
void setName(const std::string name) { m_name = name; }
void setName(const std::string &name) { m_name = name; }
void setID(unsigned id) { m_id = id; }
void setData(const std::string data) { m_XMLdata = data; }
void setData(const std::string &data) { m_XMLdata = data; }
protected:
std::string m_name;
@@ -320,13 +320,13 @@ CentralCSHandler::~CentralCSHandler()
CS_CMD( login_character )
{
unsigned pos = request.getCommandString().find(" ");
const unsigned &pos = request.getCommandString().find(" ");
std::string id;
std::string account;
if(pos == std::string::npos)
return;
unsigned pos2 = request.getCommandString().find(" ", pos + 1 );
const unsigned &pos2 = request.getCommandString().find(" ", pos + 1 );
id = request.getCommandString().substr(pos, pos2 - pos);
account = request.getCommandString().substr(pos2 + 1);
@@ -257,12 +257,13 @@ void CentralServerMetricsData::updateData()
{
for (std::map<int, std::pair<std::string, int> >::const_iterator iter = lastLoginTimeStatistics.begin(); iter != lastLoginTimeStatistics.end(); ++iter)
{
if (!iter->second.first.empty() && (m_mapLastLoginTimeStatisticsIndex.count(iter->second.first) < 1))
std::pair<std::string, int> secondIter = iter->second;
if (!secondIter.first.empty() && (m_mapLastLoginTimeStatisticsIndex.count(secondIter.first) < 1))
{
std::string label("population.");
label += iter->second.first;
label += secondIter.first;
m_mapLastLoginTimeStatisticsIndex[iter->second.first] = addMetric(label.c_str(), 0, NULL, false, false);
m_mapLastLoginTimeStatisticsIndex[secondIter.first] = addMetric(label.c_str(), 0, NULL, false, false);
}
}
}