Index: definitions.h =================================================================== --- definitions.h (revision 35) +++ definitions.h (working copy) @@ -25,94 +25,80 @@ #define OTSERV_NAME "Avesta" #define OTSERV_CLIENT_VERSION "7.40" -#if defined(WIN32) && !defined(__WINDOWS__) -#define __WINDOWS__ -#endif -#ifdef XML_GCC_FREE - #define xmlFreeOTSERV(s) free(s) -#else - #define xmlFreeOTSERV(s) xmlFree(s) +#ifdef __USE_SQLITE__ +#define SINGLE_SQL_DRIVER #endif -#ifdef __USE_MINIDUMP__ - #ifndef __EXCEPTION_TRACER__ - #define __EXCEPTION_TRACER__ - #endif -#endif -#ifdef __DEBUG_EXCEPTION_REPORT__ - #define DEBUG_REPORT int *a = NULL; *a = 1; +#ifdef __USE_MYSQL__ +#ifdef SINGLE_SQL_DRIVER +#define MULTI_SQL_DRIVERS #else - #ifdef __EXCEPTION_TRACER__ - #include "exception.h" - #define DEBUG_REPORT ExceptionHandler::dumpStack(); - #else - #define DEBUG_REPORT - #endif +#define SINGLE_SQL_DRIVER #endif - -#ifdef __USE_SQLITE__ - #define SINGLE_SQL_DRIVER #endif -#ifdef __USE_MYSQL__ - #ifdef SINGLE_SQL_DRIVER - #define MULTI_SQL_DRIVERS - #else - #define SINGLE_SQL_DRIVER - #endif -#endif - #ifdef __USE_ODBC__ - #ifdef SINGLE_SQL_DRIVER - #define MULTI_SQL_DRIVERS - #else - #define SINGLE_SQL_DRIVER - #endif +#ifdef SINGLE_SQL_DRIVER +#define MULTI_SQL_DRIVERS +#else +#define SINGLE_SQL_DRIVER #endif +#endif #ifdef __USE_PGSQL__ - #ifdef SINGLE_SQL_DRIVER - #define MULTI_SQL_DRIVERS - #else - #define SINGLE_SQL_DRIVER - #endif +#ifdef SINGLE_SQL_DRIVER +#define MULTI_SQL_DRIVERS +#else +#define SINGLE_SQL_DRIVER #endif +#endif //Default sql driver #if !defined(SINGLE_SQL_DRIVER) && !defined(MULTI_SQL_DRIVERS) - #define __USE_SQLITE__ - #define SINGLE_SQL_DRIVER +#define __USE_SQLITE__ +#define SINGLE_SQL_DRIVER #endif -enum passwordType_t{ +enum passwordType_t +{ PASSWORD_TYPE_PLAIN = 0, PASSWORD_TYPE_MD5, PASSWORD_TYPE_SHA1 }; -#ifdef _WIN32 -# ifndef WIN32 -# define WIN32 -# endif +// Boost won't complain about non-working function +#define BOOST_ASIO_ENABLE_CANCELIO 1 + +#ifndef __FUNCTION__ +#define __FUNCTION__ __func__ #endif -#if defined __WINDOWS__ || defined WIN32 +#define xmake_str(str) #str +#define make_str(str) xmake_str(str) -#if defined _MSC_VER && defined NDEBUG -#define _SECURE_SCL 0 -#define HAS_ITERATOR_DEBUGGING 0 +/* + Compiler setup +*/ +#if defined __GNUC__ +#include "compiler/gcc.h" +#elif defined(_MSC_VER) +#include "compiler/msvc.h" #endif -#ifndef __FUNCTION__ - #define __FUNCTION__ __func__ +/* + If the compiler supports the upcoming standard, + call some of the useful headers. +*/ +#ifdef __OTSERV_CXX0X__ +#include +#include +#include +#else +#include "compiler/workarounds.h" #endif -#ifndef EWOULDBLOCK -#define EWOULDBLOCK WSAEWOULDBLOCK -#endif - #ifdef _WIN32_WINNT #undef _WIN32_WINNT #endif @@ -120,104 +106,9 @@ //Windows Xp 0x0501 //Windows 2003 0x0502 //Windows Vista 0x0600 +//Windows Seven 0x0601 #define _WIN32_WINNT 0x0501 -#ifdef __GNUC__ - #if __GNUC__ < 4 - #include - #include - #define OTSERV_HASH_MAP __gnu_cxx::hash_map - #define OTSERV_HASH_SET __gnu_cxx::hash_set - #else - #ifndef __GXX_EXPERIMENTAL_CXX0X__ - #include - #include - #else - // these only work, for some reason, with c++0x standard enabled - #include - #include - #endif - - #define OTSERV_HASH_MAP std::tr1::unordered_map - #define OTSERV_HASH_SET std::tr1::unordered_set - #endif - #include - #define ATOI64 atoll - -#else - - #ifndef NOMINMAX - #define NOMINMAX - #endif - - #include - #include - #include - #include - #include - - #define OTSERV_HASH_MAP stdext::hash_map - #define OTSERV_HASH_SET stdext::hash_set - - #include - inline int strcasecmp(const char *s1, const char *s2) - { - return ::_stricmp(s1, s2); - } - - inline int strncasecmp(const char *s1, const char *s2, size_t n) - { - return ::_strnicmp(s1, s2, n); - } - - typedef unsigned long long uint64_t; - typedef signed long long int64_t; - typedef unsigned long uint32_t; - typedef signed long int32_t; - typedef unsigned short uint16_t; - typedef signed short int16_t; - typedef unsigned char uint8_t; - typedef signed char int8_t; - - #define ATOI64 _atoi64 - - #pragma warning(disable:4786) // msvc too long debug names in stl - #pragma warning(disable:4250) // 'class1' : inherits 'class2::member' via dominance - #pragma warning(disable:4244) - #pragma warning(disable:4267) - #pragma warning(disable:4018) - -#endif - -//*nix systems -#else - #include - #include - #include - - #if __GNUC__ < 4 - #include - #include - #define OTSERV_HASH_MAP __gnu_cxx::hash_map - #define OTSERV_HASH_SET __gnu_cxx::hash_set - #else - #ifndef __GXX_EXPERIMENTAL_CXX0X__ - #include - #include - #else - // these only work, for some reason, with c++0x standard enabled - #include - #include - #endif - - #define OTSERV_HASH_MAP std::tr1::unordered_map - #define OTSERV_HASH_SET std::tr1::unordered_set - #endif - #define ATOI64 atoll - -#endif - - // OpenTibia configuration #ifndef __SKULLSYSTEM__ # ifndef __NO_SKULLSYSTEM__ @@ -225,4 +116,9 @@ # endif #endif +// Boost exception handling must be enabled +#ifdef BOOST_NO_EXCEPTIONS +#error "Boost exception handling must be enabled." +#endif + #endif \ No newline at end of file Index: house.cpp =================================================================== --- house.cpp (revision 35) +++ house.cpp (working copy) @@ -28,6 +28,7 @@ #include "town.h" #include "configmanager.h" #include "tools.h" + //[ added for beds system #include "beds.h" //] @@ -587,8 +588,14 @@ { uint32_t guildId; if(IOPlayer::instance()->getGuildIdByName(guildId, guildName)){ - if(guildId != 0 && guildList.find(guildId) == guildList.end()){ - guildList.insert(guildId); + if(guildId != 0){ + for(GuildList::iterator it = guildList.begin(); it != guildList.end(); ++it){ + if(it->first == guildId && boost::algorithm::iequals(rank, it->second)){ + return false; + } + } + + guildList.push_back(std::pair(guildId, rank)); return true; } } @@ -642,33 +649,35 @@ bool AccessList::isInList(const Player* player) { - RegExList::iterator it; - std::string name = player->getName(); - boost::cmatch what; + RegExList::iterator it; + std::string name = player->getName(); + boost::cmatch what; - std::transform(name.begin(), name.end(), name.begin(), tolower); - for(it = regExList.begin(); it != regExList.end(); ++it){ - if(boost::regex_match(name.c_str(), what, it->first)){ - if(it->second){ - return true; - } - else{ - return false; - } - } - } + std::transform(name.begin(), name.end(), name.begin(), tolower); + for(it = regExList.begin(); it != regExList.end(); ++it){ + if(boost::regex_match(name.c_str(), what, it->first)){ + if(it->second){ + return true; + } + else{ + return false; + } + } + } - PlayerList::iterator playerIt = playerList.find(player->getGUID()); - if(playerIt != playerList.end()) - return true; + PlayerList::iterator playerIt = playerList.find(player->getGUID()); + if(playerIt != playerList.end()) + return true; - GuildList::iterator guildIt = guildList.find(player->getGuildId()); - if(guildIt != guildList.end()) - return true; - - return false; + for(GuildList::iterator it = guildList.begin(); it != guildList.end(); ++it){ + if(it->first == player->getGuildId() && boost::algorithm::iequals(player->guildRank, it->second)){ + return true; } +} + return false; +} + void AccessList::getList(std::string& _list) const { _list = list; Index: house.h =================================================================== --- house.h (revision 35) +++ house.h (working copy) @@ -53,8 +53,8 @@ void getList(std::string& _list) const; private: - typedef OTSERV_HASH_SET PlayerList; - typedef OTSERV_HASH_SET GuildList; //TODO: include ranks + typedef std::unordered_set PlayerList; + typedef std::list< std::pair > GuildList; typedef std::list ExpressionList; typedef std::list > RegExList; Index: ioplayer.h =================================================================== --- ioplayer.h (revision 35) +++ ioplayer.h (working copy) @@ -92,8 +92,7 @@ { bool operator()(const std::string& l, const std::string& r) const { - return strcasecmp(l.c_str(), r.c_str()) < 0; - return true; + return asLowerCaseString(l).compare(asLowerCaseString(r)) < 0; } }; Index: items.cpp =================================================================== --- items.cpp (revision 35) +++ items.cpp (working copy) @@ -23,7 +23,7 @@ #include "spells.h" #include "condition.h" #include "weapons.h" - +#include #include #include @@ -684,7 +684,7 @@ it.slot_position |= SLOTP_BACKPACK; it.wield_position = SLOT_BACKPACK; } - else if(strcasecmp(strValue.c_str(), "two-handed") == 0){ + else if(asLowerCaseString(strValue) == "two-handed"){ it.slot_position |= SLOTP_TWO_HAND; it.wield_position = SLOT_HAND; } @@ -1378,19 +1378,28 @@ int32_t Items::getItemIdByName(const std::string& name) { - if(!name.empty()){ + if (!name.empty()) + { uint32_t i = 100; ItemType* iType; - do{ + + do + { iType = items.getElement(i); - if(iType){ - if(strcasecmp(name.c_str(), iType->name.c_str()) == 0){ + + if (iType) + { + if (boost::algorithm::iequals(name, iType->name)) + { return i; } } + i++; - }while(iType); + } + while (iType); } + return -1; } Index: luascript.h =================================================================== --- luascript.h (revision 35) +++ luascript.h (working copy) @@ -26,6 +26,7 @@ #include #include #include +#include extern "C" { Index: otpch.h =================================================================== --- otpch.h (revision 35) +++ otpch.h (working copy) @@ -1,10 +1,9 @@ #ifdef __OTSERV_OTCP_H__ #error "Precompiled header should only be included once" #endif + #define __OTSERV_OTCP_H__ -//#undef __USE_OTPCH__ - // Definitions should be global. #include "definitions.h" @@ -35,11 +34,12 @@ //lua extern "C" { - #include - #include - #include +#include +#include +#include } //otserv #include "thing.h" #endif + Index: otserv.cpp =================================================================== --- otserv.cpp (revision 35) +++ otserv.cpp (working copy) @@ -131,7 +131,9 @@ int main(int argc, char *argv[]) { - if(parseCommandLine(g_command_opts, std::vector(argv, argv + argc)) == false){ + // Set seed for rand() + std::srand((unsigned int)OTSYS_TIME()); + if(!parseCommandLine(g_command_opts, std::vector(argv, argv + argc))){ return 0; } @@ -246,6 +248,10 @@ #if defined __EXCEPTION_TRACER__ mainExceptionHandler.RemoveHandler(); #endif + // Don't run destructors, may hang! + std::exit(0); + + return 0; } bool parseCommandLine(CommandLineOptions& opts, std::vector args) Index: otsystem.h =================================================================== --- otsystem.h (revision 35) +++ otsystem.h (working copy) @@ -27,7 +27,8 @@ #include #include #include - + #include + typedef std::vector< std::pair > IPList; #ifdef __WINDOWS__ @@ -48,7 +49,7 @@ typedef int socklen_t; -#else // #if defined __WINDOWS__ + #else // __WINDOWS__ #include #include Index: player.cpp =================================================================== --- player.cpp (revision 35) +++ player.cpp (working copy) @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -3867,17 +3868,21 @@ bool Player::hasLearnedInstantSpell(const std::string& name) const { - if(hasFlag(PlayerFlag_CannotUseSpells)){ + if (hasFlag(PlayerFlag_CannotUseSpells)) + { return false; } - if(hasFlag(PlayerFlag_IgnoreSpellCheck)){ + if (hasFlag(PlayerFlag_IgnoreSpellCheck)) + { return true; } - for(LearnedInstantSpellList::const_iterator it = learnedInstantSpellList.begin(); - it != learnedInstantSpellList.end(); ++it){ - if(strcasecmp((*it).c_str(), name.c_str()) == 0){ + for (LearnedInstantSpellList::const_iterator it = learnedInstantSpellList.begin(); + it != learnedInstantSpellList.end(); ++it) + { + if (boost::algorithm::iequals((*it), name)) + { return true; } } Index: player.h =================================================================== --- player.h (revision 35) +++ player.h (working copy) @@ -178,7 +178,7 @@ int32_t getAccessLevel() const {return accessLevel;} uint32_t resetIdleTime() {return idleTime = 0;} - + std::string guildRank; void setVocation(uint32_t vocId); uint32_t getVocationId() const; @@ -716,7 +716,6 @@ //guild variables uint32_t guildId; std::string guildName; - std::string guildRank; std::string guildNick; uint32_t guildLevel; Index: raids.cpp =================================================================== --- raids.cpp (revision 35) +++ raids.cpp (working copy) @@ -25,6 +25,7 @@ #include "player.h" #include "configmanager.h" +#include #include #include @@ -212,8 +213,11 @@ Raid* Raids::getRaidByName(const std::string& name) { RaidList::iterator it; - for(it = raidList.begin(); it != raidList.end(); it++){ - if(strcasecmp((*it)->getName().c_str(), name.c_str()) == 0){ + + for (it = raidList.begin(); it != raidList.end(); ++it) + { + if (boost::algorithm::iequals((*it)->getName(), name)) + { return (*it); } } Index: scheduler.cpp =================================================================== --- scheduler.cpp (revision 35) +++ scheduler.cpp (working copy) @@ -41,7 +41,7 @@ ExceptionHandler schedulerExceptionHandler; schedulerExceptionHandler.InstallHandler(); #endif - srand((unsigned int)OTSYS_TIME()); + #ifdef __DEBUG_SCHEDULER__ std::cout << "Starting Scheduler" << std::endl; #endif Index: spells.cpp =================================================================== --- spells.cpp (revision 35) +++ spells.cpp (working copy) @@ -30,6 +30,7 @@ #include "configmanager.h" #include "const74.h" +#include #include #include @@ -187,7 +188,8 @@ RuneSpell* Spells::getRuneSpellByName(const std::string& name) { for(RunesMap::iterator it = runes.begin(); it != runes.end(); ++it){ - if(strcasecmp(it->second->getName().c_str(), name.c_str()) == 0){ + if (boost::algorithm::iequals(it->second->getName(), name)) + { return it->second; } } @@ -195,27 +197,34 @@ return NULL; } -InstantSpell* Spells::getInstantSpell(const std::string words) +InstantSpell* Spells::getInstantSpell(const std::string& words) { InstantSpell* result = NULL; - for(InstantsMap::iterator it = instants.begin(); it != instants.end(); ++it){ + + for (InstantsMap::iterator it = instants.begin(); it != instants.end(); ++it) + { InstantSpell* instantSpell = it->second; size_t spellLen = instantSpell->getWords().length(); - if(strncasecmp(instantSpell->getWords().c_str(), words.c_str(), spellLen) == 0){ - if(!result || spellLen > result->getWords().length()){ + if (asLowerCaseString(words).compare(0, spellLen, asLowerCaseString(instantSpell->getWords())) == 0) + { + if (!result || spellLen > result->getWords().length()) + { result = instantSpell; } } } - if(result){ - if(words.length() > result->getWords().length()){ + if (result) + { + if (words.length() > result->getWords().length()) + { size_t spellLen = result->getWords().length(); size_t paramLen = words.length() - spellLen; std::string paramText = words.substr(spellLen, paramLen); - if(paramText.substr(0, 1) != " " || (paramText.length() >= 2 && paramText.substr(0, 2) != " \"")){ + if (paramText.substr(0, 1) != " " || (paramText.length() >= 2 && paramText.substr(0, 2) != " \"")) + { return NULL; } } @@ -261,7 +270,8 @@ InstantSpell* Spells::getInstantSpellByName(const std::string& name) { for(InstantsMap::iterator it = instants.begin(); it != instants.end(); ++it){ - if(strcasecmp(it->second->getName().c_str(), name.c_str()) == 0){ + if (boost::algorithm::iequals(it->second->getName(), name)) + { return it->second; } } @@ -505,7 +515,8 @@ }; for(unsigned int i = 0; i < sizeof(reservedList)/sizeof(const char*); ++i){ - if(strcasecmp(reservedList[i], name.c_str()) == 0){ + if (boost::algorithm::iequals(reservedList[i], name.c_str())) + { std::cout << "Error: [Spell::configureSpell] Spell is using a reserved name: " << reservedList[i] << std::endl; return false; } Index: spells.h =================================================================== --- spells.h (revision 35) +++ spells.h (working copy) @@ -47,7 +47,7 @@ RuneSpell* getRuneSpell(uint32_t id); RuneSpell* getRuneSpellByName(const std::string& name); - InstantSpell* getInstantSpell(const std::string words); + InstantSpell* getInstantSpell(const std::string& words); InstantSpell* getInstantSpellByName(const std::string& name); uint32_t getInstantSpellCount(const Player* player); Index: status.cpp =================================================================== --- status.cpp (revision 35) +++ status.cpp (working copy) @@ -218,7 +218,7 @@ xml = ""; } - xmlFreeOTSERV(s); + xmlFree(s); xmlFreeDoc(doc); return xml; Index: talkaction.cpp =================================================================== --- talkaction.cpp (revision 35) +++ talkaction.cpp (working copy) @@ -26,6 +26,7 @@ #include #include +#include #include "talkaction.h" @@ -133,7 +134,8 @@ } else { continue; } - if(cmdstring == it->first || !it->second->isCaseSensitive() && strcasecmp(it->first.c_str(), cmdstring.c_str()) == 0){ + if (cmdstring == it->first || (!it->second->isCaseSensitive() && boost::algorithm::iequals(it->first, cmdstring))) + { TalkAction* talkAction = it->second; uint32_t ret = talkAction->executeSay(player, cmdstring, paramstring); if(ret == 1){ Index: tasks.cpp =================================================================== --- tasks.cpp (revision 35) +++ tasks.cpp (working copy) @@ -44,7 +44,7 @@ ExceptionHandler dispatcherExceptionHandler; dispatcherExceptionHandler.InstallHandler(); #endif - srand((unsigned int)OTSYS_TIME()); + #ifdef __DEBUG_SCHEDULER__ std::cout << "Starting Dispatcher" << std::endl; #endif Index: tools.cpp =================================================================== --- tools.cpp (revision 35) +++ tools.cpp (working copy) @@ -23,6 +23,7 @@ #include "definitions.h" #include "otsystem.h" #include "boost/asio.hpp" +#include #include "math.h" #include "tools.h" @@ -90,38 +91,29 @@ return s; } -bool readXMLInteger(xmlNodePtr node, const char* tag, int& value) +bool readXMLInteger(xmlNodePtr node, const char* tag, int32_t& value) { char* nodeValue = (char*)xmlGetProp(node, (xmlChar*)tag); - if(nodeValue){ + + if (nodeValue) + { value = atoi(nodeValue); - xmlFreeOTSERV(nodeValue); + xmlFree(nodeValue); return true; } return false; } -#if (defined __WINDOWS__ || defined WIN32) && !defined __GNUC__ -bool readXMLInteger(xmlNodePtr node, const char* tag, int32_t& value) -{ - char* nodeValue = (char*)xmlGetProp(node, (xmlChar*)tag); - if(nodeValue){ - value = atoi(nodeValue); - xmlFreeOTSERV(nodeValue); - return true; - } - return false; -} -#endif - bool readXMLInteger64(xmlNodePtr node, const char* tag, uint64_t& value) { char* nodeValue = (char*)xmlGetProp(node, (xmlChar*)tag); - if(nodeValue){ + + if (nodeValue) + { value = ATOI64(nodeValue); - xmlFreeOTSERV(nodeValue); + xmlFree(nodeValue); return true; } @@ -133,7 +125,7 @@ char* nodeValue = (char*)xmlGetProp(node, (xmlChar*)tag); if(nodeValue){ value = atof(nodeValue); - xmlFreeOTSERV(nodeValue); + xmlFree(nodeValue); return true; } @@ -175,7 +167,7 @@ value = nodeValue; } - xmlFreeOTSERV(nodeValue); + xmlFree(nodeValue); return true; } @@ -190,7 +182,7 @@ value = nodeValue; } - xmlFreeOTSERV(nodeValue); + xmlFree(nodeValue); return true; } @@ -572,7 +564,8 @@ MagicEffectClasses getMagicEffect(const std::string& strValue) { for(uint32_t i = 0; i < sizeof(magicEffectNames)/sizeof(MagicEffectNames); ++i){ - if(strcasecmp(strValue.c_str(), magicEffectNames[i].name) == 0){ + if (boost::algorithm::iequals(strValue.c_str(), magicEffectNames[i].name)) + { return magicEffectNames[i].effect; } } @@ -582,7 +575,8 @@ ShootType_t getShootType(const std::string& strValue) { for(uint32_t i = 0; i < sizeof(shootTypeNames)/sizeof(ShootTypeNames); ++i){ - if(strcasecmp(strValue.c_str(), shootTypeNames[i].name) == 0){ + if (boost::algorithm::iequals(strValue.c_str(), shootTypeNames[i].name)) + { return shootTypeNames[i].shoot; } } @@ -592,7 +586,8 @@ Ammo_t getAmmoType(const std::string& strValue) { for(uint32_t i = 0; i < sizeof(ammoTypeNames)/sizeof(AmmoTypeNames); ++i){ - if(strcasecmp(strValue.c_str(), ammoTypeNames[i].name) == 0){ + if (boost::algorithm::iequals(strValue.c_str(), ammoTypeNames[i].name)) + { return ammoTypeNames[i].ammoType; } } @@ -603,7 +598,8 @@ AmmoAction_t getAmmoAction(const std::string& strValue) { for(uint32_t i = 0; i < sizeof(ammoActionNames)/sizeof(AmmoActionNames); ++i){ - if(strcasecmp(strValue.c_str(), ammoActionNames[i].name) == 0){ + if (boost::algorithm::iequals(strValue.c_str(), ammoActionNames[i].name)) + { return ammoActionNames[i].ammoAction; } } Index: tools.h =================================================================== --- tools.h (revision 35) +++ tools.h (working copy) @@ -49,10 +49,7 @@ std::string asLowerCaseString(const std::string& source); std::string asUpperCaseString(const std::string& source); bool utf8ToLatin1(char* intext, std::string& outtext); -bool readXMLInteger(xmlNodePtr node, const char* tag, int& value); -#if (defined __WINDOWS__ || defined WIN32) && !defined __GNUC__ bool readXMLInteger(xmlNodePtr node, const char* tag, int32_t& value); -#endif bool readXMLInteger64(xmlNodePtr node, const char* tag, uint64_t& value); bool readXMLFloat(xmlNodePtr node, const char* tag, float& value); bool readXMLString(xmlNodePtr node, const char* tag, std::string& value); Index: town.h =================================================================== --- town.h (revision 35) +++ town.h (working copy) @@ -25,6 +25,7 @@ #include #include #include +#include #include "position.h" #include "definitions.h" @@ -77,11 +78,13 @@ Town* getTown(std::string& townname) { - for(TownMap::iterator it = townMap.begin(); it != townMap.end(); ++it){ - if(strcasecmp(it->second->getName().c_str(), townname.c_str()) == 0){ - return it->second; - } + for (TownMap::iterator it = townMap.begin(); it != townMap.end(); ++it) + { + if (boost::algorithm::iequals(it->second->getName(), townname)) + { + return it->second; } + } return NULL; } Index: vocation.cpp =================================================================== --- vocation.cpp (revision 35) +++ vocation.cpp (working copy) @@ -25,6 +25,7 @@ #include #include #include +#include #include "tools.h" @@ -180,7 +181,8 @@ int32_t Vocations::getVocationId(const std::string& name) { for(VocationsMap::iterator it = vocationsMap.begin(); it != vocationsMap.end(); ++it){ - if(strcasecmp(it->second->name.c_str(), name.c_str()) == 0){ + if (boost::algorithm::iequals(it->second->name, name)) + { return it->first; } } Index: waitlist.cpp =================================================================== --- waitlist.cpp (revision 35) +++ waitlist.cpp (working copy) @@ -21,6 +21,7 @@ #include #include +#include #include "waitlist.h" #include "status.h" @@ -39,8 +40,9 @@ { slot = 1; for(WaitListIterator it = waitList.begin(); it != waitList.end(); ++it){ - if((*it)->acc == player->getAccount() && (*it)->ip == player->getIP() && - strcasecmp((*it)->name.c_str(), player->getName().c_str()) == 0){ + if ((*it)->acc == player->getAccount() && (*it)->ip == player->getIP() && + boost::algorithm::iequals((*it)->name, player->getName())) + { return it; }