redraskal / r6-dissect

Match Replay API/CLI for Rainbow Six: Siege's Dissect (.rec) format.
MIT License
68 stars 12 forks source link

Test if every operator has a role #31

Closed stnokott closed 1 year ago

stnokott commented 1 year ago

As discussed in #29 , a test to check whether our map[operator]role is missing any operators. One approach could be:

  1. use reflect or golang.org/x/tools/go/packages to go through header.go, finding all constants of type Operator
  2. for each const we find, check if Operator.Role() returns an error
  3. if we have no errors, we know that each of our operators has a role assigned

@redraskal do you think we should also add a test that queries the Ubisoft page to check if we are missing any operators in header.go that are present in the game?

redraskal commented 1 year ago

Might as well test both ways so we don't miss anything.

Also, Ubisoft has a maps page https://www.ubisoft.com/en-us/game/rainbow-six/siege/game-info/maps. Maybe we can add a map test in the future too?

stnokott commented 1 year ago

Also, Ubisoft has a maps page https://www.ubisoft.com/en-us/game/rainbow-six/siege/game-info/maps. Maybe we can add a map test in the future too?

Yes, of course. It'll take a bit to reverse-engineer all these pages, but sounds like a good idea for the future.

Maybe you noticed my comment here: https://github.com/redraskal/r6-dissect/blob/22d7e415dcbf71fc1724bece2cb6a328d4ac67f8/dissect/ubi/operators.go#L111-L118 Querying official pages would allow us to generate even more metadata for operators (and possibly other things like maps) too.

stnokott commented 1 year ago

To digress a bit more:

I'd love to have a way of automatically generating the IDs of all constants - maps, operators etc. - so that we can be sure our constants are always complete and don't have to manually edit files for each new season.

But that's probably not possible, finding out the ID of something will always require diving into the replay file format, right?

redraskal commented 1 year ago

To digress a bit more:

I'd love to have a way of automatically generating the IDs of all constants - maps, operators etc. - so that we can be sure our constants are always complete and don't have to manually edit files for each new season.

But that's probably not possible, finding out the ID of something will always require diving into the replay file format, right?

Yes, these constants will always require recording a replay and finding the ID in logs. I think it would be cool to capture more data from the Ubisoft site though!

redraskal commented 1 year ago

I don't mind adding the new maps and ops to the header file each season. It takes no time. The team role generation, however, was a nice touch