409 Commits
Author SHA1 Message Date
Gleb MazovetskiyandClaude Sonnet 5 92927ca913 Migrate ClassAttributes, player HP/mana, item HP/mana bonuses, and monster HP to Fixed10_6/Fixed26_6
Replaces ParseFixed6/parseFixed6/readFixed6/readDecimal's raw-int
plumbing with the new FixedPoint type, then propagates strongly-typed
fixed-point fields through everywhere that consumed them: player
_pHitPoints/_pMana (and their base/max variants), ClassAttributes'
percentage/multiplier fields, Item::_iPLHP/_iPLMana, and
Monster::hitPoints/maxHitPoints. Eliminates manual <<6/>>6 bit-shifting
at nearly every call site in favor of fromInt/fromRaw/whole() and the
new fixed-point arithmetic operators, while preserving raw() only at
genuine serialization/network wire-format boundaries.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-10-11 21:55:08 +01:00
Gleb MazovetskiyandClaude Sonnet 4.6 53b91fd7a2 Untangle more dependencies
Split several monolithic files to reduce transitive dependencies and
enable the dun_render_benchmark to link without bringing in all of
DevilutionX:

- Extract dungeon tile globals and loading functions from `gendung` into
  `dun_tile_data.{hpp,cpp}`
- Extract light table data and MakeLightTable from lighting into
  `engine/light_tables.{hpp,cpp}`
- Move cursor_id and SelectionRegion to cursor_defs.hpp
- Extract quest log rendering to `panels/quest_log.{hpp,cpp}`
- Extract drlg quest setpiece logic to `levels/drlg_quests.{hpp,cpp}`
- Extract quest data loading to `tables/questdat.{hpp,cpp}`
- Move `GameData` and `gbIsMultiplayer` into `game_mode.{hpp,cpp}`
- Add `parse_sfx_id.{hpp,cpp}`
- Update CMake libraries accordingly

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-08-23 06:08:15 +01:00
Gleb MazovetskiyandClaude Fable 5 ac2d7fc731 Replace libfmt with std::format
- `fmt::format` with literal format strings -> `std::format`.
- `fmt::format(fmt::runtime(...))` -> `FormatRuntime` in the new
  `utils/format.hpp`, a std::vformat wrapper that is also safe under the
  P2905 lvalue requirement of `std::make_format_args`.
- `fmt::dynamic_format_arg_store` (Lua logging) -> a small hand-rolled
  per-field formatter over `std::variant`, returning `std::expected`.
- `fmt::format_int` -> `std::to_chars`.
- `fmt::join` -> manual joins at the two call sites.
- SDL_audiolib: new patch that rewrites aulib_log.h to use std::format
  and drops the fmt dependency from its CMakeLists.
- The `-static-libstdc++` guard now keys off
  `DEVILUTIONX_STATIC_SDL_AUDIOLIB` instead of `DEVILUTIONX_STATIC_LIBFMT`.
- libfmt removed from CMake, vcpkg, Brewfile, CI workflows,
  Dockerfiles, packaging scripts, UWP project, and docs.
- macOS bumped to 13.3+, iOS to 16.3+ (required for `<format>`)
- Amiga m68k: provide `__cmpdf2`, which is missing from the hard-float
  libgcc multilib but referenced via libstdc++'s long double paths.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-22 00:00:04 +02:00
Anders Jenbo 1bf1b9886a Mod hashing and manifest (#8608) 2026-07-12 07:37:22 -04:00
Stephen C. Wills 2172583c1b Do not process packet headers or buffered messages from invalid players 2026-04-10 22:15:14 +02:00
Anders Jenbo 005e7dcc23 chore: clang-tidy cleanup part 1 2026-04-03 22:57:48 +02:00
Johnwill Keating 2e152af0dd Fix bug where remote player on different level writes to dPlayer[][] on the host 2026-03-22 18:31:42 -04:00
Yuri Pourre 5a08031caf [Bugfix] Update players directions on joining (#8462) 2026-03-09 21:01:52 -04:00
Eric Robinson 7e8173e6ff Add Player hasNoLife helper (#8302) 2025-12-03 05:12:42 +00:00
staphen 9affb1a79b Process network packets independent of the game's tick rate 2025-11-29 22:49:11 +01:00
LP f295e67b9f Add multiplayer event logging 2025-11-25 04:07:49 +01:00
Gleb Mazovetskiy 842b23803f SDL3: Use endianness swap helpers throughout 2025-10-09 01:28:37 +01:00
Andrettin f6b4665e94 Make Player Class Data Data-Driven (#8167) 2025-09-05 11:30:01 +02:00
Anders Jenbo 1c76897f2c Apply simple const rules using clang-tidy 2025-08-16 01:21:36 +02:00
Gleb Mazovetskiy d3248e969a Untangle more dependencies
This allows us to make `clx_render_benchmark` and
`text_render_integration_test` standalone.
2025-07-20 14:11:36 +01:00
staphen 308399e31e Fix errors where Monster::enemy references garbage memory 2025-05-22 05:18:36 +02:00
staphen bb78f48043 Fix includes in sync.h 2025-05-11 04:47:25 +01:00
staphen 1a2e0eb2e5 Validate length of incoming network messages 2025-05-10 20:01:53 -04:00
Gleb Mazovetskiy d94bc424df sgOptions -> GetOptions()
In C++, globals initialization order accross translation units is not
defined. Accessing a global via a function ensures that it is initialized.

This will be needed for #7638, which will statically initialize change
handlers after the Options object has been initialized.
2025-01-13 11:57:25 +00:00
Gleb Mazovetskiy dd76f17e4b Rename endian.hpp to endian_read.hpp
Following #7620, which split the write functions into a separate header.
2025-01-08 17:38:36 +09:00
Gleb Mazovetskiy a49b1f2d58 Extract Is{Any,None}Of out of engine.hpp
Untangles some of the dependencies
2025-01-08 09:54:56 +09:00
Gleb Mazovetskiy 164ebb46bd Big-endian networking fixes 2024-12-25 20:27:03 +00:00
staphen e81121a458 Divorce town seed from game seed 2024-11-27 16:18:42 +01:00
Stephen C. Wills cfe9a8ccdd Introduce xoshiro RNG to generate dungeon seeds (#7030) 2024-09-17 23:34:44 +02:00
staphen 3c5b298391 Capture the level seed and use it to skip failed dungeon layouts 2024-03-06 05:43:34 +01:00
staphen 9e682afe13 Rename glSeedTbl 2024-03-06 05:43:34 +01:00
obligaron ccaf8d1dac Use uint8_t in msg/multi/sync and fix MSVC warnings (#6856)
* Fix MSVC warnings in msg.cpp

* Move TBuffer to multi.cpp

* Fix MSVC warnings in multi.cpp

* SNet* change databytes to size_t

* msg/muli/sync: Change playerId to uint8_t
2023-12-16 18:56:06 +01:00
obligaron 75f68e1b8f Introduce Player::occupyTile 2023-11-26 23:38:34 +01:00
Gleb Mazovetskiy e350d9be06 Remove SNetGet/SetLastError
The only named code that was ever set is `STORM_ERROR_NO_MESSAGES_WAITING`.
There was also a call in `menu.cpp` which as far as I can tell is not
needed (if it is, it should be replaced by something else).
2023-11-14 02:53:49 +00:00
obligaron b810c808f5 Msg: Change OnXYZ to get a Player reference instead of a player index 2023-11-12 22:17:59 +01:00
Anders Jenbo af295b9f48 Fix warnings with conversion between size_t and int for playerId 2023-11-07 22:07:07 +01:00
staphen 444ac9d820 Use memmove when shifting data in high/low priority buffers 2023-09-27 21:51:13 +02:00
ephphatha da76e131e4 Add getter/setter for character levels to ensure _pNextExper stays synced 2023-08-24 05:46:44 +02:00
Gleb Mazovetskiy 8c1a847f41 Remove utils/stdcompat/string_view.hpp 2023-08-14 09:59:14 +01:00
Gleb Mazovetskiy 74755c8be7 Remove utils/stdcompat/cstddef.hpp 2023-08-14 01:54:29 +01:00
staphen b1711739c6 Immediately drop player who sends invalid player data 2023-07-20 05:44:19 +02:00
Eric Robinson 074a1f2e0c Rename: Loopback -> Offline (#6300) 2023-07-03 06:37:53 +02:00
staphen c2814088d2 Add fields to PlayerNetPack for validation 2023-06-28 15:46:54 +02:00
Anders Jenbo 63277a842d Clean up player packing 2023-06-24 04:18:14 +02:00
Anders Jenbo efa51993e3 Split network player sync and hero save file 2023-06-24 04:18:14 +02:00
Gleb Mazovetskiy 4fa3732526 Add missing <cstdint> includes
Done with the following script:

```ruby
Dir["Source/**/*.{h,c,cc,cpp,hpp}"].each do |path|
  v = File.read(path)
  next if !v.include?("uint32_t") || v.include?("cstdint")

  lines = v.lines
  line_num = if lines[2].start_with?(" *")
    lines.index { |l| l.start_with?(" */") } + 3
  else
    3
  end

  lines.insert(line_num, "#include <cstdint>\n")

  File.write(path, lines.join(""))
end
```

then fixed-up manually
2023-05-10 13:50:12 +01:00
Anders Jenbo 5a12f7b0d5 Always spawn players in a valid location 2023-04-29 15:34:41 -04:00
staphen 08592377a7 Clean up logic for PT_MESSAGE prioritization 2023-04-25 05:34:08 +02:00
obligaron e1cdec438e When player position desyncs ensure position.old is also updated 2023-04-17 01:35:34 +02:00
qndel ce2ce86070 inspect players command 2023-04-14 02:40:17 +02:00
obligaron 04b66114f2 Multiplayer: When updating remote player tile ensures that it's free 2023-03-31 15:11:37 +02:00
obligaron 4826e5819e Multiplayer: Fix desync when teleporting 2023-03-20 07:04:54 +01:00
obligaron adeeae2c52 Add option to enable singleplayer quests in multiplayer 2023-02-27 05:00:07 +01:00
Anders Jenbo a29fc3a074 Correct casing for Player::isWalking() 2023-01-12 09:42:49 +01:00
Gleb Mazovetskiy ca69237d59 Big-endian support for multiplayer
Not sure if this works but it's a start
2022-12-15 05:59:17 +01:00