dndplayer / dnd-player

An online virtual DND playground to support online groups.
https://dnd-player.com
Other
1 stars 0 forks source link

Add ability to ping map #56

Closed BodrickLight closed 5 years ago

chrisella commented 5 years ago

Started having a look at this. Assuming we want to keep bits in Firebase it seems our options are:

UPDATE: Reading into functions a bit further, I think going with a combo of realtime DB and a cleanup function is probably easiest for now. Function limits on the free plan are:

Invocations: 125K / month GB-seconds: 40K / month CPU-seconds: 40K / month Outbound Networking: Google services only

So it would be easy to have a function trigger when someone adds an entry to the realtime DB at /pings (for example) and the function removes that entry a predefined amount of time later. If this is too heavy on the limits (a function for EVERY ping) then a periodic function (every 15 mins for example) could just purge the /pings collection of any ping that is older than 1 min for example, so clients have some time to get the ping if their syncs are slow.

I'll start looking into a prototype of this shortly.

chrisella commented 5 years ago

I've got most of this implemented (the way we discussed at lunch) and pushed so far in f98bc6270f50ad56f6c03133e2c682eedd79dc69

From that commit on you should send pings when left clicking anywhere on the stage and in response to the sync back you should see a console.log with details of the ping, the remainder is yet to push.

image

I've got the remainder half finished - with the UI/Map showing actual pings almost done and a toggle button needed still to enable click to ping so it doesn't happen all the time (unless that's possibly desired).

chrisella commented 5 years ago

Now just need to finish the new animation and push that