MarechJ / hll_rcon_tool

Hell Let Loose Community RCON, CRCON for short. An alternative rcon client for HLL. It is a web application with many features, historical data, statistics, discord integrations, etc
MIT License
98 stars 69 forks source link

Scoreboard API: add team stats #299

Open MartijnHols opened 1 year ago

MartijnHols commented 1 year ago

It would be nice to know which team weapons and kills belong to. This makes it possible to show more team specific information. I'm thinking of something like being able to filter by team to show the team's top killers, having labels inside PlayerItem that signify teams, and statistics, such as a balance bar (functional preview - styling pending):

image image

I currently have this implemented locally using a fairly rudimentary function:

const germanWeapons = [
  "KARABINER 98K",
  "MP40",
  "STG44",
  "GEWEHR 43",
  "M43 STIELHANDGRANATE",
  "M24 STIELHANDGRANATE",
  "MG42",
  "MG 42", // this alternative spelling is used in the game, no idea why/when
  "M1A1 AT MINE",
  "150MM HOWITZER [sFH 18]",
  "FG42 x4",
  "WALTHER P38",
  "KARABINER 98K x8",
  "FLAMMENWERFER 41",
  "PANZERSCHRECK",
  "FG42",
  "MG34",
  "S-MINE", // TODO: verify whether the US AP mine isn't also listed as S-MINE kill
  "LUGER P08",
  "TELLERMINE 43",
  // Panther
  "COAXIAL MG34 [Sd.Kfz.171 Panther]",
  "HULL MG34 [Sd.Kfz.171 Panther]",
  "75MM CANNON [Sd.Kfz.171 Panther]",
  // Tiger
  "COAXIAL MG34 [Sd.Kfz.181 Tiger 1]",
  "HULL MG34 [Sd.Kfz.181 Tiger 1]",
  "88 KWK 36 L/56 [Sd.Kfz.181 Tiger 1]",
  // Panzer IV
  "COAXIAL MG34 [Sd.Kfz.161 Panzer IV]",
  "HULL MG34 [Sd.Kfz.161 Panzer IV]",
  "75MM CANNON [Sd.Kfz.161 Panzer IV]",
  // Lunchs
  "COAXIAL MG34 [Sd.Kfz.121 Luchs]",
  "20MM KWK 30 [Sd.Kfz.121 Luchs]",
  // Puma
  "COAXIAL MG34 [Sd.Kfz.234 Puma]",
  "50mm KwK 39/1 [Sd.Kfz.234 Puma]",
  "COAXIAL MG34", // unidentified tanks
  "75MM CANNON [PAK 40]", // AT gun
  "FELDSPATEN", // melee
  "MG 42 [Sd.Kfz 251 Half-track]", // halftrack mg
  "HULL MG34", // no idea what tank this is
];
const isGermanWeapon = (weapon) => germanWeapons.includes(weapon);

But I don't think this can be made robust enough to make into a PR worthy of this project. Including team info in weapons and most_killed would help make this possible. If available, including role info would be great too because now I have to create a list of all artillery weapons (while the list is short, this is not ideal) and tank weapons.

MartijnHols commented 3 months ago

A way this can be done:

https://github.com/MartijnHols/hll_rcon_tool/tree/fork/rcongui/src/components/Scoreboard/weapons

Keeping a list of all weapons per team isn't as big a problem as I initially thought; new weapons are added very infrequently.