init: cs player_status CDK demo

This commit is contained in:
2026-07-11 03:08:25 +08:00
commit bad1f2570b
9 changed files with 272 additions and 0 deletions

44
logic/parser.py Normal file
View File

@@ -0,0 +1,44 @@
def parse_game_state(data):
player = data.get("player", {})
state = player.get("state", {})
return {
"timestamp":
data.get("provider", {})
.get("timestamp"),
"player":{
"name":
player.get("name"),
"team":
player.get("team"),
"health":
state.get("health"),
"armor":
state.get("armor"),
"helmet":
state.get("helmet"),
"flashed":
state.get("flashed"),
"smoked":
state.get("smoked"),
"burning":
state.get("burning"),
"kills":
state.get("round_kills"),
"headshots":
state.get("round_killhs")
}
}