Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
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.
- Loading branch information
Showing
with
312 additions
and 207 deletions.
- +0 −1 src/client/game.cpp
- +0 −2 src/main.cpp
- +6 −5 src/network/serverpackethandler.cpp
- +5 −0 src/script/lua_api/l_base.cpp
- +2 −0 src/script/lua_api/l_base.h
- +7 −6 src/script/lua_api/l_inventory.cpp
- +3 −4 src/script/lua_api/l_object.cpp
- +26 −166 src/server.cpp
- +10 −23 src/server.h
- +1 −0 src/server/CMakeLists.txt
- +192 −0 src/server/serverinventorymgr.cpp
- +60 −0 src/server/serverinventorymgr.h
Oops, something went wrong.