rocketcrab icon indicating copy to clipboard operation
rocketcrab copied to clipboard

All Bad Cards

Open tannerkrewson opened this issue 5 years ago • 6 comments

@jakelauer

With this code, users will end up in the same all bad cards room, but will have some weird errors and the game won't work. 🤔 ❤️

tannerkrewson avatar Sep 13 '20 20:09 tannerkrewson

I just spent like half an hour looking for your messages to tell you that there's now a way to create a game in ABC from an external URL You can do so by hitting https://allbad.cards/api/abc/external-create and providing the following via queryString:

isHost (boolean) userName (string) roomId (string)

if isHost is false, the user will join the game otherwise, they will create a new game

the request to create the game must come from the host's browser, because it sets a cookie that ensures that the game knows they are the game's owner

tannerkrewson avatar Jan 23 '21 14:01 tannerkrewson

~~Currently, iirc rocketcrab can't support making the api call from the hosts browser. but there may be a to do it anyways, and this is likely a situation it should support. Looking into it now ...~~

tannerkrewson avatar Jan 23 '21 14:01 tannerkrewson

Ok, I deleted this branch and pushed up a second attempt. I think the host is creating the game correctly with url call that looks like

https://allbad.cards/api/abc/external-create?rocketcrab=true&userName=Jake&isHost=true&roomId=rocketcrab-62557bb8c0a4b752

but when the other players attempt to navigate to

https://allbad.cards/api/abc/external-create?rocketcrab=true&userName=Tanner&isHost=false&roomId=external-room-rocketcrab-62557bb8c0a4b752

they get Game not found: undefined. It says that whether the external-room- is prepended or not. 🤔

tannerkrewson avatar Jan 24 '21 17:01 tannerkrewson

Good catch - there was a bug upon joining a created game, which should be fixed now!

jakelauer avatar Jan 25 '21 20:01 jakelauer

Hey Jake, sorry for the delay again, I was focused on Drawphone.

So I've added all three of your games in that last commit. The url from before didn't seem to be working, so I removed the abc/ and it creates the game, but both the host and the guest see a "Join Game" button. The host's gives an error, and the guest's works, but they have to enter a username, which should be provided by the url.

Let me know if you need any more info. The recent changes to the your site look really nice, Good work!!!! 😄

tannerkrewson avatar Feb 21 '21 21:02 tannerkrewson

is this fixed? i havent checked, yet so apologies if it is. looking to get these new games merged soon. ive been putting it off for long enough!!

tannerkrewson avatar Apr 26 '21 03:04 tannerkrewson