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

Ask username from launcher and send to client #21

Open
poirierlouis opened this issue Nov 25, 2024 · 10 comments
Open

Ask username from launcher and send to client #21

poirierlouis opened this issue Nov 25, 2024 · 10 comments
Labels
client enhancement New feature or request launcher

Comments

@poirierlouis
Copy link
Collaborator

It should probably look like this:

  • add text field to ask username from main view of Launcher
  • store username locally like game_path
  • send username to client, maybe using flag --username ${username}
  • parse/get username and use it in client

Let me know if you thought about a different solution.

@poirierlouis poirierlouis changed the title Ask username from Launcher and forward to client Ask username from launcher and send to client Nov 25, 2024
@poirierlouis poirierlouis added the enhancement New feature or request label Nov 25, 2024
@maximegmd
Copy link
Member

The way we do things in HogWarp is the launcher requires authentication with discord, then on the master server side a ticket is created that the client sends to the game server which is used to retrieve the username from the master server.

A form of authentication is probably required so that ever owners can create allow/block lists and ban offending users.

@poirierlouis
Copy link
Collaborator Author

Could two authentication mechanisms be used?

  • username/password
  • Discord

Discord auth makes sense regarding UX, but a simple pair of credentials can be convenient for simple installation and during development workflow... wdyt?

@maximegmd
Copy link
Member

The problem with having a username/password system is we need to host a database and manage a backend to store credentials, is this additional cost and complexity worth it now?

@poirierlouis
Copy link
Collaborator Author

That is something I'd be willing to implement. Well in my mind I'm thinking of adding a webapp endpoint for admins to monitor server state. A database would be nice eventually to have, it could be used to store states like player's stats/inventory/spawn location/chat/phone messages... what ever.
So database could expect a player account and allow two facades, simple pair of credentials or Discord.

@maximegmd
Copy link
Member

So you would have user/pass on the game server? This will be problematic:

  1. It requires server owners to setup a way to create accounts, so likely their own website
  2. From the launcher users would have to enter their credentials for a specific game server
  3. They would only know if they logged it correctly once they try to connect in game

@poirierlouis
Copy link
Collaborator Author

  1. That could be covered by the webapp endpoint I was talking (which means front + back office).
  2. and 3. imo current implementation is not the best UX but I guess this is mandatory due to Overwolf? I did implement a nice UI on my own MP attempt a while back. It asks for IP/Port/username/password in main menu, player fill it, and then it starts a game (StartWorld) and join the server at the same time... I can probably install it again to show a screenshot of how it looks like. Is it possible to move the server list/connect stuff out of the launcher to in-game main menu?

Hum with Discord, wouldn't it be the same for 2. and 3. ?

Well thinking about it, I guess what you have in mind is:

  1. Player starts launcher
  2. Pick server to connect to
  3. Game is launched
  4. Load a save
  5. Press key to 'Connect to the server'
  6. Discord API does the magic with the server automatically? Or would that happen somewhere between 1 and 3 ?

@maximegmd
Copy link
Member

Moving server selection in game isn't possible, mods are already loaded at this point. The benefit of having the server list before launching the game is we can install/enable/disable the required mods.

As for discord, they would just login in the launcher and the token retrieved from the discord api can be passed to the client which sends it to the game server, which will use it to retrieve the username etc from the discord API.

I am a bit opposed to having username/password per server, we are already hating on EA/Ubisoft etc for doing this when you buy a game on Steam, a mod doing it feels even worse/overkill.

One option could be to have multiple OAuth providers, Discord, Steam, Google for example that people can use to authenticate.

@maximegmd
Copy link
Member

There is always the option also to allow players to play on servers that do not require authentication at all, join a server and then the server has custom scripts that ask for username/password if someone really wants to worry about that.

@poirierlouis
Copy link
Collaborator Author

Alright. Yes different OAuth providers would be good, starting with Discord at least. Does it require some paid account for example to use the Discord API, or create a Discord server, setup some keys and it is ready? If you happen to know already...

As for discord, they would just login in the launcher and the token retrieved from the discord api can be passed to the client which sends it to the game server, which will use it to retrieve the username etc from the discord API.

Looks fine to me, though in the end having a database for other purposes I mention could be nice to have, and bound to player's account based on OAuth provider right?

@maximegmd
Copy link
Member

Oh sure yeah, but database should be managed by plugins, I don't think we should enforce a default database that everyone then has to use. Given that there is a .NET SDK, it's fairly simple to use any kind of db (mongo, maria, postgre...).

The user's unique identifier can be passed to the plugins when the player joins so they can retrieve information etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client enhancement New feature or request launcher
Projects
None yet
Development

No branches or pull requests

2 participants