Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TEST] network relogin #2809

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

gmriggs
Copy link
Collaborator

@gmriggs gmriggs commented Mar 12, 2020

Repro steps:

  • In your Config.js, set DefaultSessionTimeout to 999 for easier testing
  • In your log4net.config, set the Console threshold to DEBUG for easier testing
  • Connect to your local server in ThwargLauncher advanced mode. Make sure your server name in ThwargLauncher does NOT match up with your local server name, so that if ThwargLauncher is left open, it automatically disconnects you in ~30s
  • Log into the game world
  • Wait for ThwargLauncher to automatically close the AC window
  • Try to reconnect

Expected:

  • Existing character is booted out of the game world

Actual:

  • Existing character is never booted out of the game world. New session cannot connect.

There are some odd issues with this PR, namely if you try this multiple times, the existing Player state will get into an odd loop, where the Session is disconnected, but the Player is still saving on the landblock or something..

This can be seen after multiple retries, or using /pktimer sometimes helps. The previous session will go into 'SessionTerminating' state, and then be dropped, while the previous player still seems to be in the world. This allows the new session to connect to the char select screen, but then gets into an automatic loop when trying to log into the world, until the existing player is finally logged out.

Could use @fartwhif 's help on this one

@gmriggs
Copy link
Collaborator Author

gmriggs commented Mar 14, 2020

Update:

With 71c27fe , I am still able to repro the 'client repeatedly tries to log into world very rapidly' bug using a new set of repro steps:

  • Start server
  • Log into server via thwarg launcher. Close thwarg launcher window so that it doesn't automatically close the ac window
  • Open thwarg launcher again
  • Set /pktimer on char still logged into world
  • Log in again with thwarg launcher, WITHOUT closing the original acclient window

At this point, since ThwargLauncher will be connecting on a new port, it will get a new session, instead of the existing one. So the new session won't be in 'WorldConnected' state, so it won't hit any of that logic

It will however, hit this logic in AuthenticationHandler, on line 176:

                if (PropertyManager.GetBool("account_login_boots_in_use").Item)
                {
                    var previouslyConnectedAccount = NetworkManager.Find(account.AccountName);

                    if (previouslyConnectedAccount != null)
                    {
                        previouslyConnectedAccount.Terminate(SessionTerminationReason.AccountLoggedIn, new GameMessageCharacterError(CharacterError.Logon));
                    }
                }

Thinking maybe this logic should be moved to NetworkManager.LoginRequest perhaps?

@gmriggs
Copy link
Collaborator Author

gmriggs commented Mar 14, 2020

With the revised implementation in 593cc5f, the previous bug is fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant