Open derammo opened 6 years ago
PS: Note the linked commit includes changing the Ruby version to <2.4.0, I just did that so I can run on MacOS, but it has nothing to do with this feature idea at all. So please just ignore that part.
PPS: Just noticed some of the code in import is broken in that commit (magic items getting overwritten,) but you get the idea. It is fixed in the next commit. It works either way.
Hrm, I don't hate it. What's the advantage of this route over, say, token authentication with a JSON API?
Roll20 plugins run in a sealed sandbox and cannot open network connections. So they cannot call the JSON API. However, they CAN display a clickable link in the Roll20 chat and have the user click on it to originate a web request. It displays a warning message that it will open in a new tab and that you can close the new tab to go back to roll20, which is actually very nice. I still need to verify that enormous URLs are allowed in that context, actually.
So far, the main part I don't like is that the query string format is dependent on your application's schema, so when that changes, the integration breaks. You'd have to define a new query string format instead of using the one that you get for free, if you wanted to avoid this problem. It's probably fine though. If it fails, it fails reasonably harmlessly.
By the way, I can prototype the Roll20 side for this to make sure it works with giant URLs, unless someone with more Roll20 API Plugin experience speaks up. I have written a pretty complicated one before, but not with an "interactive" UI like some of the plugins use (I used command-line style.)
Regarding giant URLs, we could obviously shorten it a lot by renaming or removing the "character_log_entry" scope in the original request (restoring it before internal redirect from CharacterLogImportsController)
update: there isn't a decent rewards management plugin that I would use as a client, so I am writing my own (Roll20 API plugin.)
@Ariel-Thomas I would like to move forward with this feature in the next month or so, if that is acceptable to you? I could certainly use help to do it better (like the 'select which character' part that I have not prototyped.) If you want to help, but at another time that is more convenient, then please let me know.
update: I wrote a plugin for Roll20 that is a comprehensive rewards and log entry client. It is able to kick out a complete log entry as a query string and it imports correctly into my local test server. I have not written the "pick a character" dialog on the server side because I am not great at Rails.
Roll20 UI (sexy huh?):
Roll20 plugin is the 'rewards' plugin located here: https://github.com/derammo/der20
I ported the majority of the code required to recent master branch and put it into https://github.com/derammo/adventurers-league-log/tree/log_import_by_query_2
I did not create a pull request because it is missing some functionality.
Would an easier/cleaner solution to this be having the DM fill out their DM logsheet entry, and then having a "share with players" link, which would then, using a (limited life?) hash/token, let players pre-populate a new entry based on the relevant data from the DM's entry?
This would keep the entirety of the functionality outside Roll20, where you would simply share the link with your players. Just a thought as I stumbled back into GH this afternoon.
thats already there using campaigns pretty much, so I would say it is certainly sane :) but it is very much an outside-the-game solution and requires adventurersleaguelog.com
my solution is not assuming people use adventurersleaguelog at all, because some players in the community prefer to use their own sheet or even paper
What I did is a roll20 centric solution that happens to support export to a.l.l. for those people that use it, but primarily it is to tie the description of the module rewards to the roll20 room where you built the module, and to allow the DM to have buttons that say "this checkpoint was achieved" right there in the game.
This item here on the log site is just to allow the direct import. I would still do it the other way even if this work never gets approved and people just have to fill in the rewards manually. By the way, in my experience I have never encountered a Roll20 DM who actually fills in the rewards for their players. I'm trying to help with that.
On Nov 5, 2018, at 14:38, Chris C notifications@github.com<mailto:notifications@github.com> wrote:
Would an easier/cleaner solution to this be having the DM fill out their DM logsheet entry, and then having a "share with players" link, which would then, using a (limited life?) hash/token, let players pre-populate a new entry based on the relevant data from the DM's entry?
This would keep the entirety of the functionality outside Roll20, where you would simply share the link with your players. Just a thought as I stumbled back into GH this afternoon.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Ariel-Thomas/adventurers-league-log/issues/157#issuecomment-436007325, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAx4CCnRkV63MkBLDRsk0QrtQsan6R-2ks5usJOhgaJpZM4WQydW.
Turns out I'm a little behind, as I was just back in my account and noticed campaigns (new since last I logged in), and was about to bring that exact thing up. Though, it seems that in either case, there's an assumption of using the log, as DM is either making logs themself, or explicitly going out of their way to make logs for others while not using the platform themself.
Just thought I'd throw out a different opinion on the topic.
I get what you are saying and I really appreciate it. I'm German so I might argue strongly against what you are saying but I still appreciate exploring it.
Could you read through this use case / demo of the rewards plugin please and let me know what you think?
https://derammo.github.io/der20/#rewards
You will see it is all about putting the rewards right there in the room which you might share with other DMs and then minimizing the work you have to do during the session (just checking things off.) At the same time, it does not come with knowledge about all the AL modules, because that is against the spirit of DDAL, where these are supposed to be secrets. But for the modules you own, you can either write or trade the descriptions of the rewards and then you won't screw it up when you are at the end of the session and out of time and everyone has to go :)
Regarding your point about the DM not using the platform, I fully expect 99% of DMs do. But I want to support players who don't YET use the platform and so at the end they get their rewards and they can either
a) put them in whatever sheet they want, print them out, hang them on the wall, whatever or
b) notice this cool button and say "hey shit, I should start using a.l.l.com
So I am trying to support everyone in DDAL (which does not REQUIRE use of the log site) while at the same time driving people to use it, because it makes everything better.
This is a little bit disgusting from a REST perspective, but it would allow for interesting integration, I think. Imagine a Roll20 Plugin that allows the DM to fill in a form at the end of the adventure, with ACP, TCP, and Magic Item unlocks, DCI, etc. all filled in. This would create a clickable link with a huge query string to "https://www.adventurersleaguelog.com/character_log_import?queryqueryquery..."
Clicking the link would, if the user is logged in on adventurersleaguelog.com, present a list of characters and allow choosing to which character to apply the log entry. Then all the info in the query string is upacked and presented as a pre-filled "New" action dialog for the log entry. This integration (rather than REST) preserves the use of your UI and branding, rather than letting Roll20 directly populate your database. Also, it allows the player to make whatever corrections they want. I believe this approach leaves the responsibility for awarding the right amounts with the DM, as it has to be.
For this to work, a pretty messy amount of parameter tunneling and redirects has to happen. I prototyped the server side of this in my fork except for the selection of the character, because I am not very good at Rails and didn't think I needed this to pitch the idea. I assume you would want to do it in a much better way anyway, as I am no Rails expert. So please take a look as a prototype or illustration of the idea. I have run it as far as populating it with this URL string that includes one magic item:
/character_log_imports/new?character_log_entry%5Badvancement_checkpoints%5D=4&character_log_entry%5Badventure_title%5D=Imported+Wonder+Land&character_log_entry%5Bmagic_items_attributes%5D%5B1%5D%5B_destroy%5D=false&character_log_entry%5Bmagic_items_attributes%5D%5B1%5D%5Bcharacter_id%5D=17&character_log_entry%5Bmagic_items_attributes%5D%5B1%5D%5Bid%5D=1&character_log_entry%5Bmagic_items_attributes%5D%5B1%5D%5Blocation_found%5D=&character_log_entry%5Bmagic_items_attributes%5D%5B1%5D%5Bname%5D=Axe+of+Wow&character_log_entry%5Bmagic_items_attributes%5D%5B1%5D%5Bnot_included_in_count%5D=false&character_log_entry%5Bmagic_items_attributes%5D%5B1%5D%5Bnotes%5D=&character_log_entry%5Bmagic_items_attributes%5D%5B1%5D%5Brarity%5D=very_rare&character_log_entry%5Bmagic_items_attributes%5D%5B1%5D%5Btable%5D=H&character_log_entry%5Bmagic_items_attributes%5D%5B1%5D%5Btable_result%5D=&character_log_entry%5Bmagic_items_attributes%5D%5B1%5D%5Btier%5D=2&character_log_entry%5Btier%5D=2&character_log_entry%5Btreasure_checkpoints%5D=4
The Roll20 plugin would be pretty easy, especially for someone with experience making interactive "form" style UI in Roll20. Persistence on the Roll20 side could be used to store the typical (max) awards in the room used for the module. Again, this would rest with the DM.