All Projects → koczadly → csgo-gsi

koczadly / csgo-gsi

Licence: MIT license
A Java library for Counter-Strike: Global Offensive's game state integration

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to csgo-gsi

discord-10man
Discord bot for CS:GO Scrims and Pugs
Stars: ✭ 34 (+47.83%)
Mutual labels:  counter-strike, csgo, valve, counter-strike-global-offensive
Csgo Pug Setup
CS:GO Sourcemod plugin for setting up private pug/10man games
Stars: ✭ 330 (+1334.78%)
Mutual labels:  counter-strike, csgo, counter-strike-global-offensive
Goesp
Cross-platform streamproof ESP hack for Counter-Strike: Global Offensive, written in modern C++. Rendering and GUI powered by Dear ImGui.
Stars: ✭ 210 (+813.04%)
Mutual labels:  counter-strike, csgo, counter-strike-global-offensive
csgo-hud
Custom CS:GO Spectator HUD
Stars: ✭ 40 (+73.91%)
Mutual labels:  counter-strike, csgo, counter-strike-global-offensive
Public
The game is about a group of "terrorists" who have traitors among them, out to kill everyone who's not a traitor.
Stars: ✭ 94 (+308.7%)
Mutual labels:  counter-strike, csgo, counter-strike-global-offensive
Csgo Retakes
CS:GO Sourcemod plugin for a site-retake gamemode
Stars: ✭ 272 (+1082.61%)
Mutual labels:  counter-strike, csgo, counter-strike-global-offensive
Garhal csgo
A project that demonstrates how to screw with CSGO from Kernel Space. (CSGO Kernel Cheat/Hack) All cleaned up, and with updated offsets.
Stars: ✭ 179 (+678.26%)
Mutual labels:  counter-strike, csgo, counter-strike-global-offensive
get5-web
An unsupported, proof-of-concept webpanel for servers using the get5 CS:GO server plugin. Please don't use it.
Stars: ✭ 97 (+321.74%)
Mutual labels:  counter-strike, csgo, counter-strike-global-offensive
Anubis
Free open-source training software / cheat for Counter-Strike: Global Offensive, written in C.
Stars: ✭ 81 (+252.17%)
Mutual labels:  counter-strike, csgo, counter-strike-global-offensive
Aristois Legit
Full project files for aristois, Counter-Strike: Global Offensive cheat.
Stars: ✭ 110 (+378.26%)
Mutual labels:  counter-strike, csgo, counter-strike-global-offensive
Fortify
Dota Underlords data platform
Stars: ✭ 14 (-39.13%)
Mutual labels:  valve, gsi, game-state-integration
Advancedfx
Half-Life Advanced Effects (HLAE) is a tool to enrich Source (mainly CS:GO) engine based movie making.
Stars: ✭ 231 (+904.35%)
Mutual labels:  counter-strike, csgo, counter-strike-global-offensive
Csgo Multi 1v1
CS:GO Sourcemod plugin to create multi-1v1 arena servers
Stars: ✭ 230 (+900%)
Mutual labels:  counter-strike, csgo, counter-strike-global-offensive
Vac Bypass
Valve Anti-Cheat bypass written in C.
Stars: ✭ 241 (+947.83%)
Mutual labels:  counter-strike, csgo, valve
Csgo Practice Mode
CS:GO Sourcemod plugin for private team/individual practice servers
Stars: ✭ 263 (+1043.48%)
Mutual labels:  counter-strike, csgo, counter-strike-global-offensive
Deadcell Csgo
Full source to the CS:GO cheat
Stars: ✭ 339 (+1373.91%)
Mutual labels:  counter-strike, csgo, counter-strike-global-offensive
pengWin
An external cheat for the Linux version of Counter-Strike Global Offensive
Stars: ✭ 28 (+21.74%)
Mutual labels:  counter-strike, csgo, counter-strike-global-offensive
CSGO-Translator
Simple C# CSGO chat translator
Stars: ✭ 35 (+52.17%)
Mutual labels:  counter-strike, csgo, counter-strike-global-offensive
csgo richpresence
Discord Rich Presence support for Counter-Strike: Global Offensive!
Stars: ✭ 16 (-30.43%)
Mutual labels:  counter-strike, csgo, counter-strike-global-offensive
Get5
CS:GO Sourcemod plugin for competitive matches/scrims
Stars: ✭ 390 (+1595.65%)
Mutual labels:  counter-strike, csgo, counter-strike-global-offensive

CSGO-GSI

About

A Java library for retrieving real-time game information and statistics from Counter-Strike: Global Offensive using the built-in game state integration service.

Features

This library provides access to 3 main features:

  • Automated location of the game's installation directory
  • The creation and deletion of game state service configurations
  • A server which listens for updates and parses the game state data

Usage

Maven

This project is hosted on Maven Central. To import this library, add the following dependency into your pom.xml:

<dependency>
    <groupId>uk.oczadly.karl</groupId>
    <artifactId>csgo-gsi</artifactId>
    <version>1.6.0</version>
</dependency>

Documentation

The latest Javadoc pages can be viewed online through Javadoc.io.

Configuration generation

Creating the game state configuration file for the game client is an easy and automated process. This can be accomplished using the provided GSIConfig class. The example below demonstrates how to use this utility:

// Build the configuration for our service
GSIConfig config = new GSIConfig()
        .setLocalURI(1337)  // Server on localhost:1337
        .setTimeoutPeriod(1.0)
        .setBufferPeriod(0.5)
        .withAuthToken("password", "Q79v5tcxVQ8u")
        .withAllDataComponents();  // Or specify which using withDataComponents(...)

try {
    // Automatically locates the game directory and creates the configuration file
    Path output = config.writeFile("test_service");
    System.out.println("Written config file: " + output);
} catch (GameNotFoundException e) {
    // Either CSGO or Steam installation directory could not be located
    System.err.println("Couldn't locate CSGO installation: " + e.getMessage());
} catch (IOException e) {
    System.err.println("Couldn't write to configuration file.");
}
Click to view data written to the file gamestate_integration_test_service.cfg
"Sample test service" {
    "uri"     "http://localhost:1337"
    "timeout" "1.0"
    "buffer"  "0.5"
    "auth" {
        "password" "Q79v5tcxVQ8u"
    }
    "data" {
        "map_round_wins"         "1"
        "map"                    "1"
        "player_id"              "1"
        "player_match_stats"     "1"
        "player_state"           "1"
        "player_weapons"         "1"
        "player_position"        "1"
        "provider"               "1"
        "round"                  "1"
        "allgrenades"            "1"
        "allplayers_id"          "1"
        "allplayers_match_stats" "1"
        "allplayers_position"    "1"
        "allplayers_state"       "1"
        "allplayers_weapons"     "1"
        "bomb"                   "1"
        "phase_countdowns"       "1"
    }
}

Listening for state information

To listen for new game state information, a GSIServer object must be created, and an instance which implements GSIListener must be registered to the server object. The example below demonstrates a basic listener which prints the client's Steam ID and current map name (if in a game) to the console.

// Create a new listener (using a lambda for this example)
GSIListener listener = (state, context) -> {
    // Access state information with the 'state' object...
    System.out.println("New state from game client address " + context.getAddress().getHostAddress());
    
    state.getProvider().ifPresent(provider -> {
        System.out.println("Client SteamID: " + provider.getClientSteamId());
    });
    state.getMap().ifPresent(map -> {
        System.out.println("Current map: " + map.getName());
    });
};

// Configure server
GSIServer server = new GSIServer.Builder(1337)        // Port 1337, on all network interfaces
        .requireAuthToken("password", "Q79v5tcxVQ8u") // Require the specified password
        .registerListener(listener)                   // Alternatively, you can call this dynamically on the GSIServer
        .build();

// Start server
try {
    server.start(); // Start the server (runs in a separate thread)
    System.out.println("Server started. Listening for state data...");
} catch (IOException e) {
    System.err.println("Couldn't start server.");
}

Accessing the diagnostics page

If not disabled (using the GSIServer builder), you can access the server as a standard webpage, revealing information about the server and the game state information being received.

Sample output screenshot

Development

If you experience a bug or think the library is missing some functionality, please submit an issue or pull request.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].