Skip to content

monkeber/cs2servergui

Repository files navigation

CS2 Server Manager

Qt C++ Windows Linux

This is a very simple app I've created for managing my local server to play with friends because typing commands into the server cmd was not convenient. The app is mostly intended to be used with local server on the same machine, but you also can connect to any remote server via RCON (Stopping and starting will not work).

Written in C++ and QML as an exercise.

UI

Console Page Console Page Light Server Params Page Map History Page Log Window

Features

✅ Start and stop local server

✅ Config file in the working directory

✅ No installer, everything works inside app directory

✅ RCON Console and some additional helpful inputs

✅ History of the entered commands

✅ Scaling on different resolutions, users can also change the scale from app settings

✅ Light and dark themes

✅ History of the downloaded maps

Build

Prerequisits

The project uses Conan 2 package manager, so make sure Conan is installed and is invokable, e.g.:

$ pip install conan

$ conan --version
Conan version 2.24.0

If build fails with conan profile related issue, try:

conan profile detect --force

Versions of dependencies used, probably will work on newer versions as well:

  • QtCreator (Windows) or VSCode
  • Qt 6.10.2
  • rconpp at d77993b
  • Conan 2.26.2
  • CMake 4.2.0

Build Process Windows

You can use either VSCode or QTCreator to build the application, but both of them might require some additional setup. In both cases I think you need to also set up env variables e.g.:

QTDIR=W:\Programs\Qt\6.10.2\msvc2022_64
And add path to bin folder to PATH (e.g. W:\Programs\Qt\6.10.2\msvc2022_64\bin)

1. VSCode

Open Native x64 development tools that are provided by the MSVC compiler, start VSCode, you should be able to build now.

2. QT Creator

Open the project in Qt Creator, make sure that in the Projects pane one of the detected or configured Kits is selected (not the cmake presets one) and hit build. The kit from cmake presets does not work currently.

Build Process Linux

For building on linux I am using static build of QT to ease the deployment process. Quick info on how to build QT for static linking, for more up to date commands see the Dockerfile:

  1. Check out QT repo in any directory of your choosing:
    git clone --branch v6.10.2 https://code.qt.io/qt/qt5.git qt
    cd qt
    ./init-repository -submodules qtwayland,qtdeclarative,qtbase,qtsvg
    
  2. Configure:
    mkdir -p /qtroot/install
    mkdir -p /qtroot/build
    cd /qtroot/build
    ../qt/configure -submodules qtwayland,qtdeclarative,qtbase,qtsvg -skip qtimageformats -static -feature-freetype -fontconfig -prefix /qtroot/install
    
  3. Build:
    cd /qtroot/build
    cmake --build . --parallel
    cmake --install .
    

After doing that, create .env file in the project root directory to set Qt6_ROOT CMake variable, example of file contents (the variable can also be passed for the build step to CMake, but it's more convenient to use the file):

Qt6_ROOT=/mnt/btrwdblack/Programs/Qt/Sources/install

For building the application you can use these commands:

cmake --preset release
cmake --build --preset release

Deploy

Windows

In order to deploy the built binary you need to have windeployqt.exe reachable from the powershell (easiest way is to set QTDIR environment variable on your system).

There are a few scripts, one to move the binary and all required dependencies:

# From project root directory.
.\scripts\deploy_win.ps1 .\build\Release-Desktop_Qt_6_7_0_MSVC2019_64bit_MSVC2022 .\deploy\cs2guiserver

And the second is to package the new directory into an archive:

.\scripts\package_win.ps1 .\deploy\cs2guiserver

For convenience there is also a combined script:

.\scripts\deploy_and_package_win.ps1 .\build\Release-Desktop_Qt_6_7_0_MSVC2019_64bit_MSVC2022 .\deploy\cs2guiserver

Linux

I use Docker to build the app on an older system (Ubuntu 24 for now) in order for it to link to library versions that are present on other systems so it's usable not only on my Arch.

docker build --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) -t app-builder .
docker run --rm -v $(pwd):/build -v $(pwd)/install:/install app-builder

After that you can just copy the binary from install/bin folder and distribute it.

Supported Platforms

Windows: Tested on Windows 10 22H2 (19045.4412), but in theory should work on any version of Win10 and above.

Linux: Can be built and used on Linux as well, tested on EndeavourOS (6.18.7-arch1-1), but there shouldn't be problems building it on other or older systems.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors