gcs icon indicating copy to clipboard operation
gcs copied to clipboard

Discussion on tighter integration with Foundry

Open crnormand opened this issue 3 years ago • 7 comments

I just recently implemented a feature that uses XMLHttpRequest to get the XML data... and that got me thinking. You said that GCS is running a socket listener/web server?

How hard would it be to create a service (ex: /export/) that runs a defined export (which would be set in system property) but instead of writing to a file, it writes to the http response to the service request?

I am trying to make this VTT system agnostic. I guess you could define different subservices, each with a different export script.

/export/foundry -> Foundry VTT /export/FG -> Fantasy Grounds...

But for the first implementation, I think a single service -> export script would be good enough. At least, if we make a system property, other applications could use this functionality... if they cared.

Then, in Foundry, we could register the URL for their GCS and the user could re-import with a simple button press.

  1. It would be easiest if we still require a manual file export/import for the initial creation of the character, but subsequent updates could just be a button press.
  2. We could not easily "send" from GCS... which I don't think is that bad.
  3. Thinking about it... the GCS URL would probably be specific to each Actor... since you might have a situation where each player is running their own GCS and actively updating from it.... but in any case, we could have a 'default' GCS URL (probably the GM's).

Thoughts?

crnormand avatar Apr 12 '21 04:04 crnormand

Yes, this should be easily doable and can be attached to the existing web server that I already run for PDF support. I'm about to make a bug fix release tonight... but can look at adding this soon.

richardwilkes avatar Apr 12 '21 04:04 richardwilkes

Cool. Next question... could you also build a service that just serves up files?

I'm thinking of GCA users. We could tell them that they can also bypass the Foundry Import Dialog if they install and run GCS and export their GCA characters to some well known (or configurable) location.

Then, hopefully, they decide to create their next character in GCS and save the step... 😀

Obviously, not as cool as the first feature... but it extends an olive branch to those poor folks that have been stuck in the 80's for so long.

crnormand avatar Apr 12 '21 05:04 crnormand

In the next release, GCS now emits extra data into its file format, such that all of the info that you needed the export templates for should now be in the file itself. You should be able to just directly load the .gcs file. It is json, which is natively supported in Javascript. This will cut out the need to do an export at all.

richardwilkes avatar May 14 '21 02:05 richardwilkes

Does it emit the fully calculated values? We don't really care for the intermediate calculations (since I don't want to do any calculations in Foundry).

So if the .gcs file will now also contain the final skill levels, etc., then yes, this is definitely something I will look into... after the Items code... and the Foundry 0.8.x migration... and the .... well, you get the picture ;-)

crnormand avatar May 14 '21 03:05 crnormand

Yes, pre-calculated, final, values. Each place that has them has a calc node with keys underneath for whatever it was that was left out in the old code because it could be calculated (and not read by GCS in the new code when loading).

richardwilkes avatar May 14 '21 03:05 richardwilkes

A GCS usable in Foundry? I would LOVE THAT!

Tarrith avatar Jul 28 '21 12:07 Tarrith

It is definitely on our list to do for Foundry. We have a few other big things we want to build but reading GCS files directly will be one of them. At that point, it would be easier for GCS to serve up the files (since it wouldn't have to do any other processing, like "export") so I expect this feature would wait until then.

crnormand avatar Jul 28 '21 16:07 crnormand

I don't believe there is interest in GCS providing a REST API any longer, so I'm closing this out. Should that change, feel free to open a new issue and outline the specific things you'd like to see from it.

richardwilkes avatar Nov 06 '22 00:11 richardwilkes