Commit Graph

102 Commits

Author SHA1 Message Date
grorp 2bdd0a6bdb
Add physics overrides for walk speed and Fast Mode (#14475)
Co-authored-by: Wuzzy <Wuzzy@disroot.org>
2024-04-30 13:50:01 +02:00
sfence 72cb4e9bea
Allow `nil` puncher in `object:punch` (#14319) 2024-04-28 17:55:04 +02:00
sfan5 bc4ab8b99e General code refactoring/improvements in server, treegen and connection 2024-03-20 16:37:32 +01:00
sfan5 178943b4b7 Improve ServerEnvironment::getRemovedActiveObjects() in many ways 2024-03-20 16:37:32 +01:00
sfan5 8339594206 Handle static_save changes at runtime and between restarts 2024-03-17 15:55:24 +01:00
sfan5 2386bfda7e Fix static_save=false not working & related cleanups 2024-03-17 15:55:24 +01:00
SmallJoker 61a5733692 Unittest: Add inventory callback tests 2024-03-16 20:14:05 +01:00
SmallJoker 32f68f35cf
Avoid packets getting sent to disconnected players (#14444)
Many functions expect RemotePlayer to have a valid peer ID,
this however is not the case immediately after disconnecting
where the object is still alive and pending for removal.

ServerEnvironment::getPlayer(const char *, bool) now only
returns players that are connected unless forced to.
2024-03-10 13:24:35 +01:00
sfan5 c524c52baa Fix some common SAO methods to not generate useless update packets 2024-03-06 18:03:57 +01:00
sfan5 9fcd7f2dc0 Fix clang-tidy type promotion errors 2024-02-26 20:47:47 +01:00
lhofhansl 0d4b489545
Detect air-only blocks instead of day/night differences (#14264)
* Detect air-only blocks instead day/night differences

* Write !is_air into the former day-night-diff bit on disk, so that old server can still read maps written by new servers

* Only set is_air bit when reading from disk
2024-02-22 21:47:42 -08:00
sfan5 e3cc26cb7c
Irrlicht support changes (#14383) 2024-02-19 21:14:47 +01:00
sfan5 2b97fead9e Fix some potential iterator invalidation issues 2024-02-16 12:34:40 +01:00
SmallJoker e7dbd325d2
RemotePlayer: make peer ID always reflect the validity of PlayerSAO (#14317)
Upon disconnect, RemotePlayer still had a peer ID assigned even though
the PlayerSAO object was maked as gone (for removal). This commit makes
that the following always holds true:

	(!sao || sao->isGone()) === (peer_id == PEER_ID_INEXISTENT)
2024-02-02 22:13:24 +01:00
sfan5 5dbc1d4c08 Move some files to src/server/ 2024-01-27 10:33:32 +01:00
cx384 5958714309
Tool specific pointing and blocking pointable type (#13992) 2024-01-22 18:27:08 +01:00
sfan5 0383c44f0d
Custom data structure for active objects to get performance *and* safety (#13880) 2024-01-17 20:04:56 +01:00
sfence d0753dddb1
Method add_pos for object/player (#14126) 2024-01-01 22:48:56 +01:00
Lars Müller 0d61598d8a
Extend bone override capabilities (#12388) 2023-12-20 21:21:53 +01:00
Gregor Parzefall 3c60d359ed Remove usage of removed "PP" macro
This fixes a compilation error introduced by e7be135.
2023-12-15 10:28:07 +01:00
Gary Miguel da832a295e
Delete clang-format files and comments (#14079) 2023-12-15 10:23:44 +01:00
mazes-80 e7be135b78
Warning: inform about entity name when bug detected about attachement (#13354) 2023-12-15 10:22:58 +01:00
Desour bf53e7e1ca Fix anticheat false positives whith speed physics override 2023-12-03 12:23:17 +01:00
DS 11ec75c2ad
ActiveObjectMgr fixes (#13560) 2023-10-09 17:13:04 +02:00
sfan5 c3114132d3
Improve readability and infos in verbose log (#13828) 2023-09-22 18:41:10 +02:00
Wuzzy 8ebaf753d3
New physics overrides (#11465) 2023-09-15 20:10:08 +02:00
rubenwardy c6a0ead72d
Add warning for initial properties directly inside definition (#9650) 2023-08-13 00:19:03 +01:00
numzero 3b74cc4a41 Replace PP with direct printing 2023-06-26 22:51:32 +02:00
Desour 1b51ff333a Use unique_ptr for ServerInventoryManager::DetachedInventory::inventory 2023-06-05 20:43:33 +02:00
lhofhansl a8ec6092e2
Load blocks and objects behind player when in third-persion front-view (#13431) 2023-05-29 10:26:42 -07:00
Thresher 00c647e4cc
Convert spaces to tabs (#13506)
* Convert spaces to tabs

* Desour reviews 1-3 fix

* Desour fixes

* Undo alignment changes
2023-05-26 15:13:57 +02:00
lhofhansl b35aa10579
Guarantee ActiveObjectMgr::m_active_object is not modified while iterating (#13468)
Currently if a mod creates new active objects in on_deactivate the server could crash.
2023-04-28 11:17:48 -07:00
Desour 8b73743baa Reduce number of recursively included headers
This should improve compilation speed.

Things changed:
* Prefer forward-declarations in headers.
* Move header-includes out of headers if possible.
* Move some functions definitions out of headers.
* Put some member variables into unique_ptrs (see Client).
2023-04-27 18:50:33 +02:00
Riley Adams 73391013f7
Add node pos to node damage HP change reason (#13196) 2023-04-10 23:04:52 +01:00
Jude Melton-Houghton 7701e70dc9 Make MapEditEvent more complete
SetBlocksNotSent is no longer used.
2022-12-24 08:24:59 -05:00
Jude Melton-Houghton 9527cc3fa0
avoid clearChildAttachments iterator invalidation (#12987) 2022-11-23 14:48:12 -05:00
Lars Müller 077627181e
Allow rotating entity selectionboxes (#12379) 2022-10-30 16:53:14 +01:00
Jude Melton-Houghton f4a01f3a5d
Avoid duplication of mod metadata in memory (#12562)
Co-authored-by: sfan5 <sfan5@live.de>
2022-09-26 17:03:43 -04:00
Lars Müller 1317cd12d7
Fix formula used for acceleration (#12353) 2022-09-20 10:55:51 +02:00
rubenwardy 2d10fa7867
Prevent loading a world with unresolved dependencies (#12542) 2022-08-19 12:31:36 +01:00
SmallJoker c8ee755c05
Physics overrides: Move values to a common struct (#12591)
Co-authored-by: sfan5 <sfan5@live.de>
2022-08-12 10:17:02 +01:00
rubenwardy a871115889
Fix some warnings (#12615) 2022-07-30 12:51:23 +01:00
Lars Müller 99c8295e71
Fix media overriding regression (#12602) 2022-07-29 10:19:36 +02:00
rubenwardy 06de82fd86 Refactor ModConfiguration 2022-07-14 22:12:54 +01:00
sfan5 137eef6590 Move f1000 sanitizing to the places that still use this type 2022-07-14 20:55:45 +02:00
Lars Müller e7d4ec6834
on_deactivate: distinguish removal and unloading (#11931)
Sometimes you need to be able to do removal-related cleanup, such as removing files from disk, or entries from a database. staticdata obviously isn't suitable for large data. The data shouldn't be removed if the entity is unloaded, only if it is removed.
2022-06-11 20:01:14 +02:00
Lars Müller f4a53f7ee6
No damage effects on hp_max change (#11846) 2022-06-11 20:00:40 +02:00
sfan5 3ac5a24b12
Sanitize player position and speed server-side (#12396) 2022-06-07 21:27:05 +02:00
sfan5 303329f2d6 Handle lua entity HP changes correctly (like punches)
fixes #11975
2022-05-29 14:00:19 +02:00
ShadowNinja 5683bb76cc Fix compiler warnings 2022-04-08 14:55:21 +01:00