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

Support multiplayer mode #30

Open
p3r7 opened this issue Jul 31, 2020 · 4 comments
Open

Support multiplayer mode #30

p3r7 opened this issue Jul 31, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@p3r7
Copy link
Member

p3r7 commented Jul 31, 2020

Seems pretty easy to do: just an hardcoded scenario-id different than the one for single player.

But how to connect with other known users?

Also, should we prompt user every time or assume single player and enable multiplayer w/ a cli option?

@p3r7 p3r7 added the enhancement New feature or request label Jul 31, 2020
@p3r7 p3r7 mentioned this issue Jul 31, 2020
@mkualquiera
Copy link

mkualquiera commented Jul 31, 2020

My library supports multiplayer, but it's not really documented...
The general idea is, create the adventure as usual from a multiplayer scenario id, obtain the public adventure id and share it with other players.
Then, there is a query

mutation ($adventurePlayPublicId: String) {
    addUserToAdventure(adventurePlayPublicId: $adventurePlayPublicId)
}

to add the current user to add it to the adventure. The query returns an adventure content id that can be used as usual.

In my library this is implemented here and there is also this client function to connect to a public adventure (it does the transaction required automatically)

@akvadrako
Copy link

If you want to connect to an existing adventure it's also possible to do:

    api_client = AiDungeonApiClient()
    api_client.adventure_id = 'adventure:31914999'

    ai_dungeon = AiDungeonGame(api_client, conf, io)
    ai_dungeon.login()
    ai_dungeon.start_game()

@p3r7
Copy link
Member Author

p3r7 commented Aug 12, 2020

Thanks for the input both of you.

I've just added cli options capabilities (w/ argparse) which was a prerequisite for this feature.

Indeed, I guess we'd enable precising the (existing) adventure_id with a command line argument.

@p3r7
Copy link
Member Author

p3r7 commented Aug 18, 2020

Basic implem with only support for public adventure id: 493a45a

I'll do some code cleanup before tagging.

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

No branches or pull requests

3 participants