Giter VIP home page Giter VIP logo

Comments (3)

mrozbarry avatar mrozbarry commented on May 19, 2024

@simonharrer does your mob setup care much about positions like navigator or driver, and is there a rotation? You can certainly not add people to the mob section and just use the timer.

So this is how the internals work, and you might be able to hack something together for now:

  1. Connect a websocket to https://mobtime.mrbarry.com/your-timer-id
  2. It will send a payload that looks something like { type: 'token', token: 'YOUR SESSION TOKEN', state: { ...stateOfTimer } } - take that token
  3. Every minute or so, send a { ping: <unix timestamp in milliseconds> } through the websocket to keep the socket connection alive.
  4. Now you can make API calls via https://mobtime.mrbarry.com/api/X with Authorize: token <token from websocket> as a header.

The API you're going to care about is:

/api/timer/start/<milliseconds> - I typically add 999 so the initial second runs without making the timer bump to the next second
/api/timer/pause
/api/timer/resume

And if you care about mob person management:

/api/mob/add/<encoded name of mobber>
/api/mob/remove/<encoded name of mobber>
/api/mob/cycle to rotate mobber positions if you have a regular/predictable rotation.

But keep in mind that this is sort of shoe-horning how mobtime works. You might find just having a dedicated person in charge of managing the timer to be just as effective without having to introduce new code.


I also opened #35 which an alternative path forward, but I need to think through a lot of implications, and it may require a number of prerequesite features that I may not want.

from mobtime.

mrozbarry avatar mrozbarry commented on May 19, 2024

@simonharrer does that initial plan work? I can better document the API if that will help. It looks like go has a websocket library - you could temporarily connect a websocket, do a series of api calls with the token, then disconnect to do what you want. There's no current penalties for quick websockets or connections over time.

from mobtime.

simonharrer avatar simonharrer commented on May 19, 2024

Just to let you know that I've currently so much on my plate that I don't know when I can come back to this. Closing this for now, and will reopen when I do have time for this. Thanks for your awesome and quick help already!

from mobtime.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.