-
Notifications
You must be signed in to change notification settings - Fork 395
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
Cardcast replacement #241
base: master
Are you sure you want to change the base?
Cardcast replacement #241
Conversation
Four commands are now available (could be changed to buttons):
I've intentionally kept the Cardcast JSON format to allow for some kind of retro-compatibility if someone had downloaded his decks. The main two problems are:
We could easy cache the URLs, but not the JSON. I was thinking to use some digest like MD5 to check if we already have the exact same content, or maybe that's not even that useful. My app would probably benefit from this as I'd allow the user to create custom decks without uploading them. |
I've removed the two add commands and added some buttons in the game options. I am going to make a better list of the custom sets so that commands are not needed anymore (this way we don't have to show the user the deck id which is just a number). The hash method is not working reliably for caching because of newlines and formatting stuff so we need an alternative to identify if two decks are identical. We would need to parse the content and then compute the hash after it has been "normalized" (something like https://github.com/fraunhoferfokus/JSum) which is a bit more expensive in terms of computing, but I don't think it'll be an issue. I was also thinking that we probably don't need the server to fetch URLs, we could let the user send the JSON (fetching on the client). The only downside is that of the hash mentioned above. @ajanata Let me know what you think. |
Daily update... I've fixed the caching issue with bencode. I've added some UI elements to list the custom decks and allow to remove them with a button press. I'd say this is almost complete. |
…eplacement # Conflicts: # src/main/java/net/socialgamer/cah/CahModule.java # src/main/java/net/socialgamer/cah/cardcast/CardcastModule.java # src/main/java/net/socialgamer/cah/data/Game.java
@@ -70,7 +69,7 @@ | |||
*/ | |||
private static final long VALID_SET_CACHE_LIFETIME = TimeUnit.MINUTES.toMillis(15); | |||
|
|||
private static final AtomicInteger cardIdCounter = new AtomicInteger(-(GameOptions.MAX_BLANK_CARD_LIMIT + 1)); | |||
private static final AtomicInteger cardIdCounter = new AtomicInteger(Integer.MIN_VALUE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to change this to count from the bottom up because the number of blank cards can be changed with the server running.
@ajanata Have you been able to take a look at this? |
@Tibladar It's fine on 1600x900 and 1920x1080, but I suppose I can address in some way. |
Should be good now. |
a converter from xyzzy metrics csv format to this json format:
script in |
Getting this error whenever I'm trying to upload a JSON deck. |
@silverkey5 Can you post the URL or JSON you tried to use? |
{ { I've also tried uploading this to a URL, but when I used the /addurl command it said it was an invalid command |
@silverkey5 The watermark must be all uppercase. |
{ } It still returns the same error message |
It must also be 5 characters long. |
...im just dumb lol thank you so much! |
Any update on this? |
This PR aims to replace the functionality provided by the dead CardCast website. See #240
Play with custom decks at https://pyx.gianlu.xyz/ZY/.
TODO:
JSON template: