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

Don't require /take if a user logs in w/ an ID same as player name during pregame. #1599

Open
jwrober opened this issue Dec 12, 2022 · 2 comments
Labels
enhancement New feature or request gui This issue requires changes to the user interface server This issue requires changes to the server
Milestone

Comments

@jwrober
Copy link
Collaborator

jwrober commented Dec 12, 2022

Is your feature request related to a problem? Please describe.
It either shouldn't be necessary to /take your nation when first connecting to a game, or it should be clearly documented that you need to do so. It causes unnecessary confusion.

Describe the solution you'd like
As mentioned, either make it super obvious you need to take your nation during pregame for LT online games or (the better choice) make it so that client and server detect that the user ID that has connected matches one in the players list and automatically connects, just like it does after a /take command is issues on subsequent connections.

Obviously if a player connects w/ a user ID that does not match (e.g. taking an idler) then /take will still be necessary. Same with a regent logging in.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Discord convo: https://discord.com/channels/378908274113904641/1010150995843625040/1042063542406369300

@jwrober jwrober added enhancement New feature or request gui This issue requires changes to the user interface server This issue requires changes to the server labels Dec 12, 2022
@jwrober jwrober added this to the v3.1-stable milestone Dec 13, 2022
@lmoureaux
Copy link
Contributor

We could issue a /take from the client automatically if the username matches the player name. I think in some cases it's not desirable, such as when checking the timeout when coming back from vacation (i.e. connect and do /timeoutshow while detached). Also, in single player a user calling himself Napoleon could have trouble playing a game against a French AI if the client would do /take Napoleon...

We could extend the /take command to allow assigning upcoming connections based on their username. The main issue with this solution is the auth support API (aka fcdb). The script takes a connection object as parameter, which lets it use not only the username but also the IP address. So we'd need a change to this API. We currently do not use the IP address part of the connection.

A third solution would be a generic (fcdb?) Lua hook that would run when a player connects and can issue /take automatically. This moves the above complexity to customizable Lua scripts. Executing privileged server commands right from Lua has been in the back of my mind for some time now.

@lmoureaux
Copy link
Contributor

Coming back to this, I think the best solution is a new fcdb hook (fcdb_assign_player?) that returns the player to assign to, or nil to not assign.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request gui This issue requires changes to the user interface server This issue requires changes to the server
Projects
None yet
Development

No branches or pull requests

2 participants