question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow custom decks via JSON [Feature request]

See original GitHub issue

Since CardCast has shut down and (as of time of writing) api.cardcastgame.com returns NXDOMAIN, there is currently no easy way to add custom decks other than importing them into the database. To avoid reliance on third parties in the future, adding custom decks via URL in JSON format could be a way to achieve this:

/addcardcast <deck code> is replaced by /addurl <url>, where <url> is a link to a hosted JSON file (or an API that returns JSON for that deck). The format of the JSON could be similar to Cardcast’s to aid compatibility, although finding documentation on that is harder now.

Obviously for some servers the ability to load these files is a concern, so I propose an option (perhaps in build.properties) firstly to allow/disallow this feature, and later on to whitelist certain domains.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:14
  • Comments:12 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
devgianlucommented, May 16, 2020

That is a fantastic idea, I can write a PR if @ajanata will merge it.

The shutdown of Cardcast removed a key feature in my app and having a way to create custom decks directly on the phone would be awesome.

0reactions
BrozzSamacommented, Oct 31, 2020

@devgianlu I don’t know what the future plans are for #241 if it still going to be developed might good to implement the solution of having the system identify cards with “___” in order to have compatibility with CRCAST JSON format, as @ajanata already suggested. For the time being it could be useful to provide a helper script in your branch like the one I posted below that converts CRCAST decks into PYX compatible json, since it seems like there is no “official” way to do this as of right now.

import json
from re import split

in_file = 'input.json'
out_file = 'output.json'

with open(in_file) as json_in:
    data = json.load(json_in)

data['watermark'] = data['deckcode']
data['responses'] = data['whites']
data['calls'] = data['blacks']
del data['deckcode']
del data['blacks']
del data['whites']

for response in data['responses']:
    response['text'] = [response['text']]

for call in data['calls']:
    if '_' in call['text']:
        call['text'] = split(r'_+', call['text'])
    # No fill? No problem.
    else:
        call['text'] = [ call['text'], '' ]

with open(out_file, 'w') as json_out:
    json.dump(data, json_out)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Create your own vocabulary courses with Custom Decks
Learning a new language? Custom Decks is a feature that allows you to turn any text into a vocabulary course.
Read more >
How I Add Variant Decks to Tabletop Simulator
In Windows, you can do this by finding the game in your Steam library, right-clicking and choosing Properties > Local Files > Browse...
Read more >
GeoJSONLayer | Sample Code | ArcGIS API for JavaScript 4.25
The GeoJSONLayer allows you to add features from a GeoJSON file ... This sample shows how to add an instance of GeoJSONLayer to...
Read more >
An Exploration of JSON Interoperability Vulnerabilities
In this research, I conducted a survey of 49 JSON parsers, ... Let's suppose the Cart service receives a request like this (note...
Read more >
MVTLayer - deck.gl
This layer also handles feature clipping so that there are no features divided by ... It allows to balance the requests across different...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found