ajanata / PretendYoureXyzzy

A web clone of the card game Cards Against Humanity.
https://pretendyoure.xyz/zy
BSD 2-Clause "Simplified" License
1.22k stars 397 forks source link

Cardcast deck code should be returned #171

Closed devgianlu closed 6 years ago

devgianlu commented 6 years ago

When using the CardcastListCardsetsHandler, the Cardcast deck code isn't returned which is a shame. Returning the code would make this much more useful and could allow a user to remove a deck without knowing the code by heart.

ajanata commented 6 years ago

The ID is definitely in the data returned from that endpoint:

[4:47:21 PM] The following Cardcast decks are in use in this game (instructions): 
[4:47:21 PM] You have joined the game. 
[4:47:44 PM] Added: Cardcast deck 'Final Fantasy XIV' (code: K2BYG), with 64 black cards and 216 white cards. 
[4:47:47 PM] The following Cardcast decks are in use in this game (instructions): 
[4:47:47 PM] In use: Cardcast deck 'Final Fantasy XIV' (code: K2BYG), with 64 black cards and 216 white cards. 

It's being returned to the client as a negative integer (to be distinct from local card decks which are positive integers). The client then has to negate it again, and convert it to base 36. Yes, this is not orthogonal with how decks are added... Internally, deck IDs had to be numbers, and this was the easiest way to do it.

Please re-open this if I'm misunderstanding your request.

devgianlu commented 6 years ago

Ohhh, got it. I was so convinced it was casual that I didn't even check.