diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-01-15 01:07:47 +0200 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-01-15 02:05:50 +0200 |
commit | e2150d04662a4ba8b5304dabcc74be0bacded5b7 (patch) | |
tree | cbeb05c2f056a7d5ac4a08e7b80799b5cfd4785b /src/net/manaserv | |
parent | edda37acb9d66f2751ef712c83dced62428fa685 (diff) | |
download | mv-e2150d04662a4ba8b5304dabcc74be0bacded5b7.tar.gz mv-e2150d04662a4ba8b5304dabcc74be0bacded5b7.tar.bz2 mv-e2150d04662a4ba8b5304dabcc74be0bacded5b7.tar.xz mv-e2150d04662a4ba8b5304dabcc74be0bacded5b7.zip |
Fix code style, apply some fixes after checking with cppcheck from git.
Diffstat (limited to 'src/net/manaserv')
-rw-r--r-- | src/net/manaserv/attributes.cpp | 8 | ||||
-rw-r--r-- | src/net/manaserv/charhandler.cpp | 4 | ||||
-rw-r--r-- | src/net/manaserv/loginhandler.cpp | 5 |
3 files changed, 10 insertions, 7 deletions
diff --git a/src/net/manaserv/attributes.cpp b/src/net/manaserv/attributes.cpp index 7cc0e053d..7802376ff 100644 --- a/src/net/manaserv/attributes.cpp +++ b/src/net/manaserv/attributes.cpp @@ -93,7 +93,7 @@ namespace Attributes attributeLabels.clear(); AttributeMap::const_iterator it, it_end; for (it = attributes.begin(), it_end = attributes.end(); - it != it_end; it++) + it != it_end; ++it) { if (it->second.modifiable && (it->second.scope == "character" || it->second.scope == "being")) @@ -288,7 +288,7 @@ namespace Attributes unsigned int count = 0; for_each_xml_child_node(effectNode, node) - { + { if (!xmlStrEqual(effectNode->name, BAD_CAST "modifier")) continue; ++count; @@ -307,7 +307,7 @@ namespace Attributes tag = name.substr(0, name.size() > 3 ? 3 : name.size()); tag = toLower(tag) + toString(count); - } + } std::string effect = XML::getProperty( effectNode, "effect", ""); @@ -395,7 +395,7 @@ namespace Attributes AttributeMap::const_iterator it, it_end; for (it = attributes.begin(), it_end = attributes.end(); - it != it_end; it++) + it != it_end; ++it) { if (it->second.playerInfoId == -1 && (it->second.scope == "character" diff --git a/src/net/manaserv/charhandler.cpp b/src/net/manaserv/charhandler.cpp index dd5430c03..adc3b206c 100644 --- a/src/net/manaserv/charhandler.cpp +++ b/src/net/manaserv/charhandler.cpp @@ -321,7 +321,7 @@ void CharHandler::newCharacter(const std::string &name, msg.writeInt8(slot); std::vector<int>::const_iterator it, it_end; - for (it = stats.begin(), it_end = stats.end(); it != it_end; it++) + for (it = stats.begin(), it_end = stats.end(); it != it_end; ++it) msg.writeInt16((*it)); accountServerConnection->send(msg); @@ -382,7 +382,7 @@ void CharHandler::updateCharacters() character->data.mAttributes[CORR_POINTS] = info.correctionPoints; for (CachedAttributes::const_iterator it = info.attribute.begin(), - it_end = info.attribute.end(); it != it_end; it++) + it_end = info.attribute.end(); it != it_end; ++it) { character->data.mStats[i].base = it->second.base; character->data.mStats[i].mod = it->second.mod; diff --git a/src/net/manaserv/loginhandler.cpp b/src/net/manaserv/loginhandler.cpp index 1588d762d..bd67967a0 100644 --- a/src/net/manaserv/loginhandler.cpp +++ b/src/net/manaserv/loginhandler.cpp @@ -58,6 +58,8 @@ LoginHandler::LoginHandler() }; handledMessages = _messages; loginHandler = this; + mMinUserNameLength = 4; + mMaxUserNameLength = 10; } void LoginHandler::handleMessage(Net::MessageIn &msg) @@ -232,7 +234,8 @@ void LoginHandler::handleMessage(Net::MessageIn &msg) std::string captchaURL = msg.readString(); std::string captchaInstructions = msg.readString(); - printf("%s: %s\n", captchaURL.c_str(), captchaInstructions.c_str()); + printf("%s: %s\n", captchaURL.c_str(), + captchaInstructions.c_str()); Client::setState(STATE_REGISTER); } |