Skip to content

Commit

Permalink
Add debug info to try and debug people who have connection issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
Beherith committed Jun 18, 2024
1 parent d43c899 commit 8806b81
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions LuaMenu/widgets/gui_login_window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ local wantLoginStatus = {
["disconnected"] = true,
}

local function GetNewLoginWindow(failFunc)
local function GetNewLoginWindow(failFunc, callerInfo)
if currentLoginWindow and currentLoginWindow.window then
currentLoginWindow.window:Dispose()
currentLoginWindow = nil
end
local Configuration = WG.Chobby.Configuration
local steamMode = Configuration.canAuthenticateWithSteam and Configuration.wantAuthenticateWithSteam
Spring.Echo("steamMode", Configuration.canAuthenticateWithSteam, Configuration.wantAuthenticateWithSteam)
Spring.Echo("GetNewLoginWindow:caller", callerInfo)
emailRequired = (WG.Server.protocol == "spring")
if steamMode then
currentLoginWindow = WG.Chobby.SteamLoginWindow(failFunc, nil, "main_window")
Expand Down Expand Up @@ -175,7 +175,7 @@ local function InitializeListeners()
end

if not (currentLoginWindow and currentLoginWindow.window) then
local loginWindow = GetNewLoginWindow()
local loginWindow = GetNewLoginWindow(nil, "OnLoginDenied:" .. tostring(err))
local popup = WG.Chobby.PriorityPopup(loginWindow.window, loginWindow.CancelFunc, loginWindow.AcceptFunc)
end
end
Expand Down Expand Up @@ -244,9 +244,10 @@ function LoginWindowHandler.QueueRegister(name, password, email)
end

function LoginWindowHandler.TryLoginMultiplayer(name, password)
Spring.Echo("LoginWindowHandler.TryLoginMultiplayer",name, password)
if wantLoginStatus[lobby:GetConnectionStatus()] then
if (not TrySimpleSteamLogin()) and (not TrySimpleLogin()) then
local loginWindow = GetNewLoginWindow(MultiplayerFailFunction)
local loginWindow = GetNewLoginWindow(MultiplayerFailFunction, "LoginWindowHandler:TryLoginMultiplayer")
local popup = WG.Chobby.PriorityPopup(loginWindow.window, loginWindow.CancelFunc, loginWindow.AcceptFunc)
end
end
Expand All @@ -255,7 +256,7 @@ end
function LoginWindowHandler.TryLogin(newLoginAcceptedFunction)
loginAcceptedFunction = newLoginAcceptedFunction
if not TrySimpleSteamLogin() then
local loginWindow = GetNewLoginWindow()
local loginWindow = GetNewLoginWindow(nil, "LoginWindowHandler:TryLogin")
local popup = WG.Chobby.PriorityPopup(loginWindow.window, loginWindow.CancelFunc, loginWindow.AcceptFunc)
end
end
Expand Down

0 comments on commit 8806b81

Please sign in to comment.