Changed: If only login is passed as parameter, neither use auto login nor alt login

This commit is contained in:
kervala 2016-04-02 19:08:13 +02:00
parent 587804cab7
commit a355fb9b2a
2 changed files with 14 additions and 10 deletions

View file

@ -190,14 +190,18 @@ int main(int argc, char **argv)
// no shard id in ring mode // no shard id in ring mode
std::string sLoginShardId; std::string sLoginShardId;
if (Args.haveAdditionalArg("login") && Args.haveAdditionalArg("password")) if (Args.haveAdditionalArg("login"))
{ {
LoginLogin = Args.getAdditionalArg("login").front(); LoginLogin = Args.getAdditionalArg("login").front();
if (Args.haveAdditionalArg("password"))
{
LoginPassword = Args.getAdditionalArg("password").front(); LoginPassword = Args.getAdditionalArg("password").front();
if (Args.haveAdditionalArg("shard_id")) if (Args.haveAdditionalArg("shard_id"))
sLoginShardId = Args.getAdditionalArg("shard_id").front(); sLoginShardId = Args.getAdditionalArg("shard_id").front();
} }
}
if (sLoginShardId.empty() || !fromString(sLoginShardId, LoginShardId)) if (sLoginShardId.empty() || !fromString(sLoginShardId, LoginShardId))
LoginShardId = std::numeric_limits<uint32>::max(); LoginShardId = std::numeric_limits<uint32>::max();

View file

@ -246,22 +246,22 @@ void CLoginStateMachine::run()
if (!ClientCfg.TestBrowser) if (!ClientCfg.TestBrowser)
{ {
if (LoginLogin.empty()) if (LoginPassword.empty())
{ {
if (LoginCustomParameters.empty()) if (!LoginCustomParameters.empty() && LoginLogin.empty())
{ {
// standard procedure // alternate login procedure
SM_BEGIN_EVENT_TABLE SM_BEGIN_EVENT_TABLE
SM_EVENT(ev_init_done, st_login); SM_EVENT(ev_init_done, st_alt_login);
SM_EVENT(ev_skip_all_login, st_ingame); SM_EVENT(ev_skip_all_login, st_ingame);
SM_EVENT(ev_quit, st_end); SM_EVENT(ev_quit, st_end);
SM_END_EVENT_TABLE SM_END_EVENT_TABLE
} }
else else
{ {
// alternate login procedure // standard procedure
SM_BEGIN_EVENT_TABLE SM_BEGIN_EVENT_TABLE
SM_EVENT(ev_init_done, st_alt_login); SM_EVENT(ev_init_done, st_login);
SM_EVENT(ev_skip_all_login, st_ingame); SM_EVENT(ev_skip_all_login, st_ingame);
SM_EVENT(ev_quit, st_end); SM_EVENT(ev_quit, st_end);
SM_END_EVENT_TABLE SM_END_EVENT_TABLE