Skip to content

2021 Source (232 heroes)

Access: Contributor, Core

Read Before You Start first. This page only covers what is specific to the 2021 source.

Heroes 232
Visual Studio 2010 (toolset v100), Win32
Database scripts Yes: full schema and stored procedures for three databases (needs SQL Server 2022)
Server config files Included in server-config\: the original, unmodified set from the Korean service, with gameplay tables
ls_query.ini Included in server-config\ls_dbagent\
Client Separate download: a Korean client with 231 heroes (one hero short of this source), see Client
Folder What is in it
win\ 25 solutions, with server and library projects in win\projects\
src\ Source code: servers, client, engine, launcher (LSAutoUpgrade), LSWebBroker, tools, gperftools, ziparchive
lib\ Prebuilt libraries and DLLs, plus msado15.tlh/.tli for the DB agent
extra\ Billing-server libraries (LS_HTTP, LS_NXSoap, LS_RestAPI, tinyxml, lib, include). Not in the original release; the community repository adds them from the 2019 source.
LosaGame.sql, LosaGame_Log.sql, LosaLogData.sql Database scripts

The three scripts were generated by SQL Server Management Studio and are saved as UTF-16. They use compatibility level 160, so you need SQL Server 2022.

Script Database Contents
LosaGame.sql LosaGame 134 tables, 1061 stored procedures, 9 functions, 6 views
LosaGame_Log.sql LosaGame_log 20 tables, 2 stored procedures
LosaLogData.sql LosaLogData 67 tables, 81 stored procedures
  1. Create the folder C:\LosaDB\. The scripts place the data and log files there. Or edit the FILENAME paths at the top of each script.

  2. Run the three scripts in SQL Server Management Studio. Each one creates its own database.

  3. Each script ends with a CREATE USER for the login lstggame (and lstglog in LosaLogData). If those logins do not exist yet, that statement fails with error 15007 and everything else still imports. Create the logins first, or ignore that one error and add users later.

  • extra\ folder. The billing server projects expect extra\ (LS_HTTP, LS_NXSoap, LS_RestAPI, tinyxml), which the original release does not have. The community repository includes those folders (plus extra\lib and extra\include) from the 2019 source, so ls_billingsvr builds without other changes.
  • Listed but missing headers: ls_gamesvr\INILoader\BaseDataManager.h, ls_mainsvr\BoostPooler.h, the client’s Xtrap\XTrapSDK_Integrity.h, and ConsoleTextColorDefine.h for TownPortal and LSLogClient. They are leftovers in the project files; the build test below succeeds without them.
  • Encoded DB password. ls_dbagent.exe -x <password> prints the encoded form to put in the [SQL] PW key.
  • Client Debug sheet. src\LSClient\DebugSheet.props copies the client to C:\LosaMyDev and expects C:\Bonus\lib\. Create those folders or edit the sheet.
  • Fixed output folders. Some Debug builds write to D:\LostSaga\Korea\Server\... or D:\Work\trunk\build\.... Change the Output Directory if needed.
  • Hard-coded test addresses exist in ls_mainsvr\MainProcess.cpp (CheckTestZone) and the client’s ioApplication.cpp. In the community repository the public ones are the placeholder 192.0.2.1 (a reserved address that never matches); replace them with your own.
  • Launcher chain. In production the client starts through the web browser, then LSWebBroker, then LSAutoUpgrade, then LostSaga.exe. For development, use the debug login described in Before You Start.

The client for this release is a Korean client with 231 heroes (one short of this source), taken from the Nova private server and shared as a separate download (about 1.7 GB zipped, 3.8 GB unpacked), not in Git. Its data is not packed: config\, xml\, resource\, scripts\ and shader\ are plain folders, so you can read and edit everything directly.

  • The programs are rebuilt from this source (Release): lostsaga.exe, io3dengine.dll, iofreetype.dll, lslog.dll, townportal.dll and iopac.dll. The other DLLs come from the source tree’s lib\ folder and from the DirectX June 2010 and VC++ 2010 redistributables. bdcap32.dll and Flash9f.ocx are kept from the original client.
  • Removed: the launch files with real login data, saved accounts, logs, the Nova launcher and command generator, GameGuard, the web broker, uninstaller, crash dumper and unused DLLs, plus leftovers (resource\swf.rar, .bak files).
  • Addresses were replaced with 127.0.0.1: log_server_ip in config\sp2.ini, load_url and file_server_ip in config\sp2_guild.ini, storage_url in config\sp2_custom_texture.ini. Set them to your own servers. The config\sp2_channeling_*.ini files still hold the old official Korean web addresses.
  • start.bat.template shows the launch line with every value removed. Copy it to start.bat and fill in the values from your own login server, or use the debug login in Before You Start. This Release build is not a shipping build: the options field stays 0, because this client has no rs.iop/map.iop (see How the login works).

Tested on 2026-11-07 on one Windows machine: all nine server processes start and talk to each other, and three test accounts log in to the game server (CONNECT_OK with the full login data). The client was then played against these servers: login, lobby, rooms and a match work. Three windows still have layout problems from the modified client data (being fixed).

In the original service the publisher web site logged the player in and started the client with a key. The 2021 (Korean) game server only checks that key against the database, so for a local setup you build the key yourself:

  • The client’s command line is <check block>?<key>?<options>?<IP key>?<server address>?.... For this client the options field is just 0, and the field after it is the IP key.
  • Key = SEED-encoded login key (30 hex characters) + SEED-encoded user ID. IP key = the same 30 characters + the encoded IP address. The user ID and IP are encoded with the “second key”, the newest row of define_encode_key in LosaGame. The code is ioLocalKorea::ParseLoginData and Util\ioEncrypted.cpp in the game server; tools\lskey21.cpp in the ZIP is a small command-line version.
  • The game server then reads game_login_get_data: the user must exist in userMemberDB/userLoginDB, userLoginDB.userIP must equal the IP inside the IP key, and gameServerID must be 0. With [TEST] LocalTest=1 in ls_config_game.ini (the original value) the login key itself and its 30-minute expiry are not checked.
  • The server address is the IPv4 address and port packed into one 64-bit number (address bytes first): 127.0.0.1 port 21009 is 90232984699007.
  • Listen address. The servers listen on the address of your network adapter (gethostbyname of the host name), and the relay and login servers on 0.0.0.0, never on 127.0.0.1. Either use your LAN address everywhere, or set LS_BIND_IP=127.0.0.1 before starting: the community repository reads that environment variable in place of the adapter address and the hard-coded "0.0.0.0". Without the variable nothing changes.
  • Game server tables. ls_gamesvr loads binary tables from config\tables\*.dat and stops if one is missing or has another header version. They are not in any release. LSC_SnakeLadders_Move.dat from the client works; the ZIP has empty tables with the right version for the other seven, so the dice event, practice mode, gashapon boxes, hero items/weapons and excavation have no data.
  • Account type. userMemberDB.cpType must be -1. The default 0 means Wemade channeling, and the server refuses those users.
  • User ID length. 4 to 12 characters.
  • Client version. The rebuilt client reports version 1, so set [ClientVersion] IsUse=0 (or ClientVersion=1) in ls_config_main.ini.
  • Anti-cheat. [NProtect] use=0 in ls_config_game.ini; the client has no GameGuard.
  • Client ports. In the client, config\sp2.ini log_server_port is the DB agent in log server mode and config\sp2_guild.ini file_server_port is the file write server.
Server Port
ls_mainsvr 21000 (servers), 21001 (GM tool)
ls_dbagent game / log DB / log server 21011 / 21012 / 21013
ls_billingsvr 21021 (21022 monitor, 21023 GM tool)
ls_gamesvr 21009 (client, TCP and UDP), 21031 (relay and login), 21032 (monitor)
ls_relaysvr 21055
ls_loginsvr 21005
ls_filewritesvr 21030
  • No billing: every cash purchase fails, and the billing server keeps retrying a publisher connection (log noise only).
  • The DB agent logs QUERY DISMATCH FIELDS ... 2112 once: game_spirit_get_data returns different columns than the main server expects.

The community repository has a few small fixes on top of the original release. PATCHES-LosaDev.md at the repository root lists every one of them. Built on 2026-11-07 from that repository in Release|Win32 with the v100 toolset, the Version.h fix and static-runtime Boost:

Solution Result
ioINILoader, Log, LogDLL, FrameTimerDLL, iocpSocketDLL, LSLog, SharedContainer, PerfMon, TownPortal, ioFreeType Build
io3DEngine Builds
ls_dbagent, ls_mainsvr, ls_billingsvr, ls_gamesvr, ls_relaysvr, ls_loginsvr, ls_filewritesvr Build
LSClient Builds LostSaga.exe in src\LSClient\Release\ (about 6 minutes)
ioPac Builds (with the BigPac fix below)
  • ls_relaysvr failed with C2661: Manager.cpp called UDPNode::InitMemory with 5 arguments, but iocpSocketDLL (source and prebuilt library) only has 3- and 7-argument versions, and no other version exists in any of the three releases. The 2014 relay server has the same line with the last two arguments commented out, so the repository now does the same: InitMemory(3000,16384*2,6000/*,6000,1000*/).
  • ls_billingsvr needed the extra\ folder (see above).
  • LogDLL and FrameTimerDLL copy their DLL into build\zone_office\... after building. That step now skips folders that do not exist instead of failing the build.
  • ioFreeType linked ../LSLog/bin/LSLog.lib, a folder this release does not have (LSLog builds into lib\). src\ioFreeType\StdAfx.h now points at ../../lib/.
  • ioPac did not compile: BigPac.cpp is newer than BigPac.h (the header is the 2014 one) and uses members and functions the header does not declare. BigPac.h now declares them, and OpenBigPacAll (IOP Manager only) is wrapped in #ifdef STATIC_PAC_API like the function it calls. The rebuilt iopac.dll exports everything the original did.

Real addresses, keys and accounts were taken out of the code before it was shared. PATCHES-LosaDev.md lists every file:

  • Public IP addresses the code connects to are 127.0.0.1; where the code compares the server’s own IP against a fixed list, the address is 192.0.2.1 (reserved, never matches).
  • Publisher, operator and game-service host names (Nexon, Gemscool, Z8Games, Garena, PlayPark, Valofe, OGPlanet, Daum, the old lostsaga.com web, patch and CDN hosts and others) are gone: URLs start with http://127.0.0.1/ and keep their path, bare host names are example.invalid, and staff e-mail domains are @example.invalid.
  • Passwords, API keys, app ids, hash keys, login tokens, test accounts and anti-cheat license strings are CHANGE_ME.
  • Vendor SDK binaries (XTrap libraries, bxIPGClient.dll) are not included. The billing server uses a small stand-in header for bxIPGClient, so it still builds; the Japan IPG and Adbill billing calls just fail.

Point these at your own servers when you need them. The pack passwords and the client/server protocol keys were kept, because the game needs them.

  • Turn the multi-machine server-config\ set into a ready one-machine set.
  • Add the missing headers listed above, or remove them from the project files.