1
0
mirror of https://github.com/luanti-org/luanti.git synced 2026-01-12 20:25:26 +01:00
Commit Graph

162 Commits

Author SHA1 Message Date
SmallJoker
3d10d4e859 Serialize: Throw exception on incomplete reads (#16796)
Several mistakes were made past where the stream was expected to raise
the EOF flag when reaching the end of stream. That is incorrect. The
flag is only raised if the current read operation fails.

This commit unifies all istream compatibility code to use 'canRead'
for reliable EOF detection. An exception is now thrown when a
value cannot be read completely (e.g. missing bytes).
Version comments are added for easier backtracing.
2026-01-03 11:13:14 +01:00
sfan5
1dbb3eae32 Clarify that punch toolcaps are not optional (#16720) 2025-12-28 15:30:25 +01:00
sfan5
8d1db8413f Make UniqueQueue use unordered_set 2025-12-24 11:57:05 +01:00
Wuzzy
f567449cd6 Add more information in PlayerHPChangeReason (#16024)
1) Add `node` and `node_pos` field for the `drown` field (analog to `node_damage` type)
2) Add `custom_type` field to allow a standardized way to report more details of the HP change
3) Make `builtin` report a `custom_type` for the HP changes caused by the `/kill` command and `core.do_item_eat`
4) Move the documentation of `PlayerHPChangeReason` to its own section
5) Fill in missing information of said documentation
2025-12-20 15:12:34 +01:00
cx384
d4c3529af7 Move serialisation code out of sound_spec.h 2025-11-30 19:26:22 +01:00
cx384
ac0ebf39ad Clean up header includes (#16674) 2025-11-16 15:00:51 +01:00
lhofhansl
6ac8346c6d Revert part of 16013 - restore liquid updates to the client (#16663)
This reverts 00addc3e5d
Fixes: #16662
2025-11-11 11:10:49 -08:00
SmallJoker
98fb381910 Break include chains and tidy (part 2) 2025-11-06 19:31:13 +01:00
sfan5
2368126d0a Fix memory leak in rollback (and more) (#16644) 2025-11-05 11:55:57 +01:00
sfan5
7a6e639d61 Tune "block send throttling while building" optimization (#16614)
it can lead to terrain not loading/updating at all if you're constantly building and moving.

for more see the IRC logs <https://irc.luanti.org/luanti/2025-10-26#i_6293100>
2025-11-04 11:44:49 +01:00
SmallJoker
329e210326 Break include chains and tidy (#16640)
Co-authored-by: cx384 <cx384@proton.me>
2025-11-02 21:33:10 +01:00
Lars Müller
7331156650 Fix interpolating to identity bone overrides (#16609)
The previous code immediately dropped identity overrides, even if there still was an interpolation to be done.
Also a little bit of cleanup, and setting an appropriate identity default for the scale property when interpolating.

For modders: As a workaround, you can add a tiny offset so that overrides aren't identity overrides.
2025-10-29 10:25:50 +01:00
SmallJoker
499f2284bd Server: Fix Server::Send exception caused by leaving players
Leaving players will have PEER_ID_INVALID for database saving purposes.
This patch clarifies that, and properly protects the batch send function.

Bug introduced by 5f5ea132.
2025-09-29 19:23:43 +02:00
sfan5
3cb8ce69d2 Minor cleanups and logging changes 2025-07-16 11:42:54 +02:00
Lucas OH
ce2380b58e Include header files in CMake sources (#16297) 2025-07-12 13:23:35 +02:00
sfence
4f42b4308c Add persistent unique identifiers for objects (#14135) 2025-07-09 10:40:26 +02:00
sfan5
79e0d834fd Rework user limit and checks around join process 2025-05-30 13:02:24 +02:00
sfan5
b580c66b61 Restrict minimum state for ClientInterface::sendToAll 2025-05-30 13:02:24 +02:00
sfan5
9ce9d7f433 Extend check for lingering clinets 2025-05-30 13:02:24 +02:00
sfence
0bdd5f294e Make SDL2 default on macOS (#16039) 2025-05-02 21:28:13 +02:00
Lars
00addc3e5d Mark liquid and light updates low priority 2025-04-22 20:36:45 -07:00
Lars
2a3427a39c Fix m_nearest_unsent_d calculation when changed blocks arrive
Uses the nearest cube surface instead of euclidean distance to correctly reset the distance to start scanning from.
2025-04-22 20:36:45 -07:00
Lars
99150fadd1 Some RemoteClient improvements
* Simplications
* Remove RemoteClient::m_blocks_modified
* Remove unneeded nearest_emergefull_d
2025-04-22 20:36:45 -07:00
SmallJoker
5c6e4d35b0 Client: protect against circular attachments (#16038)
The server already includes such check. There must be a desync issue that causes
an ID mismatch, resulting in client crashes. Any such crash must be prevented.
2025-04-21 12:33:19 +02:00
sfan5
124d770823 Fix edge-case where manually set gameid isn't used 2025-04-10 14:39:21 +02:00
sfan5
9d81c02f27 Add/remove/change some log messages for clarity 2025-04-10 14:39:21 +02:00
Lars Müller
a3648b0b16 Add spatial index for objects (#14631) 2025-04-08 08:44:53 +02:00
lhofhansl
6724068659 Slight fix to #15949 to handle emerge queue full (#15960)
Partially restore the existing logic, and try to enqueue a block as before, if the queue is full it will be handled correctly.
2025-03-31 21:31:10 -07:00
sfan5
2602d03b34 Split ABM/LBM from serverenvironment.cpp to own file 2025-03-30 18:17:19 +02:00
lhofhansl
8f8d7c4088 Check if a block is already in the emege queue before checking occlusion culling and trying to reemerge (#15949) 2025-03-28 11:31:54 -07:00
cx384
18ac8b20fa Replace object visual by enum (#15681) 2025-03-06 21:02:11 +01:00
sfan5
7892541383 Various random code cleanups 2025-03-04 19:53:01 +01:00
Lars Mueller
d74af2f1a7 Use matrix4::getRotationRadians 2025-02-27 12:31:04 +01:00
cx384
a8c4c55d58 Document that object properties colors field is unused (#15685) 2025-02-02 19:04:18 +01:00
Lars Müller
7c6ade0fc5 Restore proper rollback database indexing (#15707) 2025-01-24 16:50:59 +01:00
Lars Müller
547e1476bb Allow overriding fonts via media files (#15606)
Co-authored-by: sfan5 <sfan5@live.de>
2025-01-19 20:42:40 +01:00
SmallJoker
e8f6127779 Reduce irrlicht_extrabloated.h includes in header files 2025-01-04 12:39:34 +01:00
SmallJoker
d1dd044455 Reorder client initialization (#15554)
Previously, ServerEnv created a player instance before they're fully initialized.
This commit moves all initialization steps and callbacks into TOSERVER_CLIENT_READY
^ which includes StageTwoClientInit for player loading or creation
2024-12-24 15:24:56 +01:00
wrrrzr
e9080f91f2 Cleanup ban.cpp/h (#15496)
Make BanManager more const correctly
Delete unused includes
2024-12-01 20:52:13 +01:00
SmallJoker
c175046d30 Network: Fix serialization version checks (#15477)
This fixes some incorrect assumptions that the read and write version ranges are identical - whereas they're in fact not.
2024-11-27 18:39:57 +01:00
sfan5
c00129360e Remove unused pos_max_d 2024-11-12 10:52:46 +01:00
sfence
d849d51c2d Replace licensing text in headers (LGPLv2.1) (#15321) 2024-10-28 15:57:39 +01:00
LoneWolfHT
e441b5d240 Fix spelling mistakes in player_sao.cpp 2024-10-23 10:52:28 +02:00
sfan5
a18355e7e8 Introduce object target for shared sources 2024-10-16 19:39:59 +02:00
Zemtzov7
1b2d24791a Separate anticheat settings (#15040) 2024-10-11 12:01:22 +02:00
SmallJoker
3797ca52c4 Network: offload often changed constants to source file (#15207)
* Network: offload often changed constants to source file

This prevents unnecessary recompiling when using incremental builds.
There is also no need to have separate max proto version variables;
as they're subject to the handshake between client and server. The
code is also expected to support the same version (or higher).

Co-authored-by: sfan5 <sfan5@live.de>
2024-10-02 11:01:30 +02:00
sfence
610ddaba7c Allow detection of damage greater than HP (#15160)
Co-authored-by: Gregor Parzefall <gregor.parzefall@posteo.de>
2024-09-27 21:34:52 +02:00
grorp
526a2f7b8c Dehardcode the death formspec (#15155)
Co-authored-by: Paul Ouellette <oue.paul18@gmail.com>
2024-09-24 22:37:44 +02:00
grorp
3c48671076 Fix -Winconsistent-missing-override in unit_sao.h (#15190) 2024-09-24 22:25:46 +02:00
red-001
d5d8fb629b Simplify TOSERVER_INIT and TOCLIENT_HELLO
- Network compression support was never added.
- Client hasn't used the returned playername since at least 0.4-stable.
2024-09-02 21:50:43 +02:00