Skip to content
KP
All projects
Server·2024In progress

SRCMainGS 5.2

MU Online server source, six C++ components from packet encryption to client

C++Visual StudioImGuiLuaOpenGLMSSQL
highlights
  • Six components GameServer, ConnectServer, JoinServer, DataServer, Encoder, Main5.2 client
  • Packet encryption between client and server
  • Custom systems Dragon Tower, mob spots, change class, anti-hack
  • Client built on ImGui + OpenGL with Lua scripting bindings
  • Search party, daily quests, top-hit, market and ranking systems
  • CRC32 / MD5 / Math utility libraries shared across components

Overview

SRCMainGS is a MU Online server source for Season 5.2, six interconnected C++ projects compiled in Visual Studio. The same codebase ships the game server, connect server (load balancer), join server (authentication), data server (DB facade), encoder (packet encryption tool) and the client itself.

Problem

Public MU Online server sources are messy, decades of patches glued together, no architectural boundaries, vendor binaries everywhere. Adding a feature like Dragon Tower or fixing packet desync touches half the codebase. The code lives in a state where you either rewrite or you give up.

Solution

Strict component boundaries with a shared Util/ library (CRC32, MD5, Math). Each component is a separate .sln so the build graph is explicit. The client uses ImGui for in-game UI and Lua scripting for hot-loadable behavior.

Custom systems added on top of vanilla 5.2: Dragon Tower (instance + leaderboard), mob spot system (Daily quest hook), tophit quest, market/shop rework, change-class with requirement validation, debuff system, option rarity, active invasion (mini-boss waves), block/unblock player commands.

Tech rationale

  • Visual Studio + C++: native MSVC toolchain matches the original codebase, no cross-compilation pain
  • ImGui + OpenGL: debug overlays and in-game tooling without building a full UI framework
  • Lua: gameplay scripting where C++ rebuild cycles are too slow
  • MSSQL: schema compatibility with existing MU databases is non-negotiable
  • Separated components: .sln per project means I can rebuild GameServer without touching the client

Lessons learned

  • Packet encryption sounds scary then turns out to be three XOR rounds and a lookup table
  • Lua hot-reload pays for itself the first time you ship a balance change without restarting
  • Anti-hack in legacy MU is a cat-and-mouse game, speed checks and packet validation get you 80% there