diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-05-03 15:40:57 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-05-03 15:40:57 +0200 |
commit | ed8fba0a47d2e498267cbfbf1271bacb76c400e9 (patch) | |
tree | d9e2bec54c051edb9d6c4175c3e5e5532e8d35ce /src/account-server/serverhandler.cpp | |
parent | 769030e6bd22faeb760731172c221ae801c04dcc (diff) | |
parent | f6f27a9ffaf72f9856240db1bb788a9efa3e86f0 (diff) | |
download | manaserv-ed8fba0a47d2e498267cbfbf1271bacb76c400e9.tar.gz manaserv-ed8fba0a47d2e498267cbfbf1271bacb76c400e9.tar.bz2 manaserv-ed8fba0a47d2e498267cbfbf1271bacb76c400e9.tar.xz manaserv-ed8fba0a47d2e498267cbfbf1271bacb76c400e9.zip |
Merge branch 'master' into lpc2012
Diffstat (limited to 'src/account-server/serverhandler.cpp')
-rw-r--r-- | src/account-server/serverhandler.cpp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/src/account-server/serverhandler.cpp b/src/account-server/serverhandler.cpp index dbf74d03..1ba3c03d 100644 --- a/src/account-server/serverhandler.cpp +++ b/src/account-server/serverhandler.cpp @@ -213,12 +213,11 @@ void ServerHandler::processMessage(NetComputer *comp, MessageIn &msg) // transmit global world state variables std::map<std::string, std::string> variables; variables = storage->getAllWorldStateVars(Storage::WorldMap); - for (std::map<std::string, std::string>::iterator i = variables.begin(); - i != variables.end(); - i++) + + for (auto &variableIt : variables) { - outMsg.writeString(i->first); - outMsg.writeString(i->second); + outMsg.writeString(variableIt.first); + outMsg.writeString(variableIt.second); } comp->send(outMsg); @@ -256,12 +255,10 @@ void ServerHandler::processMessage(NetComputer *comp, MessageIn &msg) // Map vars number outMsg.writeInt16(variables.size()); - for (std::map<std::string, std::string>::iterator i = variables.begin(); - i != variables.end(); - i++) + for (auto &variableIt : variables) { - outMsg.writeString(i->first); - outMsg.writeString(i->second); + outMsg.writeString(variableIt.first); + outMsg.writeString(variableIt.second); } // Persistent Floor Items @@ -393,14 +390,12 @@ void ServerHandler::processMessage(NetComputer *comp, MessageIn &msg) // save the new value to the database storage->setWorldStateVar(name, value, Storage::WorldMap); // relay the new value to all gameservers - for (ServerHandler::NetComputers::iterator i = clients.begin(); - i != clients.end(); - i++) + for (NetComputer *netComputer : clients) { MessageOut varUpdateMessage(AGMSG_SET_VAR_WORLD); varUpdateMessage.writeString(name); varUpdateMessage.writeString(value); - (*i)->send(varUpdateMessage); + netComputer->send(varUpdateMessage); } } break; |