Skip to content

Conversation

@kvirund
Copy link
Collaborator

@kvirund kvirund commented Jan 31, 2026

No description provided.

@kvirund kvirund force-pushed the world-load-refactoring branch 2 times, most recently from d4c7438 to 1bfd178 Compare February 1, 2026 01:17
kvirund and others added 27 commits January 31, 2026 19:56
Step 1 of world loading refactoring plan - baseline checksums.

New files:
- src/engine/db/world_checksum.h/cpp: CRC32-based checksum calculation
  for zones, rooms, mobs, objects, and triggers

Features:
- Calculates individual checksums per entity type using XOR aggregation
- Combined checksum for detecting any world data changes
- Detailed per-object checksums saved to file for diff analysis
- CLI flag -C to disable checksum calculation

Integration:
- Checksums calculated at end of GameLoader::BootWorld()
- Results logged to syslog and saved to checksums_detailed.txt

CMake additions:
- FULL_WORLD_PATH option for specifying full world data location
- Automatic setup of small/full data directories in build dir

Baseline checksums:
  Small World (lib):     Combined: 4E6499FF
  Full World:            Combined: BB58755C

Detailed checksums saved in checksums_small.txt and checksums_full.txt
for future comparison after refactoring.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Introduces an interface-based abstraction layer for world data loading:
- IWorldDataSource interface with LoadZones/Triggers/Rooms/Mobs/Objects
- LegacyWorldDataSource wraps existing BootIndex() calls
- GameLoader::BootWorld() now accepts optional data source parameter
- Excludes zone_rn from room checksums (runtime-calculated value)
- Fixes compiler warnings (unused variable, strncpy truncation)

Checksums verified identical before/after refactoring:
- Small world: B6DA5931
- Full world: 82CF7A3E

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add optional SQLite support via HAVE_SQLITE CMake flag
- Create SqliteWorldDataSource skeleton class (load methods not yet implemented)
- Add Save methods to IWorldDataSource interface for OLC
- Implement Save methods in LegacyWorldDataSource (delegates to *_save_to_disk)
- Add trigedit_save_to_disk function for trigger saving
- Fix compiler warnings in utils.cpp (array bounds, strncpy truncation)
- Add Claude Code workflow rules to CLAUDE.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add complete implementation for loading world data from SQLite database:
- Zones with commands (M,O,G,E,P,D,R,T,V,Q,F) and typeA/typeB groups
- Triggers with script parsing into cmdlist
- Rooms with flags, exits, triggers, and extra descriptions
- Mobs with flags, skills, triggers, and all attributes
- Objects with extra/wear/no/anti flags, applies, triggers, extra descriptions

Schema matches mud-docs/world_schema.sql specification.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- GetText now returns std::string with UTF-8 to KOI8-R conversion
- Add SafeStoi/SafeStol helper functions for safe string-to-number conversion
- Fix all const char* usages to std::string
- Fix to_room to store vnum (not rnum) - RosolveWorldDoorToRoomVnumsToRnums will convert later
- Fix top_of_mobt to be last valid index (not count) for compatibility with CreateBlankMobsDungeon

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove -S command line option for SQLite database path
- Move chdir() before config loading so paths are relative to data dir
- Fix configuration.xml path to be relative (misc/ instead of lib/misc/)
- Auto-detect world.db in data directory: if exists use SQLite, else legacy

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add direction_map to convert direction strings (north/east/etc) to numbers
- Fix DOOR command arg2 to use direction_map instead of SafeStoi
- Add load_prob (arg4) loading for GIVE_OBJ commands

Zones checksums now match between legacy and SQLite loaders.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Set NPC flag before set_level() to avoid clamping mob levels to 34
  (kLvlImplementator limit for non-NPCs)
- Fix long_descr/description column swap (columns 8 and 9)
- Set max_hit to 0 (flag for dice-based HP calculation)
- Add trigger existence validation with warnings for missing triggers
- Use ORDER BY rowid for predictable trigger loading order
- Skip non-existent triggers instead of adding invalid references

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add tests/utils.encoding.cpp with unit tests for utf8_to_koi function
  covering ASCII, Cyrillic, NO-BREAK SPACE, and box drawing characters
- Fix NO-BREAK SPACE (U+00A0) conversion: UTF-8 0xC2 0xA0 -> KOI8-R 0x9A
- Add lib symlink creation in CMake for running server from build directory

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add sex field to SQL query and loading code
- Fix set_level vs set_minimum_remorts bug (was reading level column
  but calling wrong setter)
- Update column indices for max_in_world after sex addition

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- SQLite loader now calculates zone_rn incrementally by vnum (matching Legacy)
- Add extra_flags, anti_flags, no_flags, affect_flags to object checksum
- Add extra_descriptions to object checksum

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…lags

- Add kTrap to obj_type_map for proper type loading
- Handle NULL max_in_world by returning -1 (matching Legacy behavior)
- Add affect flag category handling for object weapons

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
… loader

- Add kElementWeapon, kMissile, kWorm, kCraftMaterial2 to obj_type_map
- Add missing extra flags (kSwimming, kFlying, kThrowing, plane 1 flags)
- Apply colorLOW to short_description and PNames (match Legacy loader)
- Apply colorCAP to description (match Legacy loader)
- Add utils_string.h include for colorLOW/colorCAP
- Update CLAUDE.md with SQLite world conversion documentation
- Add patch-based editing guidance to CLAUDE.md

Objects match: 99.7% (13 remaining differences)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Clear runtime flags (kTransformed, kTicktimer) after loading objects
- Set max_in_world to -1 for objects with kZonedacay or kRepopDecay flags

This ensures SQLite loader produces identical object prototypes to Legacy.
All 5192 objects now match (100% checksum match).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use normalized trigger_type_bindings table with JOIN query
- Compute trigger_type bitmask from type_chars (a-z = bits 0-25, A-Z = bits 26-51)
- Add TrimRight for script lines to remove trailing whitespace
- Add indent_trigger call to normalize script indentation
- Include dg_olc.h for indent_trigger function

All world checksums now match between Legacy and SQLite loaders.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Read obj_type_id, sector_id, attach_type_id, direction_id directly
- Read location_id, skill_id, arg_wear_pos_id, arg_direction_id directly
- Remove unused text-to-enum conversion maps
- Use static_cast for direct integer-to-enum conversion
- Matches normalized schema in mud-docs

All checksums verified to match between Legacy and SQLite loaders.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Added tools/:
- convert_to_yaml.py: Legacy world to SQLite/YAML converter
- world_schema.sql: SQLite database schema
- sqlite-world-schema.md: Schema documentation
- compare_world_checksums.sh: Test script for verifying checksums

Updated .gitignore to exclude build directories.
Removed generated checksum files (now in test builds).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add 'enabled' column to SQLite schema for zones, rooms, mobs, objects,
  triggers to support index file filtering
- Update converter to read index files and mark non-indexed entities
  as disabled (enabled=0)
- Update SQLite loader to filter on enabled=1, matching Legacy behavior
- Add minimum_remorts column to objects table
- Add detailed checksum comparison infrastructure:
  - SaveDetailedBuffers() saves serialization buffers per entity
  - LoadBaselineChecksums() loads baseline for comparison
  - CompareWithBaseline() reports mismatches with field-level detail
- Update compare_world_checksums.sh with --rebuild and --reconvert flags
- Fix room exit serialization to use vnum instead of rnum

Checksum verification: Small world shows 100% match between Legacy and
SQLite loaders (zones, rooms, mobs, objects, triggers all identical).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When built with HAVE_SQLITE support but world.db file is not found,
exit with error instead of silently falling back to legacy loader.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Restored KOI8-R encoding (was corrupted in 0c9ca3c)
- Added includes for world_checksum, legacy/sqlite data sources
- Renamed world_loader to game_loader
- Refactored BootWorld to use IWorldDataSource abstraction
- Added checksum calculation and baseline comparison at boot
- Added no_world_checksum flag to disable checksums

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- setup_test_dirs.sh: Creates test directories for Legacy/SQLite comparison
- run_load_tests.sh: Runs performance tests and compares checksums
- Add test/ and magic.mgc to .gitignore

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The Trigger constructor expects rnum (runtime array index) as the first
parameter, not vnum (persistent database ID). Passing vnum caused
out-of-bounds array access in GET_TRIG_VNUM macro when the vnum was
larger than the trig_index array size, resulting in segfaults during
zone reset on larger worlds.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Filter files by pattern ^\d+\.<ext>$ to ignore backup files like 16.old.obj
- Fix armor parsing for negative values (use lstrip('-').isdigit())
- Use \r\n for joining multi-line aliases and case names (Legacy fread_string
  converts \n to \r\n)
- Remove .strip() calls that were removing control characters like \x1d
- Keep trailing spaces in aliases to match Legacy behavior

This significantly reduces checksum differences:
- MOB: 1354 → 1
- OBJ: still has differences (to be investigated)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Schema changes:
- Replace UNIQUE constraint on entity_triggers with trigger_order column
- Allows duplicate triggers (same trigger attached multiple times)

Converter changes:
- Add trigger_order field for proper trigger ordering
- Fix plane 2 offset in parse_ascii_flags (43 → 60)
- Each plane has 30 bits, not varying sizes

Loader changes:
- Add explicit flag maps for affect, anti, no flags
- Replace ITEM_BY_NAME with direct map lookups
- More reliable flag loading without silent failures

Progress (small world after reconvert):
  Zones:    100.0% (0 diff)
  Rooms:     99.9% (3 diff - missing kNoItem plane 2 flag)
  Mobs:     100.0% (0 diff)
  Objects:  100.0% (0 diff)
  Triggers: 100.0% (0 diff)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Changes:
- Add --skip-encoding option
- Check for UTF-8 BOM and Cyrillic in source files
- Increase default dump count to 10
- Add buffer comparison for all entity types (rooms, triggers, zones)
- Show field-by-field diff using | separator
- Use temp files to avoid binary file issues with diff

Progress (small world):
  Zones:    100.0% (0 diff)
  Rooms:     99.9% (3 diff - missing kNoItem plane 2 flag)
  Mobs:     100.0% (0 diff)
  Objects:  100.0% (0 diff)
  Triggers: 100.0% (0 diff)

Progress (full world):
  Zones:     44.6% (354 diff)
  Rooms:     99.0% (435 diff)
  Mobs:     100.0% (0 diff)
  Objects:   99.5% (95 diff)
  Triggers:  97.8% (367 diff)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Converter:
- Add load_prob parsing for E (EQUIP_MOB) command

Loader:
- Add arg4 (load_prob) reading for EQUIP_MOB commands
- Add arg4 (load_prob) reading for PUT_OBJ commands

Progress (full world):
  Zones:     78.7% (136 diff - zone.group not loaded yet)
  Rooms:     99.0% (435 diff - kNoItem flag)
  Mobs:     100.0% (0 diff) ✓
  Objects:   99.5% (95 diff)
  Triggers:  97.8% (367 diff)

Progress (small world):
  Zones:    100.0% ✓
  Rooms:     99.9% (3 diff - kNoItem flag)
  Mobs:     100.0% ✓
  Objects:  100.0% ✓
  Triggers: 100.0% ✓

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
kvirund and others added 30 commits February 11, 2026 12:43
Проблема: Cygwin падал на Configure CMake
Причина: Не хватало gcc-core пакета

Исправлено:
- Добавлен gcc-core (core GCC package)
- Исправлен libexpat-devel -> libexpat1-devel (правильное имя в Cygwin)

Теперь Cygwin должен доходить до компиляции.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Разделены комбинированные шаги на отдельные Configure и Build:
- WSL: "Configure and Build in WSL" -> "Configure CMake in WSL" + "Build in WSL"
- MinGW: "Configure and Build" -> "Configure CMake" + "Build"

Теперь видно где именно падает:
- ✅ Configure CMake - технические проблемы с контейнером/зависимостями
- ✅ Build - проблемы компиляции кода (ожидаемо)

Это помогает отладке - падение на Configure = нужно чинить контейнер,
падение на Build = проблемы кода (нормально для soft-failure).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…n comm.cpp

PROBLEM 1: zone_table[0] kNowhere bug in Legacy loader
- Commit 4624bf2 fixed YAML loader to reserve zone_table[0] for kNowhere
- But Legacy loader still loaded zones starting from zone_table[0]
- This caused "FATAL: Trigger 100 belongs to non-existent zone 1" error
- GetZoneRnum(1) returned 0, which equals kNowhere → false positive

SOLUTION:
1. db.cpp: Reserve zone_table[0] in PrepareGlobalStructures()
   - zone_table.resize(rec_count + 1) instead of rec_count
   - Matches YAML loader and world[0] room design

2. boot_data_files.cpp: Start zone indexing from 1
   - s_zone_number = 1 instead of 0
   - Zones now load into zone_table[1..N] instead of [0..N-1]

PROBLEM 2: Corrupted Russian text in comm.cpp
- 5 log/sprintf/act strings had corrupted UTF-8 (О©╫ characters)
- File encoding was broken (KOI8-R interpreted as UTF-8)

SOLUTION:
- Restored original Russian text for all 5 strings:
  * "Перезагрузка через " (reboot message)
  * "Закрываем через " (shutdown message)
  * "$n вернул$u." (character returned)
  * "$n потерял$g связь." (lost connection)
  * "защитать свиток.возврата" (antidc command)
- File now in proper KOI8-R encoding

TESTS:
- Small_Legacy_checksums: PASS (boot: 2.330s, checksum: 1.809s)
- Small_YAML_checksums: PASS (boot: 2.333s, checksum: 1.755s)
- Checksums MATCH: Zones, Rooms, Mobs, Objects, Triggers all identical
- No more "Trigger belongs to non-existent zone" errors

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
PROBLEM:
- SQLite loader had the same zone_table[0] bug as Legacy loader
- Zones loaded into zone_table[0..N-1] instead of [1..N]
- zone_table[0] should be reserved for kNowhere (sentinel value)
- Full world test failed: "FATAL: Trigger 100 belongs to non-existent zone 1"

ROOT CAUSE:
- LoadZones() used zone_table.resize(zone_count) without +1
- zone_idx started from 0, loading first zone into zone_table[0]
- GetZoneRnum(1) returned 0, which equals kNowhere → false positive

SOLUTION:
1. Reserve zone_table[0] in LoadZones():
   - zone_table.resize(zone_count + 1)
   - zone_table.reserve(zone_count + 1 + dungeons::kNumberOfZoneDungeons)

2. Start zone indexing from 1:
   - int zone_idx = 1 (was 0)
   - Loop condition: zone_idx <= zone_count (was <)
   - Log message: zone_idx - 1 (to show correct count)

This matches the fixes already applied to:
- Legacy loader (db.cpp + boot_data_files.cpp) in commit 07a19d1
- YAML loader in commit 4624bf2

Now all three loaders consistently reserve zone_table[0] for kNowhere.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
PROBLEM:
- Test script checked if world.db file exists before converting
- If file existed but was empty/corrupted, conversion was skipped
- This caused "No zones/rooms/triggers found in SQLite database" errors
- SQLite tests failed with timeout due to empty database

SOLUTION:
- Remove file existence check for SQLite conversion
- Always convert SQLite worlds (both small and full)
- Conversion is fast (seconds for small world, ~10s for full)
- Ensures database is always fresh and complete

This avoids stale database issues while adding minimal overhead.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
These runtime directories are created by the MUD server at startup
and should not be tracked in version control.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…ories

- Clarify that ALL binaries (not just circle) must run from build dirs
- Add requirement that build directories must be out-of-source
- Explain that running from source dir pollutes the source tree

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
OLC log should be relative to world directory (e.g., small/log/olc.log),
not parent directory (../log/olc.log).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…olders

PROBLEM:
- Commit 64a230e "fix: Restore lost code from bad encoding fix"
  introduced 87 lines of corrupted UTF-8 sequences
- Russian comments were garbled (О©╫ characters)
- File became mix of KOI8-R, UTF-8 corruption, making editing impossible

ROOT CAUSE:
- When restoring code after bad encoding fix, file was taken from
  a version that had UTF-8 corruption instead of proper KOI8-R

SOLUTION:
1. Used git blame to find last clean version (a5a2b85)
2. Extracted corrupted version and replaced all UTF-8 garbage with
   "[encoding corruption removed]" English placeholders
3. Preserved all functional code and Admin API integration
4. Added debug logging to close_socket() for Admin API debugging

CHANGES:
- 87 corrupted comment lines → English placeholders
- Added: close_socket() entry logging (state, admin_api_mode, host)
- File now ASCII-compatible (can be safely edited)

NOTE:
Russian log strings (like "Перезагрузка через", "потерял связь")
were also corrupted but are low priority - replaced with placeholders
for now. Can be restored later if needed.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Root cause: Two bugs prevented Admin API from working:

1. input_time not initialized in new_admin_descriptor()
   - Was left at 0, causing timeout check (time() - input_time > 300)
     to trigger immediately and close the connection
   - Fixed: Initialize both login_time and input_time like in new_descriptor()

2. Admin API connections processed through command loop
   - Admin API calls nanny() directly in admin_api_process_input()
   - Command loop expected commands in input queue (get_from_q)
   - Queue was always empty for Admin API, triggering connection close
   - Fixed: Skip command processing loop for admin_api_mode connections

Tested:
- Admin API full_crud_test passes (list/get/update for zones/mobs/objects/rooms)
- Connection remains open after authentication
- Commands execute successfully

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fixed timeout issue with Legacy checksums by modifying wait logic:
- If -W flag present: wait for "Zones:" pattern (checksums complete)
- Otherwise: wait for "Boot db -- DONE" (boot complete)

Checksums are calculated AFTER boot and take ~5s to appear in syslog.
Previous code killed server 1s after boot, before checksums finished.

Result: Small_Legacy_checksums now passes (was timing out)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Added clear instructions when YamlWorldDataSource fails to load world_config.yaml:
- Explains that world is in Legacy format but server built with YAML support
- Provides conversion command with correct paths
- Reminds to run from world directory (NOT world/world)

This prevents confusion when accidentally starting YAML-enabled server
with unconverted world data.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1. BUG-2 FIXED: test_large_payload now uses correct response key
   - Changed response.get("data", {}) to response.get("mob", {})
   - Server returns {"mob": {...}}, not {"data": {...}}
   - Test now PASSES - data was always saved correctly, test just couldn't read it

2. Improved test_comprehensive_trigger:
   - Now tests full CRUD cycle: create → update → delete
   - Uses auto-assigned vnum (no conflicts on reruns)
   - Tests Russian text encoding preservation (KOI8-R)
   - Creates trigger with Russian text, verifies encoding
   - Updates with comprehensive data
   - Deletes trigger for cleanup
   - Changed signature from (sock, vnum) to (sock, zone_vnum=1)

All Admin API get_* commands use entity-specific keys:
- get_mob → {"mob": {...}}
- get_object → {"object": {...}}
- get_room → {"room": {...}}
- get_zone → {"zone": {...}}
- get_trigger → {"trigger": {...}}

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fixes SIGSEGV when creating triggers via Admin API.

Root cause:
- admin_api_create_trigger creates a dummy CharData for OLC
- CharData constructor sets player_specials = nullptr by default
- trigedit_save calls GET_INVIS_LEV to determine notification level
- GET_INVIS_LEV accessed ch->player_specials->saved.invis_level
  without checking if player_specials is null
- Result: segmentation fault at char_data.h:861

Solution:
- Add null check to GET_INVIS_LEV: return 0 if player_specials is null
- Add null check to SET_INVIS_LEV: silently ignore if player_specials is null
- This allows dummy CharData objects (NPCs) to work safely with these functions

Testing:
- Full Admin API CRUD tests now pass
- Trigger creation via Admin API works correctly
- Russian text encoding preserved in trigger names/scripts

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Restored 5 corrupted log/output strings that were replaced with
"[encoding corruption removed]" placeholders:

1. "Ошибка в таблице НГ подарков!" (gift table error)
2. "Загружен подарок в комнату: %d, объект: %d" (gift loaded)
3. "Ваш подопечный выключил компьютер.\r\n" (snoop disconnect)
4. "ся" (suffix replacement)
5. "Кто-то" (someone replacement)

These strings are visible to players/admins and must be in Russian.
Comments will be translated to English in a separate commit.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Replaced all [encoding corruption removed] placeholders in comments
with clear English comments or removed empty corrupted comments.

Key changes:
- gifts() function: translated comments about gift selection
- Technical comments: replaced with generic English descriptions
- Empty corrupted comments: removed entirely

This commit only changes comments, not functional code or user-visible
strings (those were already fixed in the previous commit).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…handling

Fixed two issues in the epoll EPOLLIN event processing block:

1. Removed extra closing brace before else statement
   - Was: `} else {` (unbalanced)
   - Now: `else {` (correct structure)

2. Improved readability by eliminating duplicated if statement
   - Both ENABLE_ADMIN_API branches now assign to `result` variable
   - Single `if (result < 0)` check follows, instead of duplicated
     if statements inside preprocessor branches

This makes the if/else if/else chain with ifdef directives much
easier to read and understand.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
После мерджа master в ветку, в entities_constants.h исправлена опечатка:
kZonedacay → kZonedecay (правильно)

Обновлено использование в yaml_world_data_source.cpp для соответствия.

Проблема была в том, что GitHub Actions собирает temporary merge commit
для PR, где entities_constants.h из master (с исправлением), а
yaml_world_data_source.cpp из нашей ветки (со старым названием) →
конфликт имен.

После мерджа и этого fix, YAML сборка успешна локально.

Также обновлен fmt submodule из master.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Исправлены warnings:
1. yaml_world_data_source.cpp:853 - удален unused atoi() call
2. sqlite_world_data_source.cpp:260 - kZonedacay → kZonedecay
3. world_checksum.cpp - добавлен [[maybe_unused]] для всех system() calls

Все warnings -Wunused-result исправлены.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Исправлена ошибка redeclaration переменной 'ret' в одной области видимости.
Используем (void)system(...) вместо [[maybe_unused]] int ret = system(...).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
SQLite:
- Исправлено второе вхождение kZonedacay → kZonedecay на строке 2194
  (в LoadObjectExtraDescriptions функции)

GCC 15 (Debian Sid container):
- Добавлен git config --global --add safe.directory '*'
- Исправляет ошибку "fatal: detected dubious ownership in repository"
  которая возникает из-за запуска контейнера под root

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…ries

Проблемы с system("mkdir -p"):
- Warnings -Wunused-result (не проверяется код возврата)
- (void) cast не работает с [[warn_unused_result]]
- Не кросс-платформенно (Windows требует другие команды)
- Security risk (shell injection)

Решение - std::filesystem::create_directories:
- C++17 стандарт, кросс-платформенно (Windows/Linux/macOS)
- Не требует system() вызова
- Автоматически создает parent directories
- Возвращает bool (true=создано, false=уже существует)
- Бросает filesystem_error при реальных ошибках

Обработка ошибок:
- Вся функция SaveDetailedBuffers обернута в один try-catch
- При ошибке создания директорий - логируется и функция завершается
- Предотвращает каскад ошибок fopen()

Также исправлено:
- SQLite: второе вхождение kZonedacay → kZonedecay (строка 2194)
- GCC 15: добавлен git safe.directory для Debian Sid контейнера

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Changes:
- Changed return type from void to bool to signal success/failure
- SaveDetailedBuffers now returns false on directory creation errors
- Added error logging when individual file writes fail
- Caller in db.cpp now checks return value and logs warnings
- Replaced system() calls with std::filesystem::create_directories

This ensures the caller knows when SaveDetailedBuffers fails and
can handle it appropriately instead of silently continuing.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add libcrypt-dev for GCC 15 (fixes linker error with -lcrypt)
- Add zlib1g-dev for WSL (fixes CMake ZLIB not found error)
- Add both to base Linux dependencies for consistency

Note: Cygwin failures are due to GitHub infrastructure issues
(connection error 12029), not fixable on our side.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The --update=none flag was introduced in GNU coreutils 9.2 (2023)
and is not available in older systems like WSL Ubuntu 22.04.

The -n flag (no-clobber) is equivalent and works on older coreutils.

This fixes WSL build failure:
  cp: option '--update' doesn't allow an argument

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Removed files that differ from lib/ and should only exist in one place:
- misc/configuration.xml (keep version in lib/ - more current)
- misc/craft/craft1.xml (only formatting difference)
- misc/messages (lib/ version has more content and fixes)

Runtime log files (errlog.txt, imlog.txt, syslog) were already not tracked.

This reduces file duplication and makes it clear which configs are canonical.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Ubuntu 22.04 has GCC 11 which lacks C++20 <format> header.
Ubuntu 24.04 has GCC 13.3.0 which fully supports <format>.

This fixes WSL build error:
  fatal error: format: No such file or directory

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant