/gsclib

gsclib acts as a standard library extension for the Call of Duty 4 scripting language.

Primary LanguageCGNU General Public License v3.0GPL-3.0

gsclib

Checks CodeFactor License

gsclib acts as a standard library extension for the Call of Duty 4 scripting language. The features this library provides consists of an FTP/FTPS/SFTP client, an HTTP/HTTPS client, Regular Expression (PCRE2) support, Language Integrated Query (Linq) support, a MySQL connector for databases, casting/type conversion/fmt and other type utilities, ZIP files, and much more. More detailed information on each feature can be found in the documentation section.

Features & Documentation

Instructions

In order to use this library, you need to compile CoD4X server for whichever platform you're using. Navigate inside CoD4x_Server/plugins/ and follow the build instructions below:




Building (Linux)

Pre-Requisites:

  1. Edit src/plugin_handler.h and recompile your server:
    #define MAX_SCRIPTFUNCTIONS 256
  2. CGSC and it's pre-requisites
  3. CMake and Conan. (Install both using pip3 instead of pip2, else errors (fix) later on)
  4. Make sure your gcc is atleast version 7.5, check using gcc --version ( previous versions untested ).

Build Guide:

git clone https://github.com/Iswenzz/gsclib.git && cd gsclib
conan remote add iswenzz-conan https://iswenzz.jfrog.io/artifactory/api/conan/iswenzz-conan
mkdir build && cd build
conan install .. --build missing --profile:host ../.conan/linux_host.conf --profile:build ../.conan/linux_build.conf

If you see an error like the next screenshot, you will need to specify your compiler version in the above command using -s compiler.version=(whatever number it shows for your cmake).

image

For example, for the above screenshot, the comipler version would be 8.4, so the argument would be -s compiler.version=8.4, and the final command will be conan install .. --build missing --profile:host ../.conan/linux_host.conf --profile:build ../.conan/linux_build.conf -s compiler.version=8.4

Now finalize the build:

cmake ..
cmake --build .

The compiled gsclib.so will be inside build/lib/




Building (Windows)

Pre-Requisites:

  1. Edit plugin_handler.h and recompile your server:
#define MAX_SCRIPTFUNCTIONS 256
  1. CGSC and it's pre-requisites.
  2. CMake and Conan.
  3. Visual Studio with Clang toolset.

Using the Developer Command Prompt for Visual Studio Build Command:

scripts/build_libcom.bat
conan remote add iswenzz-conan https://iswenzz.jfrog.io/artifactory/api/conan/iswenzz-conan
mkdir build && cd build
conan install .. --build missing --profile ../.conan/windows.conf
cmake .. -A Win32 -T ClangCL
cmake --build .

Note: VCPKG integration need to be disabled vcpkg integration remove.

Troubleshouting

For resolving missing dependencies you can use the ldd command for Linux, and Dependency Walker for Windows.

Contributors:

Note: If you would like to contribute to this repository, feel free to send a pull request, and I will review your code. Also feel free to post about any problems that may arise in the issues section of the repository.