Explicitly use toLowerAscii for filenames and identifiers

ryzomclassic-develop
kaetemi 4 years ago
parent 625d269c11
commit 29f313853d

@ -586,7 +586,7 @@ void CGroupNpc::addParameter(std::string const& parameter)
std::string key, tail;
// force lowercase
std::string p = NLMISC::toLower(parameter);
std::string p = NLMISC::toLowerAscii(parameter);
AI_SHARE::stringToKeywordAndTail(p, key, tail);
breakable

@ -187,7 +187,7 @@ public:
/// Store mapping 'name:variant' -> squad to be used later by getSquadByVariantName()
void registerSquadVariant(const std::string& nameAndVariant, CGroupDesc<COutpostSquadFamily> *squad )
{
if ( ! _SquadVariantNameToGroupDesc.insert( std::make_pair( NLMISC::toLower( nameAndVariant ), squad ) ).second )
if ( ! _SquadVariantNameToGroupDesc.insert( std::make_pair( NLMISC::toLowerAscii( nameAndVariant ), squad ) ).second )
nlwarning( "Duplicate squad template / squad variant '%s'", nameAndVariant.c_str() );
}
@ -200,7 +200,7 @@ public:
/// Get a squad by name:variant (works only during primitive parsing), or NULL if not found. Not case-sensitive.
CGroupDesc<COutpostSquadFamily> *getSquadByVariantName(const std::string& nameAndVariant)
{
std::map<std::string, NLMISC::CSmartPtr< CGroupDesc<COutpostSquadFamily> > >::iterator it = _SquadVariantNameToGroupDesc.find( NLMISC::toLower( nameAndVariant ) );
std::map<std::string, NLMISC::CSmartPtr< CGroupDesc<COutpostSquadFamily> > >::iterator it = _SquadVariantNameToGroupDesc.find( NLMISC::toLowerAscii( nameAndVariant ) );
if ( it != _SquadVariantNameToGroupDesc.end() )
return (*it).second;
else

@ -648,7 +648,7 @@ DEFINE_ACTION_TEMPLATE1(ContextOutpostGroupDesc,GT_GPRM,FamilyT)
string param;
args[i].get(param);
param = NLMISC::toLower(param);
param = NLMISC::toLowerAscii(param);
if ( param == "contact camp"
|| param == "contact outpost"

@ -1053,7 +1053,7 @@ DEFINE_ACTION_TEMPLATE1(ContextGroupDesc,GT_GPRM,FamilyT)
std::string param;
args[i].get(param);
param = NLMISC::toLower(param);
param = NLMISC::toLowerAscii(param);
if ( param == "contact camp"
|| param == "contact outpost"

@ -38,6 +38,7 @@
#include "nel/misc/algo.h"
#include "nel/misc/sstring.h"
#include "nel/misc/i18n.h"
#include "nel/misc/string_view.h"
#include "nel/net/admin.h"
#include "nel/net/service.h"
@ -4493,24 +4494,25 @@ NLMISC_COMMAND (connectUserChannel, "Connect to user channels", "<user id> <chan
CPVPManager2 *inst = CPVPManager2::getInstance();
string pass;
string name = toLower(args[1]);
TChanID channel = inst->getUserDynChannel(name);
string name = args[1];
string nameLwr = toCaseInsensitive(args[1]);
TChanID channel = inst->getUserDynChannel(nameLwr);
if (args.size() < 3)
pass = toLower(name);
pass = nameLwr;
else
pass = args[2];
if ( (channel == DYN_CHAT_INVALID_CHAN) && (pass != string("*")) && (pass != string("***")) )
channel = inst->createUserChannel(name, pass);
if ( (channel == DYN_CHAT_INVALID_CHAN) && (pass != nlstr("*")) && (pass != nlstr("***")) )
channel = inst->createUserChannel(nameLwr, pass);
if (channel != DYN_CHAT_INVALID_CHAN)
{
string channelPass = inst->getPassUserChannel(channel);
if ( (channel != DYN_CHAT_INVALID_CHAN) && (pass == string("***")) && (c->havePriv(":DEV:") || c->havePriv(":SGM:") || c->havePriv(":GM:") || c->havePriv(":EM:")))
if ( (channel != DYN_CHAT_INVALID_CHAN) && (pass == nlstr("***")) && (c->havePriv(":DEV:") || c->havePriv(":SGM:") || c->havePriv(":GM:") || c->havePriv(":EM:")))
{
inst->deleteUserChannel(name);
inst->deleteUserChannel(nameLwr);
}
else if (channelPass == pass)
{
@ -4521,7 +4523,7 @@ NLMISC_COMMAND (connectUserChannel, "Connect to user channels", "<user id> <chan
}
inst->addFactionChannelToCharacter(channel, c, true, true);
}
else if (pass == string("*"))
else if (pass == nlstr("*"))
{
inst->removeFactionChannelForCharacter(channel, c, true);
}
@ -4529,7 +4531,7 @@ NLMISC_COMMAND (connectUserChannel, "Connect to user channels", "<user id> <chan
{
SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal);
params[0].Literal = name;
CCharacter::sendDynamicSystemMessage( eid, "EGS_CHANNEL_NO_RIGHTS", params );
CCharacter::sendDynamicSystemMessage( eid, nlstr("EGS_CHANNEL_NO_RIGHTS"), params );
}
return true;
@ -4537,7 +4539,7 @@ NLMISC_COMMAND (connectUserChannel, "Connect to user channels", "<user id> <chan
SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal);
params[0].Literal = name;
CCharacter::sendDynamicSystemMessage( eid, "EGS_CHANNEL_INVALID_NAME", params );
CCharacter::sendDynamicSystemMessage( eid, nlstr("EGS_CHANNEL_INVALID_NAME"), params );
return false;
}
@ -6704,9 +6706,9 @@ ENTITY_VARIABLE (FullPVP, "Full Pvp Mode")
}
else
{
if (value=="1" || value=="on" || toLower(value)=="pvp" || toLower(value)=="true" )
if (value=="1" || value=="on" || toLowerAscii(value)=="pvp" || toLowerAscii(value)=="true" )
c->setFullPVP(true);
else if (value=="0" || value=="off" || toLower(value)=="false" )
else if (value=="0" || value=="off" || toLowerAscii(value)=="false" )
c->setFullPVP(false);
// c->setPVPRecentActionFlag();
CPVPManager2::getInstance()->setPVPModeInMirror(c);

@ -39,7 +39,7 @@ void CFameTrend::init()
for (i=0; i<3; ++i)
{
_StrTable[TFameTrendConvert[i].Value] = TFameTrendConvert[i].Name;
_ValueMap[NLMISC::toLower(std::string(TFameTrendConvert[i].Name))] = TFameTrendConvert[i].Value;
_ValueMap[NLMISC::toLowerAscii(std::string(TFameTrendConvert[i].Name))] = TFameTrendConvert[i].Value;
}
_Initialised = true;
}

@ -43,7 +43,7 @@ inline CFameTrend::TFameTrend CFameTrend::fromString(const std::string& v)
{
return Unknown;
}
const std::map<std::string, TFameTrend>::const_iterator it = _ValueMap.find(NLMISC::toLower(v));
const std::map<std::string, TFameTrend>::const_iterator it = _ValueMap.find(NLMISC::toLowerAscii(v));
if (it == _ValueMap.end())
{
nlwarning("TFameTrend::toString(): string '%s' is not matched, 'Unknown' enum value returned", v.c_str());

@ -856,7 +856,7 @@ void CGuildManager::createGuildStep2(uint32 guildId, const ucstring &guildName,
/// end current bot chat
proxy.endBotChat();
proxy.updateTarget();
_ExistingGuildNames.insert( NLMISC::toLower( guild->getName().toString() ) );
_ExistingGuildNames.insert( NLMISC::toCaseInsensitive( guild->getName().toUtf8() ) );
// ask the client to open it's guild interface
PlayerManager.sendImpulseToClient( proxy.getId(),"GUILD:OPEN_GUILD_WINDOW" );
@ -903,7 +903,7 @@ void CGuildManager::deleteGuild(uint32 id)
CStatDB::getInstance()->removeGuild(id);
}
_ExistingGuildNames.erase( NLMISC::toLower( guild->getName().toString() ) );
_ExistingGuildNames.erase( NLMISC::toCaseInsensitive( guild->getName().toUtf8() ) );
guild->unregisterGuild();
if (!guild->isProxy())
@ -1423,7 +1423,7 @@ void CGuildManager::registerGuildAfterLoading(CGuild *guildToRegister)
// _GuildsAwaitingString.insert( make_pair( str, guildToRegister->getId() ) );
// }
_ExistingGuildNames.insert( NLMISC::toLower( guildToRegister->getName().toString() ) );
_ExistingGuildNames.insert( NLMISC::toCaseInsensitive( guildToRegister->getName().toUtf8() ) );
}
}
@ -1477,7 +1477,7 @@ bool CGuildManager::checkGuildStrings(CGuildCharProxy & proxy,const ucstring & n
return false;
}
// check if name already exists in the guild list
if ( _ExistingGuildNames.find( NLMISC::toLower( name.toString() ) ) != _ExistingGuildNames.end() )
if ( _ExistingGuildNames.find( NLMISC::toCaseInsensitive( name.toUtf8() ) ) != _ExistingGuildNames.end() )
{
proxy.sendSystemMessage("GUILD_NAME_ALREADY_EXISTS");
return false;
@ -1491,6 +1491,7 @@ bool CGuildManager::checkGuildStrings(CGuildCharProxy & proxy,const ucstring & n
return false;
}
// FIXME: Allow unicode guild names https://github.com/kaetemi/ryzomclassic/issues/187
if ( !isalpha(name[0]) || !isalpha(name[name.size()-1]) )
{
proxy.sendSystemMessage("GUILD_NAME_BAD_CHAR");
@ -1512,6 +1513,7 @@ bool CGuildManager::checkGuildStrings(CGuildCharProxy & proxy,const ucstring & n
else
{
prevBlank = false;
// FIXME: Allow unicode guild names https://github.com/kaetemi/ryzomclassic/issues/187
if (!isalpha (name[i]))
{
proxy.sendSystemMessage("GUILD_NAME_BAD_CHAR");

@ -2726,8 +2726,8 @@ class CMissionActionFailMissionCat : public IMissionAction
MISLOGSYNTAXERROR("<mission_category>");
return false;
}
_MissionCategory = NLMISC::toLower(CMissionParser::getNoBlankString(script[1]));
if (NLMISC::toLower(missionData.Template->MissionCategory) == _MissionCategory)
_MissionCategory = NLMISC::toLowerAscii(CMissionParser::getNoBlankString(script[1]));
if (NLMISC::toLowerAscii(missionData.Template->MissionCategory) == _MissionCategory)
{
MISLOGERROR1("a mission cannot make fail its own category '%s'", _MissionCategory.c_str());
return false;
@ -2762,7 +2762,7 @@ class CMissionActionFailMissionCat : public IMissionAction
pMissTemplate = pMM->getTemplate(pMiss->getTemplateId());
if (pMissTemplate != NULL)
{
if (NLMISC::toLower(pMissTemplate->MissionCategory) == _MissionCategory)
if (NLMISC::toLowerAscii(pMissTemplate->MissionCategory) == _MissionCategory)
{
pMiss->onFailure(true, false);
bFailed = true;
@ -2775,7 +2775,7 @@ class CMissionActionFailMissionCat : public IMissionAction
pMissTemplate = pMM->getTemplate(pMiss->getMainMissionTemplateId());
if (pMissTemplate != NULL)
{
if (NLMISC::toLower(pMissTemplate->MissionCategory) == _MissionCategory)
if (NLMISC::toLowerAscii(pMissTemplate->MissionCategory) == _MissionCategory)
pMiss->onFailure(true, false);
}
}

@ -55,10 +55,10 @@ public:
_Modifier1 = modifier1;
_Modifier2 = modifier2;
if( NLMISC::toLower(_DefenseMode) == "dodge" )
if( NLMISC::toLowerAscii(_DefenseMode) == "dodge" )
_PowerType = POWERS::ModDodgeSkill;
else
if( NLMISC::toLower(_DefenseMode) == "parry" )
if( NLMISC::toLowerAscii(_DefenseMode) == "parry" )
_PowerType = POWERS::ModParrySkill;
else
_PowerType = POWERS::ModDefenseSkill;

@ -2489,8 +2489,7 @@ static void mailNotification(const std::string& to, const std::string& from)
return;
// first, build a valid character (upper case first, then lower case);
ucstring ucCharname = toLower(to); // lower case
ucCharname[0] = toUpper(ucCharname[0]); // first upper case
ucstring ucCharname = ucstring::makeFromUtf8(capitalize(to));
// second, get char id that matches the name
CEntityId charId = NLMISC::CEntityIdTranslator::getInstance()->getByEntity(ucCharname);

@ -85,7 +85,7 @@ bool CStringManager::CParameterTraits::eval(CStringManager::TLanguages lang,cons
}
uint32 stringId = ew.getStringId(rowIndex, colIndex);
std::string str = NLMISC::toLower(SM->getString(stringId).toString());
std::string str = NLMISC::toLowerAscii(SM->getString(stringId).toString());
LOG("SM : (paramTraits) eval condition for property %s [%s] %s [%s]", cond.Property.c_str(), str.c_str(), OperatorNames[cond.Operator], cond.ReferenceStr.c_str());
@ -583,11 +583,11 @@ public:
std::string op1;
if (cond.Property == "name")
{
op1 = NLMISC::toLower(si.SheetName);
op1 = NLMISC::toLowerAscii(si.SheetName);
}
else if (cond.Property == "gender")
{
op1 = NLMISC::toLower(GSGENDER::toString(si.Gender));
op1 = NLMISC::toLowerAscii(GSGENDER::toString(si.Gender));
}
else
{
@ -984,7 +984,7 @@ public:
return false;
}
const CStringManager::TSheetInfo &si = SM->getSheetInfo(sheetId);
op1 = NLMISC::toLower(si.SheetName);
op1 = NLMISC::toLowerAscii(si.SheetName);
}
else if (cond.Property == "gender")
{
@ -994,7 +994,7 @@ public:
nlwarning("Could not find character info for EId %s to check property %s", EId.toString().c_str(), cond.Property.c_str());
return false;
}
op1 = NLMISC::toLower(GSGENDER::toString(charInfo->getGender()));
op1 = NLMISC::toLowerAscii(GSGENDER::toString(charInfo->getGender()));
}
else
{
@ -1080,14 +1080,14 @@ public:
}
else if (cond.Property == "role")
{
op1 = NLMISC::toLower(si.ChatProfile);
op1 = NLMISC::toLowerAscii(si.ChatProfile);
}
else if (cond.Property == "title")
{
// we need to retrieve the charInfo
CCharacterInfos *ci = IOS->getCharInfos(EId);
if (ci != NULL)
op1 = NLMISC::toLower(ci->Title);
op1 = NLMISC::toLowerAscii(ci->Title);
else
{
nlwarning("No character info for bot %s, can't test property 'title' !", EId.toString().c_str());
@ -1453,11 +1453,11 @@ public:
// check if checked property is gender or name
if (cond.Property == "gender")
{
value = NLMISC::toLower(GSGENDER::toString(charInfo->getGender()));
value = NLMISC::toLowerAscii(GSGENDER::toString(charInfo->getGender()));
}
else if (cond.Property == "name")
{
value = NLMISC::toLower(charInfo->ShortName.toString());
value = NLMISC::toLowerAscii(charInfo->ShortName.toString());
}
else
{

@ -912,7 +912,7 @@ uint32 CStringManager::translateTitle(const std::string &title, TLanguages lang
{
const std::string colName("name");
const CStringManager::CEntityWords &ew = getEntityWords(language, STRING_MANAGER::title);
std::string rowName = NLMISC::toLower(title);
std::string rowName = NLMISC::toLowerAscii(title);
uint32 stringId;
stringId = ew.getStringId(rowName, colName);
@ -1198,7 +1198,7 @@ NLMISC_CATEGORISED_COMMAND(stringmanager, mergeWordFile, "Merge a word file into
return false;
std::string lang = args[0];
std::string word = toLower(args[1]);
std::string word = toLowerAscii(args[1]);
std::string file = args[2];
// get language
@ -1215,7 +1215,7 @@ NLMISC_CATEGORISED_COMMAND(stringmanager, mergeWordFile, "Merge a word file into
uint i;
for (i=0; i<typeNames.size(); ++i)
{
if (toLower(typeNames[i].second) == word)
if (toLowerAscii(typeNames[i].second) == word)
{
wordType = typeNames[i].first;
break;
@ -1260,7 +1260,7 @@ NLMISC_CATEGORISED_COMMAND(stringmanager, displayEntityWords, "display entity wo
return false;
std::string lang = args[0];
std::string word = toLower(args[1]);
std::string word = toLowerAscii(args[1]);
std::string wc;
if (args.size() == 3)
@ -1280,7 +1280,7 @@ NLMISC_CATEGORISED_COMMAND(stringmanager, displayEntityWords, "display entity wo
uint i;
for (i=0; i<typeNames.size(); ++i)
{
if (toLower(typeNames[i].second) == word)
if (toLowerAscii(typeNames[i].second) == word)
{
wordType = typeNames[i].first;
break;

@ -436,7 +436,7 @@ CStringManager::CEntityWords CStringManager::parseEntityWords(const ucstring &st
for (i=1; i<ws.size(); ++i)
{
// on the first col, we uncapitalize the id
ws.setData(i, 0, ucstring(NLMISC::toLower(ws.getData(i, 0).toString())));
ws.setData(i, 0, ucstring(NLMISC::toLowerAscii(ws.getData(i, 0).toString())));
ew._RowInfo.insert(make_pair(ws.getData(i, 0).toString(), i-1));
for (uint j=0; j<ws.ColCount; ++j)
@ -810,7 +810,7 @@ bool CStringManager::parseTag(const CPhrase &phrase, const ucstring &tag, TRepla
nlwarning("Error reading tag property in the tag [%s]", tag.toString().c_str());
return false;
}
spec = NLMISC::toLower(spec);
spec = NLMISC::toLowerAscii(spec);
}
else
spec = "name";
@ -1106,7 +1106,7 @@ bool CStringManager::parseParamList(ucstring::const_iterator &it, ucstring::cons
nlwarning("Error parsing parameter %u type in param list", count);
return false;
}
type = NLMISC::toLower(type);
type = NLMISC::toLowerAscii(type);
NLMISC::CI18N::skipWhiteSpace(it, last);
if (!NLMISC::CI18N::parseLabel(it, last, name))
@ -1543,12 +1543,12 @@ void CStringManager::setEntityWord(const std::string& path, const ucstring& valu
if ((end = path.find('.', start)) == string::npos)
return;
string lang = toLower(path.substr(start, end-start));
string lang = toLowerAscii(path.substr(start, end-start));
start = end+1;
if ((end = path.find('.', start)) == string::npos)
return;
string wordentity = toLower(path.substr(start, end-start));
string wordentity = toLowerAscii(path.substr(start, end-start));
start = end+1;
if ((end = path.find('.', start)) == string::npos)
@ -1559,14 +1559,14 @@ void CStringManager::setEntityWord(const std::string& path, const ucstring& valu
string det = path.substr(start);
TLanguages language = checkLanguageCode(lang);
if (toLower(getLanguageCodeString(language)) != lang)
if (toLowerAscii(getLanguageCodeString(language)) != lang)
return;
TParameterTraitList typeNames = CParameterTraits::getParameterTraitsNames();
uint i;
for (i=0; i<typeNames.size(); ++i)
if (toLower(typeNames[i].second) == wordentity)
if (toLowerAscii(typeNames[i].second) == wordentity)
break;
if (i >= typeNames.size())

@ -602,7 +602,7 @@ NLMISC_CATEGORISED_COMMAND(pd_log, displayTableDescription,
useFile = logpath + args[2];
}
std::string tableName = toLower(args[1]);
std::string tableName = toLowerAscii(args[1]);
CDBDescriptionParser desc;
if (!desc.loadDescriptionFile(logpath + useFile))
@ -612,7 +612,7 @@ NLMISC_CATEGORISED_COMMAND(pd_log, displayTableDescription,
uint i;
for (i=0; i<db.Tables.size(); ++i)
if (toLower(db.Tables[i].Name) == tableName)
if (toLowerAscii(db.Tables[i].Name) == tableName)
break;
if (i == db.Tables.size())

@ -98,7 +98,7 @@ void CHoFGenerator::serviceUpdate()
{
const string & fileName = files[i];
if (toLower(CFile::getExtension(fileName)) == "hdt")
if (toLowerAscii(CFile::getExtension(fileName)) == "hdt")
{
_HDTFiles.push_back(fileName);
}

@ -207,7 +207,7 @@ void CMailForumService::checkFile(const std::string& file)
string getUserDirectory(uint32 shardid, const string& userName)
{
string un = toLower(CMailForumValidator::nameToFile(userName));
string un = toCaseInsensitive(CMailForumValidator::nameToFile(userName));
string dir = CPath::standardizePath(WebRootDirectory)+toString(shardid)+"/"+un.substr(0, 2)+"/"+un+"/";
@ -222,7 +222,7 @@ string getUserDirectory(uint32 shardid, const string& userName)
string getGuildDirectory(uint32 shardid, const string &guildName)
{
string un = toLower(CMailForumValidator::nameToFile(guildName));
string un = toCaseInsensitive(CMailForumValidator::nameToFile(guildName));
string dir = CPath::standardizePath(WebRootDirectory)+toString(shardid)+"/"+un.substr(0, 2)+"/"+un+"/";

@ -35,7 +35,7 @@ CPDStringMapper::CPDStringMapper()
*/
void CPDStringMapper::setMapping(const std::string& str, uint32 id)
{
std::string lowMapStr = NLMISC::toLower(str);
std::string lowMapStr = NLMISC::toLowerAscii(str);
TStringMap::iterator its;
TIdMap::iterator iti = _IdMap.find(id);

@ -106,7 +106,7 @@ inline const std::string& CPDStringMapper::getString(uint32 id) const
*/
inline uint32 CPDStringMapper::getId(const std::string& str) const
{
std::string lowMapStr = NLMISC::toLower(str);
std::string lowMapStr = NLMISC::toLowerAscii(str);
TStringMap::const_iterator it = _StringMap.find(lowMapStr);
return (it == _StringMap.end()) ? UnknownString : (*it).second;

@ -115,7 +115,7 @@ namespace ENTITYLOC
struct TCharInfo
{
TShardId ShardId;
ucstring CharName;
std::string CharName;
};
typedef map<TModuleProxyPtr, TShardId> TLocatorClient;
@ -134,7 +134,7 @@ namespace ENTITYLOC
// current connected character
TCharMap _ConnectedChars;
typedef CHashMap<ucstring, TCharId, CUCStringHashMapTraits> TCharNameMap;
typedef CHashMap<std::string, TCharId> TCharNameMap;
// Index of connected character by name
TCharNameMap _ConnectedCharsByName;
@ -285,7 +285,7 @@ namespace ENTITYLOC
TCharMap::iterator next = first;
++next;
// erase the name mapping
_ConnectedCharsByName.erase(toLower(first->second.CharName));
_ConnectedCharsByName.erase(toCaseInsensitive(first->second.CharName));
// erase the connected char info
_ConnectedChars.erase(first);
// add it to the (dis)connection event list
@ -394,7 +394,7 @@ namespace ENTITYLOC
NLNET::IModuleProxy *getLocatorModuleForChar(const ucstring &charName)
{
TCharNameMap::iterator it(_ConnectedCharsByName.find(toLower(charName)));
TCharNameMap::iterator it(_ConnectedCharsByName.find(toCaseInsensitive(charName.toUtf8()))); // FIXME: UTF-8
if (it == _ConnectedCharsByName.end())
{
// not online
@ -411,7 +411,7 @@ namespace ENTITYLOC
uint32 getShardIdForChar(const ucstring &charName)
{
TCharNameMap::iterator it(_ConnectedCharsByName.find(toLower(charName)));
TCharNameMap::iterator it(_ConnectedCharsByName.find(toCaseInsensitive(charName.toUtf8()))); // FIXME: UTF-8
if (it == _ConnectedCharsByName.end())
{
// not online
@ -447,7 +447,7 @@ namespace ENTITYLOC
void onCharacterNameUpdated(uint32 charId, const std::string &oldName, const std::string &newName)
{
// lookup this char in online players map
TCharNameMap::iterator it(_ConnectedCharsByName.find(toLower(oldName)));
TCharNameMap::iterator it(_ConnectedCharsByName.find(toCaseInsensitive(oldName)));
if (it != _ConnectedCharsByName.end())
{
@ -455,7 +455,7 @@ namespace ENTITYLOC
nlassert(charId == it->second);
_ConnectedCharsByName.erase(it);
_ConnectedCharsByName.insert(make_pair(toLower(newName), charId));
_ConnectedCharsByName.insert(make_pair(toCaseInsensitive(newName), charId));
}
}
@ -617,7 +617,7 @@ namespace ENTITYLOC
_ConnectedChars.insert(make_pair(charId, ci));
// store char by name info
_ConnectedCharsByName.insert(make_pair(toLower(ci.CharName), charId));
_ConnectedCharsByName.insert(make_pair(toCaseInsensitive(ci.CharName), charId));
}
// load the nel user to read privileges
@ -683,7 +683,7 @@ namespace ENTITYLOC
else
{
// erase the information
_ConnectedCharsByName.erase(toLower(it->second.CharName));
_ConnectedCharsByName.erase(toCaseInsensitive(it->second.CharName));
_ConnectedChars.erase(it);
}
@ -887,7 +887,7 @@ namespace ENTITYLOC
{
log.displayNL(" Character %u '%s' [%u:%u] connected on shard %u",
first->first,
first->second.CharName.toUtf8().c_str(),
first->second.CharName.c_str(),
first->first>>4,
first->first&0xf,
first->second.ShardId);

@ -584,7 +584,7 @@ namespace RSMGR
for (uint i=0; i<userAccessPriv.size(); ++i)
{
string access("ds_");
access += toLower(userAccessPriv[i]);
access += toLowerAscii(userAccessPriv[i]);
if (accessLevel.toString() == access)
return true;
@ -1983,7 +1983,7 @@ endOfWelcomeUserResult:
// check the permission of the player
for (uint i=0; i<userAccessPriv.size(); ++i)
{
if (_DontUsePerm || string("ds_")+toLower(userAccessPriv[i]) == shard->getRequiredState().toString())
if (_DontUsePerm || string("ds_")+toLowerAscii(userAccessPriv[i]) == shard->getRequiredState().toString())
{
// ok, this one is accessible
// this server is better (i.e had less player in it)
@ -4323,7 +4323,7 @@ endOfWelcomeUserResult:
}
}
TAccessLevel al = string("ds_")+toLower(args[1]);
TAccessLevel al = string("ds_")+toLowerAscii(args[1]);
if (al == TAccessLevel::invalid_val)
{
log.displayNL("Invalid access state '%s'", args[1].c_str());

Loading…
Cancel
Save