Skip to content

Allow assigning factions to states.

Adarnof requested to merge Adarnof/allianceauth:faction into v2.9.x

Why didn't I do this with v2? No idea. This was an obvious thing to do. Anyway several years later I've finally gotten around to it. Sorry for the delay.

In that time CCP have very conveniently added faction data to the post_character_affiliation endpoint, so it's trivial to determine if a character is enlisted. Back in the good ol' days that info was only available at the corporation level. I've checked, and faction_id appears for characters who are in the NPC faction warfare corps, and whose player corps are enlisted. An alliance is (or was, circa 2017) only considered enlisted if all its member corps are individually, so should be no issues there.

I've added two new fields to the EveCharacter model, faction id and name. Additionally the EveSwaggerProvider has new methods to fetch faction data - the only "get faction data" operation gives you an entire list, so I've chosen to "cache" it locally in the provider. It shouldn't change during runtime, and should never change in a meaningful way. If it does, tell people to restart.

This required adding one new operation to the eveonline swagger.json - I took the liberty of minimizing the latest "_latest/swagger.json" from ESI. I only missed two operations the first time.

While I was abusing the provider, I also re-jigged the other objects to use mixins instead of statically defining the alliance/faction properties for each, to reduce redundant code. This can be undone if it's upsetting you.

This should close #1163 (closed) (which closed #1083 (closed) (which was a port of ye olde #1083))

Merge request reports