A CSGO Game State Integration (GSI) module with custom functions to use with game data
npm install csgo-gsi-modelcsgo-model-gsi
========
A node module providing an easy way to reformat the data from the Game State Integration API of CSGO.
Also providing functions to manage the data.
javascript
router.post('/', function(req, res) {
csgo = new csgoModel(req.body, 'STEAM_API_KEY');
// The data is set up
// All the behaviour here
// At the end, we store the data on another variable to use it for comparaison
oldCsgo = csgo;
}
`
$3
#### Usage
`javascript
csgo.functionName
`
sortPlayersByTeam() - Used to sort the players by their team.
sortPlayersBySteamId() - Used to sort the players by their Steam ID.
isStatusChanged(oldCsgoData) - Used to check if the round status changed between the two data.
isBombStatusChanged(oldCsgoData) - Used to check if the bomb status changed between the two data.
getWinnerTeamName() - Used to get the winning team name of a round.
getWinnerTeamSide() - Used to get the winning team side of a round.
getCTPlayers() - Used to get the CT players.
getTPlayers() - Used to get the T players.
isWarmup() - Used to check if the round is the warmup round.
isAlive(player) - Used to check if the player given is alive (check if his health > 0).
getTeamPlayersAlive(teamSide) - Used to get the number of alive players on the side given.
teamSide : 'T' or 'CT'
IsPlayersChanged(oldCsgoData) - Used to check if the players are still the same between the two data.
IsScreenPlayerProvider() - Used to check if the player is also the provider of the data (check by the Steam ID)
IsPlaying() - Used to check if the player is playing the game (= on a server)
getPlayerImages(newCsgoData, oldCsgoData)
A big one... This one calls the Steam API to get the player images.
It needs both old and new data to check if it's useful to call the API (the images aren't on the old data) and also to access everything on the Promise.
getScreenPlayerImage(newCsgoData, oldCsgoData)`