Commit Graph

45 Commits

Author SHA1 Message Date
savilli 3f1adb49ae
Remove redundant on_dieplayer calls 2021-08-28 12:14:16 +02:00
SmallJoker 32cb9d0828
Mods: Combine mod loading checks and deprection logging (#11503)
This limits the logged deprecation messages to the mods that are loaded
Unifies the mod naming convention check for CSM & SSM
2021-07-31 19:54:52 +02:00
SmallJoker b93bbfde2c Script API: Fix segfault in remove_detached_inventory
when minetest.remove_detached_inventory is called on script init, the environment is yet not set up,
hence m_env is still nullptr until all scripts are loaded
2021-07-10 14:34:36 +02:00
SmallJoker 5bf72468f3
UnitSAO: Prevent circular attachments 2021-05-29 11:44:48 +02:00
SmallJoker bbe120308f
Attachments: Avoid data loss caused by set_attach() in callbacks (#11181) 2021-04-13 20:02:18 +02:00
SmallJoker fc864029b9 Protect per-player detached inventory actions 2021-03-07 17:18:02 +01:00
DS 4abe4b87b5
Allow overwriting media files of dependencies (#10752) 2021-02-23 19:39:15 +01:00
SmallJoker 7832b6843e
Server-side authority for attached players (#10952)
The server must have authority about attachments. This commit ignores any player movement packets as long they're attached.
2021-02-15 20:41:19 +01:00
SmallJoker 375bcd65c1
Send attachments instantly before set_pos (#10235) 2021-02-12 20:54:06 +01:00
rubenwardy 4c76239818
Remove dead code (#10845) 2021-01-22 15:09:26 +00:00
Zughy 45ccfe26fb
Removed some obsolete code (#10562)
Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
2021-01-21 18:17:09 +00:00
JDiaz 08ee9794fb
Implement on_rightclickplayer callback (#10775)
Co-authored-by: rubenwardy <rw@rubenwardy.com>
2021-01-11 18:03:31 +01:00
hecks dd5a732fa9
Add on_deactivate callback for luaentities (#10723) 2021-01-02 15:14:29 +01:00
Elias Fleckenstein 9250b5205a
Add minetest.get_objects_in_area (#10668) 2020-12-29 16:50:09 +01:00
SmallJoker adffef2b94
PlayerSAO: Run on_player_hpchange raw change values (#10478)
The callback is only run when a change in HP is to be expected.
Following cases will not trigger the callback:
 * Dead player damaged further
 * Healing full-health player
 * Change of 0 HP
2020-11-12 19:15:41 +01:00
sfan5 4f2303849e
Implement unloading of static_save=false objects according to existing docs (#10485) 2020-10-19 20:38:33 +02:00
sfan5 660115c1ab
Decouple entity minimap markers from nametags replacing with show_on_minimap property (#10443) 2020-10-19 20:38:15 +02:00
Jordan Snelling 3068853e8a
Add First Person Attachments (#10360)
Fixes some other third person camera specific attachments.
Implements a single new flag for entities to be forced visible in first person mode.
Old mods do not need to be updated to use the new flag and are fully backwards compatible.
2020-10-04 15:10:34 +02:00
SmallJoker 947466ab28 (se)SerializeString: Include max length in the name
This commit clarifies the maximal length of the serialized strings.
It will avoid accidental use of serializeString() when a larger string can be expected.

Removes unused Wide String serialization functions
2020-10-01 09:52:59 +02:00
Elias Fleckenstein 65c15e137f
Patch fast/teleport vulnerability when attached to an entity (#10340) 2020-09-26 18:41:44 +02:00
DS 98faeac5a7
Load media from subfolders (#9065) 2020-08-20 22:25:29 +02:00
SmallJoker c1e01bc638
Move shared parameters sending to UnitSAO (#9968)
Better header sorting by topic
Make UnitSAO-specific parameters private
Skip redundant recursive entity sending code (since ~5.2.0)
2020-06-04 19:31:46 +02:00
sfan5 4c8e1c3200 Clean up CAO nametag handling and remove deprecated AO_CMD
AO_CMD_UPDATE_NAMETAG_ATTRIBUTES was deprecated in
9eee3c3f46 (0.4.14)
2020-05-29 22:54:50 +02:00
sfan5 471e567657 Value copy / allocation optimizations mostly in server, SAO and serialize code 2020-05-27 21:58:40 +02:00
Loïc Blot 454dbf83a9
Server class code cleanups (#9769)
* Server::overrideDayNightRatio doesn't require to return bool
There is no sense to sending null player, the caller should send a valid object

* Server::init: make private & cleanup
This function is always called before start() and loads some variables which can be loaded in constructor directly.
Make it private and call it directly in start

* Split Server inventory responsibility to a dedicated object

This splits permit to found various historical issues:
* duplicate lookups on player connection
* sending inventory to non related player when a player connects
* non friendly lookups on detached inventories ownership

This reduce the detached inventory complexity and also increased the
lookup performance in a quite interesting way for servers with thousands
of inventories.
2020-05-07 22:38:41 +02:00
sfan5 d1c6cc72cc
Server: Improve some log messages (#9820) 2020-05-05 17:05:11 +02:00
Loic Blot 56bababcdf Add MetricsBackend with prometheus counter support 2020-04-29 07:48:08 +02:00
sfan5 3475759d1a Expose collision information to LuaEntity on_step 2020-04-27 20:45:46 +02:00
Loïc Blot e8ac5a31cf
Optimize get_objects_inside_radius calls (#9671)
* Optimize getObjectsInsideRadius calls

our previous implementation calls the ActiveObjectMgr to return ids and then lookup those ids in the same map and test each object
Instead now we call the global map to return the pointers directly and we ask filtering when building the list using lamba.

This drop double looping over ranges of active objects (and then filtered one) and drop x lookups on the map regarding the first call results
2020-04-16 08:25:48 +02:00
Loic Blot 5146086a64 Drop content_sao.{cpp,h}
Move LuaEntitySAO to a new dedicated file
Drop TestSAO (useless object)
Drop the old static startup initialized SAO factory, which was pretty useless.
This factory was using a std::map for 2 elements, now just use a simple condition owned by ServerEnvironment, which will be lightweight, that will also drop a one time useful test on each LuaEntitySAO creation. This should reduce server load on massive SAO creation
2020-04-11 16:07:17 +02:00
Loic Blot 894a34aef4 Move PlayerSAO to dedicated files 2020-04-11 16:07:17 +02:00
Loic Blot c99e8df07f pass clang-format 2020-04-11 16:07:17 +02:00
Loic Blot 6d43736172 Move serveractiveobject & unitsao
Move serverobject.{cpp,h} to server/serveractiveobject.{cpp,h}
Move UnitSAO class to dedicated files
2020-04-11 16:07:17 +02:00
sfan5 de73f989eb
Overall improvements to log messages (#9598)
Hide some unnecessarily verbose ones behind --trace or disable them entirely.
Remove duplicate ones. Improve their contents in some places.
2020-04-08 20:13:23 +02:00
SmallJoker 539f016c1b
Better F6 profiler (#8750)
Update the profiler names to make more sense of what they actually represent
Move the profiler code from header to its source file
Use monospace font to align lines
Format the statistics line to align better with surrounding values
Refresh the profiler each 3 seconds (roughly)
2019-08-13 19:56:55 +02:00
Lars Hofhansl 9fe3246154 Optimize getting active objects a bit. #8674 2019-07-16 15:55:17 -07:00
Loïc Blot eda35100b6
Add an activeobject manager to hold active objects (#7939)
* Add an activeobject manager to hold active objects
* Add unittests
2018-12-13 20:18:54 +01:00
lhofhansl 94cd2bfeac Revert 6587 - Optimize entity-entity collision (#7539) 2018-07-08 21:30:55 +01:00
Loïc Blot ccc3af128c
CSM/SSM: Add on_mods_loaded callback (#7411)
* CSM/SSM: Add on_mods_loaded callback
2018-06-06 12:53:59 +02:00
rubenwardy 87ad4d8e7f
Add online content repository
Replaces mods and texture pack tabs with a single content tab
2018-04-19 20:14:53 +01:00
Vitaliy 460b375cad Fix SAOM (#7200)
* Bugfix
2018-04-06 16:33:43 +02:00
Loïc Blot 67a4cb7d8a Fix various clang-tidy reported performance-type-promotion-in-math-fn 2018-04-03 18:16:17 +02:00
Vitaliy 528908a4c3 Optimize entity-entity collision (#6587)
* Add IrrLicht type aliases
* Add hash for IrrLicht vector
* Add object map
2018-04-03 08:23:46 +02:00
you bcd22fc34c Print the mod loading time (#7137)
* Print the mod loading time
2018-03-24 00:31:33 +01:00
Loïc Blot 6c184947c3
Server: delegate mod management & config to ServerModConfiguration (#7131)
* Server: delegate mod management & config to ServerModConfiguration (rename it to ServerModManager)

* Use c++11 range based loops
* Add unittests + experimental/default mod as a test case to permit testing mod loading in future tests
2018-03-16 08:41:33 +01:00