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

Feat: Auto Kick on login #662

Merged

Conversation

RyanYappert
Copy link
Collaborator

Attempts to address 6008s with some RPC machinery.

  • Adds KickOnMultipleLogin, KickOnMultipleLoginTries, KickOnMultipleLoginTimer to the LoginServerSettings, fter NoOperationTimeOutTime. These default to false, 3, and 5000 (ms) respectively.
  • Adds a new column to GameServerList.csv: LoginId. This is the ID of the login server associated with this channel. The login server has to have some credentials for authenticating the internal RPC routes, so it piggybacks on the gameserver auth that it runs alongside. This may change in the future.
    • Make sure to update your GameServerList!!! Otherwise your server will not launch properly.
  • When logging in, if KickOnMultipleLogin is enabled, the login server attempts to kick any connected accounts that match the accountId that's joining. It'll do this KickOnMultipleLoginTries times, waiting KickOnMultipleLoginTimer milliseconds between each attempt. Only after failing the maximum number of times will it return the usual 6008 error.
    • Note that the client has limited patience, so the number of attempts and time between attempts should be small enough such that the client doesn't consider the login failed. At the same time, it must be long enough so that the other GameServers have enough time to actually handle the RPC command, which involves a DB lookup.

Checklist:

  • The project compiles
  • The PR targets develop branch

@@ -8,7 +8,10 @@ public class LoginServerSetting
[DataMember(Order = 1)] public ServerSetting ServerSetting { get; set; }
[DataMember(Order = 90)] public bool AccountRequired { get; set; }
[DataMember(Order = 105)] public uint NoOperationTimeOutTime { get; set; }

[DataMember(Order = 110)] public bool KickOnMultipleLogin { get; set; }
[DataMember(Order = 111)] public int KickOnMultipleLoginTries { get; set; }
Copy link
Collaborator

@pacampbell pacampbell Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make these nullable like I did with the modifier settings (so we can assign defaults for existing files)? The way our settings file works, it only generates new fields if the file doesn't exist. If it exists and the field is not present, it doesn't assign the default values we have in this file. Instead, it assigns the type default values (like 0 and false).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a slightly different solution that doesn't require changing how we reference settings because of nullability.

…oute since its not really a packet. Move some Rpc machinery to Shared so it can be called from the Login Server. Add setting to have the login server request the game server to kick clients on 6008.
@RyanYappert RyanYappert force-pushed the feat/auto-kick-on-login branch from 4f3ba4b to fa92b01 Compare December 20, 2024 19:28
@RyanYappert RyanYappert merged commit 4ae8eed into sebastian-heinz:develop Dec 20, 2024
1 check passed
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.

2 participants