Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ project(csgo_gc)

set(CMAKE_CXX_STANDARD 17)

find_package(Threads REQUIRED)

if (CMAKE_SIZEOF_VOID_P EQUAL 4)
set(IS_32BIT ON)
endif()
Expand Down
61 changes: 47 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,24 @@ In Valve games, the Game Coordinator (GC) is a backend service most notably resp
While it's still possible to connect CS:GO to CS2's GC by spoofing the version number, this may break in the future if Valve updates the GC protocol. This project aims to restore most GC-related functionality without relying on a centralized server.

## Current features
- Editable inventory (inventory.txt)
- Item equipping
- Opening cases (including sticker capsules, patch packs, graffiti boxes and music kit boxes)
- Editable inventory (`inventory.txt`)
- Live inventory updates while the game is running
- Item equipping and loadout updates
- Opening cases, sticker capsules, patch packs, graffiti boxes, music kit boxes and souvenir packages
- Souvenir item generation
- Stickers and patches
- Name tags
- Graffiti support
- Music kits
- Weapon StatTrak support
- Music kit StatTrak support, including round MVP count propagation
- Storage Units
- StatTrak Swaps
- Trade ups
- Stickers and patches
- Name tags
- Music kits
- In-game store
- In-game store purchases
- Read-only inventory consistency diagnostics
- Source RCON-compatible local control interface
- Parameterized RCON item creation for paint kits, wear, seed, StatTrak, music kits, sprays, stickers and custom names
- Works without full Steam API emulation
- Full Windows, Linux and macOS support
- Functional lobbies
Expand All @@ -30,7 +36,8 @@ While it's still possible to connect CS:GO to CS2's GC by spoofing the version n
- Networking using Steam's P2P interface

## Planned features
- Rest of the core features (souvenirs...)
- More validation and polish for edge-case inventory operations
- Tooling around live inventory editing

I'm still looking for the **full** CS:GO Item Schema. If you have a relatively recent copy of it and are willing to share it, let me know!

Expand All @@ -39,45 +46,71 @@ I'm still looking for the **full** CS:GO Item Schema. If you have a relatively r

## Installation
- Download [CS:GO from Steam](steam://install/4465480)
- Download the latest release for your platform from the [releases page](https://github.com/mikkokko/csgo_gc/releases/latest)
- Download the latest release for your platform from the [releases page](https://github.com/GT-610/csgo_gc/releases/latest)
- Navigate to the game's installation directory
- Back up your existing launcher executables as they'll be overwritten (i.e. csgo.exe, srcds.exe, csgo_linux64, etc.)
- Extract the contents of the downloaded archive to your game directory, replace the executables when prompted
- Launch the game. If you get the annoying VAC message box, launch the game with the -steam argument
- macOS users: The release binaries are not notarized, so if you're using them, you'll have to deal with that somehow

## Inventory editing
For GUI inventory editors, see https://github.com/mikkokko/csgo_gc/issues/82. For manual editing, there is a guide made by someone else [here](https://gist.github.com/dricotec/1ae3deb06c42012970c00df914348e76).
Inventory can still be edited offline through `inventory.txt`. For manual editing, there is a guide made by someone else [here](https://gist.github.com/dricotec/1ae3deb06c42012970c00df914348e76).

The local RCON interface can also create and remove items while the game is running. This is intended for scripts and GUI editors that want to avoid the old edit-file-and-restart workflow.

## Configuration
See [csgo_gc/config.txt](examples/config.txt) for available options.

## RCON
RCON is disabled by default and binds to localhost with the default configuration; the actual listen address is controlled by `bind_address`. It uses the Source RCON binary protocol, so existing Source RCON clients can be used.

See [rcon.md](docs/rcon.md) for protocol details, configuration, supported parameters and error formats.
Comment thread
coderabbitai[bot] marked this conversation as resolved.

## Building
Requirements:
- Git
- CMake 3.20 or newer
- C++ compiler with C++17 support (VS 2017 or later, Clang 5 or later, GCC 7 or later)

The top-level CMake project downloads protobuf, cryptopp-cmake and funchook through `FetchContent` during configure.

The game is 32-bit on Windows so you need to build as 32-bit:

`cmake -A Win32 -B build`
```bat
cmake -A Win32 -B build
cmake --build build --config Release --target csgo_gc
```

Linux dedicated servers are also 32-bit:

`cmake -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 -DCMAKE_ASM_FLAGS=-m32 -B build`
```sh
cmake -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 -DCMAKE_ASM_FLAGS=-m32 -B build
cmake --build build --target csgo_gc
```

On macOS, you need to build for x86_64 instead of arm64:

`cmake -DCMAKE_OSX_ARCHITECTURES=x86_64 -DFUNCHOOK_CPU=x86 -B build`
```sh
cmake -DCMAKE_OSX_ARCHITECTURES=x86_64 -DFUNCHOOK_CPU=x86 -B build
cmake --build build --target csgo_gc
```

For Linux clients you don't have to specify any additional options.

For a full launcher package build, also build the launcher targets:

```sh
cmake --build build --config Release --target csgo srcds csgo_gc
```

## License
This project is licensed under the 2-Clause BSD License. See [LICENSE.md](LICENSE.md) for details.

## Credits
* **Mikko Kokko** - Author
* **Mikko Kokko** - Original author
* **Theeto** - Code reused from the predecessor project, unusual loot lists
* **GT610** (`GT-610`) - Fork deveopment
* Contributors who continued inventory, networking, diagnostics and RCON work after the original upstream changes

## Third party dependencies
- [Crypto++](https://github.com/weidai11/cryptopp) ([Boost Software License](https://github.com/weidai11/cryptopp/blob/master/License.txt))
Expand Down
8 changes: 7 additions & 1 deletion csgo_gc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ add_library(csgo_gc SHARED
main.cpp
networking_client.cpp
networking_server.cpp
rcon_server.cpp
souvenir.cpp
steam_hook.cpp)

Expand Down Expand Up @@ -45,7 +46,12 @@ target_link_libraries(csgo_gc PRIVATE
cryptopp
funchook-static
libprotobuf-lite
steam_api)
steam_api
Threads::Threads)

if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
target_link_libraries(csgo_gc PRIVATE ws2_32)
endif()

# apple message box
if (APPLE)
Expand Down
14 changes: 14 additions & 0 deletions csgo_gc/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ GCConfig::GCConfig()
m_appIdOverride = config.GetNumber("appid_override", m_appIdOverride);
m_showCsgoGCServersOnly = config.GetNumber("show_csgo_gc_servers_only", m_showCsgoGCServersOnly);

const KeyValue *rcon = config.GetSubkey("rcon");
if (rcon)
{
m_rconEnabled = rcon->GetNumber("enabled", m_rconEnabled);
m_rconBindAddress = rcon->GetString("bind_address", m_rconBindAddress);
m_rconPort = rcon->GetNumber("port", m_rconPort);
m_rconPassword = rcon->GetString("password", m_rconPassword);

if (m_rconEnabled && m_rconPassword.empty())
{
Platform::Print("WARNING: RCON is enabled with an empty password; any Source RCON password will authenticate. Keep bind_address local or set rcon.password.\n");
}
}

Comment thread
coderabbitai[bot] marked this conversation as resolved.
const KeyValue *ranks = config.GetSubkey("ranks");
if (ranks)
{
Expand Down
8 changes: 8 additions & 0 deletions csgo_gc/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ class GCConfig
// options used by steam hook
uint32_t AppIdOverride() const { return m_appIdOverride; }
bool ShowCsgoGCServersOnly() const { return m_showCsgoGCServersOnly; }
bool RconEnabled() const { return m_rconEnabled; }
const std::string &RconBindAddress() const { return m_rconBindAddress; }
uint16_t RconPort() const { return m_rconPort; }
const std::string &RconPassword() const { return m_rconPassword; }

RankId CompetitiveRank() const { return m_competitiveRank; }
int CompetitiveWins() const { return m_competitiveWins; }
Expand All @@ -54,6 +58,10 @@ class GCConfig
// and then wonder why the game doesn't work and open an issue on github otherwise
uint32_t m_appIdOverride{ 4465480 };
bool m_showCsgoGCServersOnly{ true };
bool m_rconEnabled{ false };
std::string m_rconBindAddress{ "127.0.0.1" };
uint16_t m_rconPort{ 37016 };
std::string m_rconPassword;

RankId m_competitiveRank{ RankNone };
int m_competitiveWins{ 0 };
Expand Down
Loading
Loading