Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

csgo-gamestate-client

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

csgo-gamestate-client

A client to parse an interpret the data received from [CS:GO Game State Integration](https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Game_State_Integration)

  • 0.2.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
7
increased by133.33%
Maintainers
1
Weekly downloads
 
Created
Source

csgo-gamestate-client

A client to parse an interpret the data received from CS:GO Game State Integration

API

function parseGameState(newGameState: string): GameState

Parses the given game state JSON string. Returns the parsed GameState object or throws decoding error.

newGameState: string This is the string that the CS:GO client sends as a HTTP POST message.

function decodeGameState(newGameState: GameState): GameState

Decodes the given game state object. Returns the decoded GameState object or throw decoding error.

newGameState: GameState This is the parsed game state that the CS:GO client sends as a HTTP POST message.

function getTeams(newGameState: GameState): Teams

Returns the teams and their players. Check Teams interface for details.

newGameState: GameState This is the parsed GameState return by parseGameState function.

Example

An example to create an endpoint to receive the CS:GO Game State Integration data and an endpoint the respond with the parsed data.

import express from 'express'
import { parseGameState, GameState } from 'csgo-gamestate-client'

let gameState = null
const app = express()
app.post('/gamestate', (req) => (gameState = parseGameState(req.body)))
app.get('/gamestate', (req, res) => res.json(gameState))
app.listen(3000)

FAQs

Package last updated on 22 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc