colin353 / mushu-new

0 stars 1 forks source link

Allow creating different games #69

Closed iteloo closed 6 years ago

colin353 commented 6 years ago

Should we do this from Elm, or should we do this from a static HTML page which redirects to the Elm app page once a game is selected? I was thinking to do it in a static page, but I'm not really sure.

iteloo commented 6 years ago

Doing it on the Elm Page seems most natural. Are you worried the WS library will act unexpectedly?

Le 8 févr. 2018 à 11:12, Colin Merkel notifications@github.com a écrit :

Should we do this from Elm, or should we do this from a static HTML page which redirects to the Elm app page once a game is selected? I was thinking to do it in a static page, but I'm not really sure.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

colin353 commented 6 years ago

I don't really know, maybe it's better to do it that way. I guess you have to wrap the entire game state somehow, so you can select a game and then start it?

By the way, you can easily implement this without server side changes. If you want to join a game with a particular name, just specify ?game=xyz in the websocket request. It will create if it doesn't exist, or else join.

The server also supports automatically generating a game name for you, but you'll have to implement a randomized GenerateGameName here:

https://github.com/colin353/mushu-new/blob/15d5d9107ad560129850018d01d3b309a7fc723e/server/server.go#L37

iteloo commented 6 years ago

Yes, we wrap the currently top-level model inside another union type.