Skip to content

Project Setup (Linux)

twostars edited this page Jan 13, 2026 · 6 revisions

Important

Only the server programs can be built and run on Linux. The client and tools currently require Windows to build. Cross-platform support for the client is underway.

A client executable, compiled on Windows, can be run using Proton if you're solely focused on server development.


Contents


  1. Prerequisites
  2. Fork the Repository
  3. IDE Setup
  4. Database Setup
  5. ODBC Setup
  6. Server Configuration

Prerequisites


This is the guide for the Linux-based project setup. If you're looking for Windows, see Project Setup (Windows).

You'll need the following to work with the project:

  • CLion
  • Dependency packages listed below

Install Dependency Packages

You'll need the following dependencies installed on your system:

package description
unixodbc ODBC tools (like odbcinst)
unixodbc-dev ODBC build headers and libraries
msodbcsql Microsoft MSSQL ODBC driver v18
docker Docker is an container management platform
git Git is a source code management tool

Below are the commands for a few popular package managers.

apt (Debian, Ubuntu, others)

sudo apt install unixodbc unixodbc-dev git
sudo ACCEPT_EULA=Y apt install msodbcsql18

pacman (Arch)

sudo pacman -S unixodbc msodbcsql docker git

yay (Arch AUR)

sudo yay -S unixodbc msodbcsql docker git

homebrew (Mac)

brew install unixodbc docker git
brew tap microsoft/mssql-release
brew install msodbcsql18


Fork the Repository


Fork the Knight Online repository then clone your fork to your machine. If you're unfamiliar with Git, see our Using Git page for help.


IDE Setup (CLion)


Our current IDE recommendation for Linux-based platforms is CLion. This IDE is free for non-commercial use, and this is a non-commercial project. Installation is left to the user to figure out as it varies by distribution.

Once installed, you should see the following welcome screen. Click the "Open" button and select the folder of your git repository (KnightOnline).

image

CLion should automatically detect the CMake build files used to build the Server projects. You should be able to just accept default configuration for the Debug profile:

image

It will take a moment for the project indexes and CMake caches to build. You'll know when this is complete when the progress bar in the lower-right goes away:

image
image

The CMake build configurations should now be loaded and available in the Run Configurations section (top-right corner of the IDE):

image

Build and run the servers in the typical order: AIServer > Ebenezer > Aujard > VersionManager

Compiled server files (and configuration) will be written to cmake-build-debug/bin/Debug. Default configuration files will be generated on first run. These do not need to be updated unless you're using an altered ODBC DSN.

If your SQL Server, ODBC, and server configuration files are setup correctly then you should see the program launch after a successful build:

image


Database Setup


It is recommended to use our docker image and scripts for development on Linux. See the Docker README.MD for guidance.

SQL Server does have support for some Linux distributions. If you want to attempt a manual setup, see SQL Server Manual Setup.


ODBC Setup


Note that this assumes you've either:

  • Successfully started the Docker database container, OR
  • Manually restored the database as "KN_online" (if you restored it as something else, be sure to use its new name appropriately).

Update ODBC configuration files

To find the location of your odbc configuration files, run the following in a terminal:

odbcinst -j

We're interested in location of the driver and system data source configuration files:

DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini

Edit these files to configure your ODBC connection:

  1. Edit odbcinst.ini and ensure that the following driver registration exists (your driver location may vary):

[ODBC Driver 18 for SQL Server]
Description=Microsoft ODBC Driver 18 for SQL Server
Driver=/opt/microsoft/msodbcsql/lib64/libmsodbcsql-18.5.so.1.1
UsageCount=1

  1. Edit odbc.ini and add the following entry (if you do not already have it). Update the Server and Database information to match your configuration.

[KN_online]
Description = Knight Online SQL Connection
# Driver must match the driver name (in brackets) from odbcinst.ini
Driver = ODBC Driver 18 for SQL Server
Server = localhost,1433
Database = KN_online
Port = 1433
UID = knight
PWD = knight
Encrypt = no
TrustServerCertificate = yes
ConnectionPooling = yes

Test your connection

Using unixodbc's isql tool, we can test our odbc connection to our database. The general syntax for the command is: isql -v (DSN Name) (User) (Password)

For an out-of-the-box solution, this will typically be: isql -v KN_online knight knight

This should open an interactive SQL prompt if your connection is successful. You can run a test query here, if desired: SELECT * FROM TB_USER

Enter quit to close the interactive SQL console.

Optional: Connect CLion to your database

To connect CLion to your development database, see CLion SQL Client Setup.


Server Configuration


The server applications will generate their default configuration the first time they are run. If new configuration is added, the server will add the default value to the file on the next run.

If you feel compelled to change the default configuration, you can edit the .ini file for the application.

Under cmake-build-debug/bin/Debug/:

Application Configuration File
AIServer server.ini
Ebenezer gameserver.ini
Aujard Aujard.ini
VersionManager Version.ini
ItemManager ItemManager.ini

Clone this wiki locally