Fixed: Encode password in hexadecimal on command-line when patching to avoid invalid characters

--HG--
branch : develop
This commit is contained in:
kervala 2017-12-02 16:46:17 +01:00
parent d799dde5ad
commit 7b2b0c9310
2 changed files with 15 additions and 1 deletions
code/ryzom/client/src

View file

@ -205,6 +205,19 @@ int main(int argc, char **argv)
{
LoginPassword = Args.getAdditionalArg("password").front();
// password in hexadecimal
if (LoginPassword.compare(0, 2, "0x") == 0)
{
std::string decodedPassword;
// decode password
if (fromHexa(LoginPassword.substr(2), decodedPassword))
{
// only use it if real hexadecimal
LoginPassword = decodedPassword;
}
}
if (Args.haveAdditionalArg("shard_id"))
sLoginShardId = Args.getAdditionalArg("shard_id").front();
}

View file

@ -1036,7 +1036,8 @@ void CPatchManager::executeBatchFile()
if (!LoginPassword.empty())
{
arguments.push_back(LoginPassword);
// encode password in hexadecimal to avoid invalid characters on command-line
arguments.push_back("0x" + toHexa(LoginPassword));
if (!r2Mode)
{