[7.72] CipSoft Server Windows Port & Unified Standalone (C++17 / SQLite 3 / Embedded Login Server)
Hello OpenTibia Community,
Today I am happy to release a dedicated project for the community: a native Windows port and unified standalone version of the CipSoft 7.72 Server Engine.
GitHub Repository: GitHub - rodrigopaixaorj/tibia-gameserver-unified (https://github.com/rodrigopaixaorj/tibia-gameserver-unified)
1. Credits & Acknowledgements
This project was made possible thanks to prior community milestones:
The original CipSoft binary and Fusion32's decompiled version were strictly tied to Linux (relying on Linux syscalls, POSIX threads, shared memory shmget, and a multi-process architecture split between tibia-login, tibia-querymanager, and tibia-game_server backed by PostgreSQL).
Main Architectural Enhancements:
1. Native Windows Engine (MSVC / CMake / MinGW):
* Full Windows compatibility using Winsock2 (ws2_32.lib), WSAPoll, non-blocking I/O, and platform-agnostic socket lifecycle (src/compat/).
* Modernized multi-threading using C++17 (std::thread, std::mutex, std::condition_variable, std::atomic).
* High-resolution monotonic timers using std::chrono (replaces legacy POSIX gettimeofday/clock_gettime).
* Cryptographic arithmetic ported to MPIR (mpir.dll) and built-in RSA/XTEA/SHA-256 engines.
* Eliminated POSIX shared memory (shm) dependencies.
2. All-in-One Standalone Architecture:
* Integrated the Login Server (Port 7171) and Game Server (Port 7172) into a single executable (tibia-server.exe).
* Embedded an in-process SQLite 3 engine (tibia.db), eliminating the need to set up PostgreSQL or run external QueryManager processes for local development and testing.
3. Tibia 7.72 Protocol Support:
* Built-in native support for the Tibia 7.72 protocol (-DTIBIA772=1), adjusting packet structures, outfits, and network handlers.
3. Comprehensive List of Fixes vs Baseline
A substantial number of decompilation bugs, stability issues, formulas, and creature logic were resolved:
Crash & Stability Fixes:
The included SQLite database is populated with accounts categorized by vocation with password tibia for immediate testing:
5. Quick Start & Building on Windows
Requirements:
Bash:
git clone https://github.com/rodrigopaixaorj/tibia-gameserver-unified.git
cd tibia-gameserver-unified
mkdir build
cd build
cmake .. -A x64
cmake --build . --config Release
Running:
1. Place tibia-server.exe, mpir.dll, config.cfg, tibia.pem, and tibia.db in the server root.
2. Adjust your data paths in config.cfg if needed.
3. Start tibia-server.exe.
4. Connect using a Tibia 7.72 Client (IP: 127.0.0.1, Port: 7171).
Source Code & Repository:
GitHub - rodrigopaixaorj/tibia-gameserver-unified (https://github.com/rodrigopaixaorj/tibia-gameserver-unified)
Feedback and pull requests are welcome!
Hello OpenTibia Community,
Today I am happy to release a dedicated project for the community: a native Windows port and unified standalone version of the CipSoft 7.72 Server Engine.
GitHub Repository: GitHub - rodrigopaixaorj/tibia-gameserver-unified (https://github.com/rodrigopaixaorj/tibia-gameserver-unified)
1. Credits & Acknowledgements
This project was made possible thanks to prior community milestones:
- @Toor for originally sharing the virgin CipSoft 7.7 files/tarball (7.7 RealOTs / CipSoft Virgin Files).
- @fusion32 for the tremendous reverse engineering and C++ decompilation effort (Tibia 7.7 Server Decompiled).
The original CipSoft binary and Fusion32's decompiled version were strictly tied to Linux (relying on Linux syscalls, POSIX threads, shared memory shmget, and a multi-process architecture split between tibia-login, tibia-querymanager, and tibia-game_server backed by PostgreSQL).
Main Architectural Enhancements:
1. Native Windows Engine (MSVC / CMake / MinGW):
* Full Windows compatibility using Winsock2 (ws2_32.lib), WSAPoll, non-blocking I/O, and platform-agnostic socket lifecycle (src/compat/).
* Modernized multi-threading using C++17 (std::thread, std::mutex, std::condition_variable, std::atomic).
* High-resolution monotonic timers using std::chrono (replaces legacy POSIX gettimeofday/clock_gettime).
* Cryptographic arithmetic ported to MPIR (mpir.dll) and built-in RSA/XTEA/SHA-256 engines.
* Eliminated POSIX shared memory (shm) dependencies.
2. All-in-One Standalone Architecture:
* Integrated the Login Server (Port 7171) and Game Server (Port 7172) into a single executable (tibia-server.exe).
* Embedded an in-process SQLite 3 engine (tibia.db), eliminating the need to set up PostgreSQL or run external QueryManager processes for local development and testing.
3. Tibia 7.72 Protocol Support:
* Built-in native support for the Tibia 7.72 protocol (-DTIBIA772=1), adjusting packet structures, outfits, and network handlers.
3. Comprehensive List of Fixes vs Baseline
A substantial number of decompilation bugs, stability issues, formulas, and creature logic were resolved:
Crash & Stability Fixes:
- Added missing exception handlers (try-catch) across critical ticks (TMonster::IdleStimulus, RefreshSector, CreateField).
- Fixed crash occurring when summons attempted to attack right before despawning (#28).
- Fixed crash on damage calculation when attacks had no valid attacker entity.
- Fixed buffer overrun when matching spell syllable strings.
- Fixed character death recording logic and playerlist creation errors.
- Fixed sector refresh delay logic on server startup.
- Fixed player file murder timestamp persistence.
- Fixed "Challenge" spell (exeta res) mechanics.
- Fixed GM spells (aleta cogni and aleta grav door permission management).
- Corrected Ultimate Healing (UH) formula calculation.
- Fixed TStrengthImpact fist skill bitmasking (SKILL_FIST).
- Fixed angle-shaped/wave spells trajectory and collision line checks (fixes #5).
- Fixed Burst Arrow area-of-effect damage distribution (fixes #13).
- Fixed Spellbook display issue where spells were not rendered (fixes #6).
- Fixed PVP-Enforced experience distribution condition (#50).
- Fixed IMPACT_SUMMON logic and prevented summons from recursively spawning summons (#51).
- Fixed yell exhaustion timer (fixes #12).
- Fixed monsters freezing after failing an attack animation/step.
- Fixed flee logic and attack probability for fleeing monsters (solves #1).
- Corrected SearchFlightField and flight direction preference to match original CipSoft binary behavior (#53).
- Fixed SearchSpawnField expansion and radius calculations.
- Fixed NPC response delay calculation and talk delay multipliers.
- Corrected monster target selection and combat stimulus logic.
- Fixed CloseContainer and NotifyTrades search radius calculations.
- Fixed cumulative item deletion and container throw loot bugs (CUMULATIVE + THROW) (#56).
- Fixed trade/item exchange mechanics (fixes #8).
- Fixed level/quest doors closing logic (fixes #14).
- Fixed look description on named doors (NAMEDOOR) (fixes #4).
- Fixed rope action (RETRIEVE).
- Fixed player state desynchronization on login (#59).
- Fixed VIP and Channel initialization values that previously triggered client assertions.
- Configured TCP_NODELAY and default INADDR_ANY binding for robust socket handling.
- Added optional local proxy header support (-DALLOW_LOCAL_PROXY=1).
The included SQLite database is populated with accounts categorized by vocation with password tibia for immediate testing:
| Account | Password | Vocation / Role | Characters |
|---|---|---|---|
| 111111 | tibia | Knights & Elite Knights | 12,485 |
| 222222 | tibia | Sorcerers & Master Sorcerers | 7,907 |
| 333333 | tibia | Druids & Elder Druids | 7,058 |
| 444444 | tibia | Paladins & Royal Paladins | 6,114 |
| 555555 | tibia | No Vocation / Rookgaard | 30,909 |
| 666666 | tibia | GameMasters (All GM rights enabled) | 38 |
5. Quick Start & Building on Windows
Requirements:
- Windows 10/11 x64
- Visual Studio 2019/2022 (with "Desktop development with C++") or MinGW-w64
- CMake 3.15+
Bash:
git clone https://github.com/rodrigopaixaorj/tibia-gameserver-unified.git
cd tibia-gameserver-unified
mkdir build
cd build
cmake .. -A x64
cmake --build . --config Release
Running:
1. Place tibia-server.exe, mpir.dll, config.cfg, tibia.pem, and tibia.db in the server root.
2. Adjust your data paths in config.cfg if needed.
3. Start tibia-server.exe.
4. Connect using a Tibia 7.72 Client (IP: 127.0.0.1, Port: 7171).
Source Code & Repository:
GitHub - rodrigopaixaorj/tibia-gameserver-unified (https://github.com/rodrigopaixaorj/tibia-gameserver-unified)
Feedback and pull requests are welcome!