Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sharing support #71

Open
kbranch opened this issue Jun 8, 2023 · 2 comments
Open

Add sharing support #71

kbranch opened this issue Jun 8, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@kbranch
Copy link
Owner

kbranch commented Jun 8, 2023

The server will get new endpoints:

  • /playerState, PUT: Accepts a player name, optionally event name, and tracker state. Server stores the state, associated with player and event names along with a UNIX timestamp of when it was received.
  • /playerState, GET: Accepts a player name and optionally a timestamp. Returns the most recent state for that player along with its timestamp. If a timestamp is given, a state will only be returned if it's more recent than the passed timestamp.
  • /playerId, POST: Accepts a player name. Returns the ID last associated with that name, if any.
  • /event, GET: Accepts an event name and renders a page showing the inventory of all players linked to that event name. Client polls /playerState for state updates.
  • /player, GET: Accepts a player name and renders a page with the full Magpie UI with the player's state loaded. Client polls /playerState for updates.

The normal state object will get a new hidden player ID GUID that the client will generate if one doesn't exist.

There will be a share button on the main page. The button would open a dialog:

  • Event name
  • Player name
  • Live update checkbox
  • Link to /event for the specified event
  • Link to /player for the specified player

The dialog will check /playerName as player name is entered to see whether there may be a name/ID conflict. If there is a conflict, it will suggest but not require that the user change their player name.

When the dialog is closed (and on every state update until page refresh if 'live update' is checked), the client will PUT the current tracker state to /playerState. The server will store the state somewhere relatively persistent since the backend gets restarted periodically.

@kbranch kbranch added the enhancement New feature or request label Jun 8, 2023
@kbranch
Copy link
Owner Author

kbranch commented Jun 12, 2023

Muffin made a good point - some kind of security would be useful, both to keep random people from coming in as players and to keep players from snooping on other players.

An event creation process could add separate viewing and joining passwords. A player participating in a view passworded event would also be blocked from /player.

@kbranch
Copy link
Owner Author

kbranch commented Jun 12, 2023

Other holdouts at the moment include:

  • An indicator to show whether live update is turned on
  • The entire /player endpoint
  • Preserving the location of existing players as new ones join, to avoid messing up OBS capture
  • A border around each player's items, to help ensure precise capture size and location
  • Something to indicate when a player's data was last updated
  • A 'restream' item layout option that copies LuckwurstJoe's reference
  • A checkbox to toggle whether individual players in /event get updates from the server
  • A delay setting for delayed restreams

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant