diff --git a/modules/client_entergame/entergame.lua b/modules/client_entergame/entergame.lua index 2d76c78114..1800241476 100644 --- a/modules/client_entergame/entergame.lua +++ b/modules/client_entergame/entergame.lua @@ -401,8 +401,16 @@ function EnterGame.tryHttpLogin(clientVersion) onCharacterList(nil, characters, account) end - local host, path = G.host:match("([^/]+)/([^/]+)") - HTTP.post(host .. ':' .. G.port .. '/' .. path, + local host, path = G.host:match("([^/]+)/([^/].*)") + local url = G.host + + if G.port ~= nil and path ~= nil then + url = host .. ':' .. G.port .. '/' .. path + elseif path ~= nil then + url = host .. '/' .. path + end + + HTTP.post(url, json.encode({ email = G.account, password = G.password, @@ -453,7 +461,7 @@ function EnterGame.doLogin() g_settings.set('client-version', clientVersion) if clientVersion >= 1281 and G.port ~= 7171 then - if G.port == nil or G.port == 0 then + if G.port == 0 then G.port = 80 end