Package Exports
- node-csgo-gsi
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-csgo-gsi) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
node-csgo-gsi
Counter-Strike: Global Offensive Game State Integration for node.js.
Usage
Install gamestate_integration_node.cfg
into your CS:GO cfg directory.
Example: C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\cfg\gamestate_integration_node.cfg
This file will automatically be executed on client start. Look into the console to check if it has executed successfully.
Installation
npm install node-csgo-gsi --save
or
yarn add node-csgo-gsi
const CSGOGSI = require("node-csgo-gsi");
let gsi = new CSGOGSI({options});
gsi.on("event", function("optional data") {
});
Example
A sample script is in the example
folder.
Options
port
- Set the server port (default: 3000)authToken
- authToken to accept from client. Make sure all clients have the same authToken (default: "" - no authentication needed)
Events
all
- Returns the full posted data (use this if you do not want to use the given events provided below)
Game
gameMap (returns String)
- Returns current map.
gamePhase (returns String)
- Returns current game state.
live
warmup
gameRounds (returns Integer)
- Returns the current round number.
- eg: 10
gameCTscore (returns Object)
- Returns the current Counter Terrorist team's score.
"score": int,
"consecutive_round_losses": int,
"timeouts_remaining": int,
"matches_won_this_series": int
gameTscore (returns Object)
- Returns the current Terrorist team's score.
"score": int,
"consecutive_round_losses": int,
"timeouts_remaining": int,
"matches_won_this_series": int
Round
roundPhase (returns String)
- Returns the current round state.
live
freezetime
over
roundWinTeam (returns String)
- Returns the latest round's winner.
CT
T
C4
bombState (returns String)
- Returns C4 state.
planted
exploded
defused
bombTimeStart (returns Float)
- Returns when C4 is planted.
bombTimeLeft (returns Float)
- Returns planted C4 time left.
To-do
- Multi-player authentication code
Credits
License
The MIT License (MIT)
Copyright (c) 2019 Shaun