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 FRC Nexus Integration to get team lineups #162

Closed
wants to merge 1 commit into from

Conversation

FletcherS7
Copy link
Contributor

frc.nexus Integration to pull team lineups for practice matches and playoffs.

Caveats that need to be addressed.
js file uses static value for event code, this should be automated before merging.

For playoffs the scorekeeper must be logged into Nexus with scorekeeper permissions, this is because the lineups are considered privileged and are not in the public API.

frc.nexus Integration to pull team lineups for practice matches and playoffs.

Caveats that need to be addressed.
js file uses static value for event code, this should be automated before merging.

For playoffs the scorekeeper must be logged into Nexus with scorekeeper permissions, this is because the lineups are considered privileged and are not in the public API.
@patfair
Copy link
Member

patfair commented Oct 9, 2023

Thanks. I'll play around with this a bit more before merging.

@patfair
Copy link
Member

patfair commented Oct 14, 2023

I'm actually finding that I can access the API without any permissions:

$ curl https://api.frc.nexus/v1/2023cc/sf13/lineup
{"red":["6036","2046","5940"],"blue":["5460","1619","2910"]}

So I think I will actually rewrite this such that it all happens server-side, automatically, when the match is loaded.

@patfair
Copy link
Member

patfair commented Oct 15, 2023

Hey @eforbes, I'd appreciate your opinion here -- this is what I am thinking of doing:

  1. Adding a boolean setting to Cheesy Arena to enable Nexus integration
  2. When a practice or playoff match is loaded, the Cheesy Arena server hits the Nexus API to get the lineup
  3. The teams are substituted in transparently to the scorekeeper and field staff, so they don't need to do anything at all

Does that sound reasonable? Does this API used in @FletcherS7's PR require auth for matches that haven't been played yet? If so, would it be possible to have a token that we can save into the Cheesy Arena settings per event rather than relying on JS and cookies?

@eforbes
Copy link
Contributor

eforbes commented Oct 15, 2023

SGTM

The API endpoint does not require any auth, but due to the lineup confidentiality it will not return playoff lineups until the queuer has marked the match as "on field".

One edge case here might be for the first playoff match or the first match after a break- lineups might not be set the first time the scorekeeper loads the match. As long as they have a way to reload it though that should be fine. It would be nice for the scorekeeper to have an indicator to know whether the lineups were loaded from Nexus or if it is just showing the default (so they know to check with the queuer and reload once they are set).

@patfair
Copy link
Member

patfair commented Oct 15, 2023

Oh yeah, good point about potentially loading the match before the lineup is in. I guess if the scorekeeper knows to reload it when the teams are approaching everything will be fine.

@patfair
Copy link
Member

patfair commented Oct 15, 2023

Done in 7fe23ed.

@patfair patfair closed this Oct 15, 2023
@FletcherS7
Copy link
Contributor Author

FletcherS7 commented Oct 29, 2023

@patfair
If FRC Nexus dos not supply team lineups, CheesyArena loads loads a match with blank for each of the teams.

Suggested behavior should be to use the default lineup if FRC Nexus does not supply a lineup for that alliance.

@patfair
Copy link
Member

patfair commented Oct 29, 2023 via email

@eforbes
Copy link
Contributor

eforbes commented Oct 29, 2023

The API will return an empty json object. It's also possible if the queuer hasn't entered in one of the lineups, the response will not include one of "red" or "blue"

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

Successfully merging this pull request may close these issues.

3 participants