Linux migration#359
Merged
Merged
Conversation
Server: - Single-threaded epoll architecture (based on vanilla Meridian59) - osd_linux.c/h, osd_epoll.c: OS abstraction layer - main.c: Unified Windows/Linux with #ifdef - Admin commands via maintenance port (TCP 9998) - Shutdown command + SIGTERM signal handler - PostgreSQL database support (replaces MySQL on Linux) - database_pg.c/h: Full implementation with 46 tables - Async writer thread with queue - Docker compose for PostgreSQL + pgAdmin - A* pathfinding parallelized with OpenMP - UDP protocol support via epoll Build system: - KOD compilation with directory mode (bc -R) for identical resource IDs between Windows and Linux builds - All makefiles updated for Linux (blakserv, blakcomp, util, kod) - blakcomp: dircompile.c ported for Linux path handling Bug fixes (both platforms): - Fixed trailing whitespace in helmet/bergrm makefiles - Fixed corn.bgf -> corn.bof typo in food makefile - Fixed spinebeastbosst.kod -> .bof in trestype makefile - Fixed jixa_smith.kod wrong resource variable names - Fixed case-sensitive file renames for Linux filesystem
…race condition fix - sendmsg.c: Reset message_depth to 0 when corrupt at SendTopLevelBlakodMessage entry/exit, preventing cascading interpreter errors (realtime.bof) - interface_linux.c: Rebuilt console interface - fixed getline newline bug, use SetQuit() for clean shutdown, session counting, admin response output - main.c: Added -i flag for interactive mode with blakadm console, daemon mode (fork) without -i, startup status messages - osd_linux.c/osd_linux.h: Removed interface stubs, now provided by interface_linux.c - blakserv.h: Include interface_linux.h on Linux instead of stubs - makefile.linux: Added interface_linux.obj to build - osd_epoll.c: Added ServerLock around AsyncSocketAccept (race condition fix) - garbage.c: GC now resets all statistics fields (object_id, message_id, time, posts) - user.c: Fixed %I64i format specifier to %llu on Linux
- Strip \r\n after fgets in all text file parsers for Windows line ending compatibility: loadall.c, loadacco.c, config.c, kodbase.c, dllist.c, admincons.c, block.c, adminfn.c (enables loading Windows savegames on Linux) - Strip \r\n in blakod compiler: dircompile.c, kodbase.c (ensures identical BOF/kodbase output regardless of platform) - Handle \0 as line terminator in dircompile.c makefile parser - Case-insensitive file sort in files.c and rscmerge.c to match NTFS ordering - Call MySQLEnd() in MainExitServer for clean database thread shutdown
The custom line parser in LoadKodbase uses \n as a token terminator. The previous strcspn fix removed both \r and \n, breaking the parser and causing 10M+ SetObjectPropertyByName errors when loading Windows savegames. Now replaces \r with \n to maintain parser compatibility while handling Windows line endings.
The LoadKodbase custom line parser uses \n as token terminator and strtol ignores \r at end of numbers. No \r stripping needed - both strcspn and strchr fixes caused Bad class entry errors when loading Windows kodbase files.
- Remove -m32 flags from blakserv and blakcomp makefiles - Fix DWORD/LPARAM typedefs to uint32_t (unsigned long is 8 bytes on 64-bit) - Fix UINT4 in md5.h to uint32_t (fixes RSB hash mismatch with clients) - Fix pointer-to-int casts in blakcomp with intptr_t (kodbase.c, codegen.c) - Update install-build-deps.sh for native 64-bit packages All binary formats (savegames, BOFs, client protocol) use explicit 4-byte integers and remain fully compatible between 32-bit and 64-bit builds. Tested with production savegame (5063 accounts, 0 errors).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Branch to get the server migrated to build on linux. Build on Windows still works.