MrPrimate / ddb-proxy

MIT License
58 stars 51 forks source link

Campaigns broken #23

Closed ceriath closed 2 years ago

ceriath commented 2 years ago

Currently it is not possible to fetch a campaign via the proxy.

Proxy-Log:

Retrieving campaigns for <redacted>
Error retrieving campaigns
SyntaxError: Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at /srv/campaign.js:32:27
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
SyntaxError: Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at /srv/campaign.js:32:27
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

causing Console log:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'forEach')
[Detected 1 package: ddb-importer]
    at HTMLButtonElement.<anonymous> (Settings.js:373:1)
MrPrimate commented 2 years ago

This can happen sometimes, and the campaign API is susceptible to being marked as a bot. In my proxy I just remove it from service and replace the node. You can work around this manually by adding the campaign using the following:

game.settings.set("ddb-importer", "campaign-id", "ID_NUMBER_HERE");

You can get the ID from the campaign URL.

ceriath commented 2 years ago

Thank you! Unfortunately this did not fix the issue, it seems like Homebrew Monsters are still pulled from my own Collection and not the Campaign Owners Collection (I could import some test monster i created in my own collection without issues). Oh and sorry for the duplicate there, wasn't sure if it is related or not.

MrPrimate commented 2 years ago

It maybe that they might have to be in your collection to see them, rather than just in a campaign - do they show up for you in the DDB Encounter builder? (This is how the monsters are accessed)

ceriath commented 2 years ago

They don't show up there, so this is not really an issue with the campaign setting but with the way DnD Beyond handles shared content. Thanks a lot for the support!