Closed 46bit closed 7 years ago
The way I was imagining it is we don't decide which player is which by name, but by name/secret pair.
So we could have SimpleAI/hunter2 and SimpleAI/password, for example.
Thoughts?
Suggestions:
"The genuine player could not use that player name": given shared code, wanting to play multiple copies of an AI against each other, etc., I'd imagine that name collisions need to be handled more broadly. I'd suggest a mechanism whereby the server can override names. So, if SimpleAI
is already connected, another player trying to connect as SimpleAI
gets SimpleAI (1)
or something. Or maybe embed the thesaurus entry for "impostor", and use that before falling back to numbers. In the case of names which can be authenticated, you'd automatically be overridden unless you provided a secret.
"A disclosed secret can never be changed": Exactly how many of these are you expecting to run? There will probably be a fairly small set of players, of which even fewer will encounter this issue. Why not just fix it manually if it happens?
@qlkzy's suggestions have a lot of merit. Here's my plan: do something like what he suggests, and if anyone wants to set a secret
value they can get one set out-of-band.
Player names are right-padded with _
until unique.
secret
for now or do a very basic manually-set implementation.
As of https://github.com/sirpent-team/sirpent-rust/commit/684f32fa923cf2399822453edc912a903c604562,
Player.secret
is nowCommand::Hello.secret
:Players can provide a secret string, that (once set) must be provided with each connection of a player of that name.
This approach has major caveats.
As such I feel like this nice-and-simple authentication model may have more downsides than previously recognised by myself.