Browse Source

update

main
Tim 7 months ago
parent
commit
a66a14ef68
  1. 4
      README.md
  2. 12
      csgo-eink-stats.py
  3. 22
      gamestate_integration_eink.cfg

4
README.md

@ -2,8 +2,8 @@
Uses GSI (Game State Integration) [WIKI: CSGO GSI](https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Game_State_Integration)to post data to a flask server running on a raspberry pi, or any device using a Papirus controller to run an e-ink display
Use the same GSI config and place it `$gamefiles/csgo/cfg/gamestate_integration_eink.cfg`
Change the IP to your e-ink network device
Edit the GSI config with the rPi/eInk display's IP and place it `$gamefiles/csgo/cfg/gamestate_integration_eink.cfg`
- Example: `cp gamestate_integration_eink.cfg ~/.steam/steam/steamapps/common/Counter-Strike\ Global\ Offensive/csgo/cfg/gamestate_integration_test.cfg`
## Requirements
- Flask

12
csgo-eink-stats.py

@ -18,6 +18,16 @@ def initialise():
screen.WriteAll()
def round_loss(num):
num = int(num)
if num > 5:
return "3400"
elif num < 1:
return 1400
else:
return 1400 + (num * 500)
@application.route('/', methods=['POST'])
def index():
if request.method == 'POST':
@ -35,6 +45,7 @@ def index():
screen.UpdateText("Map", csmap)
screen.UpdateText("Score", "T: "+t_score+" | CT: "+ct_score)
screen.UpdateText("ScoreLoss", "TL: {} | CTL: {}".format(t_consec_loss, ct_consec_loss))
screen.UpdateText("ExStats", "T$: {} | CT$: {}".format(round_loss(t_consec_loss), round_loss(ct_consec_loss)))
if data["player"]["steamid"] == my_id:
# Im Alive
@ -59,4 +70,5 @@ def index():
if __name__ == "__main__":
initialise()
# Make sure this port matches your gamestate configuration
application.run(host='0.0.0.0', port=8298)

22
gamestate_integration_eink.cfg

@ -0,0 +1,22 @@
"Console Sample v.1"
{
"uri" "http://192.168.0.52:8298" // add the IP and Port of the rPi / eInk device
"timeout" "5.0"
"buffer" "0.1"
"throttle" "0.5"
"heartbeat" "60.0"
"auth"
{
"token" "CCWJu64ZV3JHDT8hZc" // Randomise the token so your GSI can be "secure"
}
"data"
{
"provider" "1" // general info about client being listened to: game name, appid, client steamid, etc.
"map" "1" // map, gamemode, and current match phase ('warmup', 'intermission', 'gameover', 'live') and current score
"round" "1" // round phase ('freezetime', 'over', 'live'), bomb state ('planted', 'exploded', 'defused'), and round winner (if any)
"player_id" "1" // player name, clan tag, observer slot (ie key to press to observe this player) and team
"player_state" "1" // player state for this current round such as health, armor, kills this round, etc.
"player_weapons" "1" // output equipped weapons.
"player_match_stats" "1" // player stats this match such as kill, assists, score, deaths and MVPs
}
}
Loading…
Cancel
Save