aboutsummaryrefslogtreecommitdiff
path: root/src/mapblock.cpp
AgeCommit message (Collapse)Author
2022-05-26Get rid of global buffer that would ruin concurrent MapBlock serializationsfan5
2021-10-12Remove a few unused functions reported by callcatcher (#11658)SmallJoker
2021-08-31Switch MapBlock compression to zstd (#10788)lhofhansl
* Add zstd support. * Rearrange serialization order * Compress entire mapblock Co-authored-by: sfan5 <sfan5@live.de>
2020-12-15Allow configuring block disk and net compression. Change default disk level.Lars
2020-11-26Avoid marking map blocks dirty upon deserialization.Lars
2020-10-01(se)SerializeString: Include max length in the nameSmallJoker
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
2019-08-10Merge pull request #8776 from osjc/FixGetNodeJozef Behran
Finish getNode cleanup
2019-01-22Fix warnings about dungeongen.cpp memcpy() and unused variable in ↵Paramat
MapBlock::deSerializeNetworkSpecific() (#8122) * Fix warning about dungeongen.cpp memcpy() * Fix unused variable in MapBlock::deSerializeNetworkSpecific() * Fix unused variable a simpler way
2019-01-03Proselytize the network. Use IEEE F32 (#8030)SmallJoker
* Proselytize the network. Use IEEE F32 * Remove unused V2F1000 functions
2018-11-28Move client-specific files to 'src/client' (#7902)Quentin Bazin
Update Android.mk Remove 'src/client' from include_directories
2018-07-22Add a MSVC / Windows compatible snprintf function (#7353)nOOb3167
Use sizeof where applicable for mt_snprintf
2018-02-10Node definition manager refactor (#7016)Dániel Juhász
* Rename IWritableNodeDefManager to NodeDefManager * Make INodeDefManager functions const * Use "const *NodeDefManager" instead of "*INodeDefManager" * Remove unused INodeDefManager class * Merge NodeDefManager and CNodeDefManager * Document NodeDefManager
2018-02-04Remove unused light updating codeDániel Juhász
Also remove the unit test that tests the removed algorithms.
2017-08-19Code modernization: src/m* (part 2)Loic Blot
* empty function * default constructor/destructor * remove unused Map::emergeSector(a,b) * for range-based loops * migrate a dirs[7] table to direction tables * remove various old unused function
2017-08-18Modernize various files (src/m*) (#6267)Loïc Blot
* Modernize various files (src/m*) * range-based for loops * code style * C++ headers instead of C headers * Default operators * empty function Thanks to clang-tidy
2017-07-27Fix a warning introduced by 4eb59aeeb2f2b535f4eb2a1608189bb03098454eLoïc Blot
2017-07-27Rename previous_was_found to previous_existsLoic Blot
2017-07-27MapBlock::actuallyUpdateDayNightDiff(): little performance optimizationLoic Blot
don't check isLightDayNightEq if checked on previous node
2017-07-27Massive performance improvement on correctBlockNodeIdsLoic Blot
correctBlockNodeIds does 2 lookups for each loaded node, one to translate DB ID to name and a second to translate name to real ID. Name to real ID is very consumming if done on every node. As mapblocks are in most cases composed of many identical adjacent nodes, cache previous source and destination id and use them on the next node to prevent any lookup on those maps. This reduce the function load from 15% of my CPU usage to ~0.7%, on the test, calls was reduced from 2.5M lookups to 42k lookups, it's a huge performance gain
2017-07-26Remove unused Map::getDayNightDiff + fix one undefined variable in mapblock.cppLoic Blot
2017-07-18Very little performance fix on correctBlockNodeIdsLoic Blot
+ C++11 codestyle
2017-06-20Fix 1 more warning reported by GCCLoic Blot
We don't write in correct buffer size in analyze_block
2017-06-17Cpp11 initializers 2 (#5999)Loïc Blot
* C++11 patchset 10: continue cleanup on constructors * Drop obsolete bool MainMenuData::enable_public (setting is called with cURL in server loop) * More classes cleanup * More classes cleanup + change NULL tests to boolean tests
2017-06-10Remove superfluous pointer null checksQrchackOfficial
2017-06-06Revert "Remove deprecated code segments (#5891)"Loïc Blot
This reverts commit 599e13e95e81aadb959c9f3715aec9b425ede084.
2017-06-04Remove deprecated code segments (#5891)Thomas--S
2017-05-10Private nodemeta (#5702)sfan5
* Private node metadata that isn't sent to the client
2017-03-19Update server min protocol version to v24 (#5411)Loïc Blot
* Update server min protocol version to v24 It's based on @sfan5 stats. See https://kitsunemimi.pw/tmp/serverlist_stats_2017-03-17.txt v24 was bumped 25/08/14 and 0.4.11 was released 25/12/14 * Drop protocol v23 and lesser code
2017-02-13Lighting: Update lighting at block loadingDániel Juhász
This commit updates mapblocks' light if necessary when they are loaded. This removes ghost lighting.
2016-12-24Move PP() and PP2() macros to basic_macros.hRogier
Instead of redefining them everywhere.
2015-10-14Rename macros with two leading underscoresShadowNinja
These names are reserved for the compiler/library implementations.
2015-10-14Use warningstream for log messages with WARNINGShadowNinja
Remove DTIME macro and its uses, too
2015-09-19Various style cleanups + unused code removalest31
-> Don't pass pointer to whole IGameDef to NodeMetadata constructors and deserializers, but only to IItemDefManager, which is needed -> Remove the unused content_mapnode_get_new_name() method -> Fix style for MapBlock::deSerialize and MapBlock::deSerialize_pre22, improving accuracy of error messages a bit -> Fix style at other serialisation methods too -> Improve accuracy of some comments
2015-09-14Serialisation: documentation fixes, clarifying renames and whitespace fixesest31
1. Do two renames: * SER_FMT_CLIENT_VER_LOWEST -> SER_FMT_VER_LOWEST_WRITE * SER_FMT_VER_LOWEST -> SER_FMT_VER_LOWEST_READ Now the two define values are consistently named with the _WRITE defines SER_FMT_VER_{HIGHEST,LOWEST}_WRITE, and to better point out what the two serialisation versions actually are for. 2. wrap some lines in doc/worldformat.txt, and point out that the node timers are serialized at a later point, as this can cause confusion about what now happens (if one doesn't strictly read the if block's conditions). 3. some whitespace fixes in NodeTimerList::serialize, and one new comment.
2015-08-25Change i++ to ++iDavid Jones
2015-08-23Clean up threadingShadowNinja
* Rename everything. * Strip J prefix. * Change UpperCamelCase functions to lowerCamelCase. * Remove global (!) semaphore count mutex on OSX. * Remove semaphore count getter (unused, unsafe, depended on internal API functions on Windows, and used a hack on OSX). * Add `Atomic<type>`. * Make `Thread` handle thread names. * Add support for C++11 multi-threading. * Combine pthread and win32 sources. * Remove `ThreadStarted` (unused, unneeded). * Move some includes from the headers to the sources. * Move all of `Event` into its header (allows inlining with no new includes). * Make `Event` use `Semaphore` (except on Windows). * Move some porting functions into `Thread`. * Integrate logging with `Thread`. * Add threading test.
2015-07-29Precalculate mapblock relative size. This permit to remove many s16 calculs ↵nerzhul
on runtime
2015-07-10Misc. minor fixeskwolekr
2015-06-20Generic CAO cleanups and renames for clarificationest31
* Use enum for GENERIC_CMD_* * Rename m_attachements to attachement_parent_ids (public member and clearer name) * Rename GENERIC_CMD_SET_ATTACHMENT to GENERIC_CMD_ATTACH_TO * USHRT_MAX + 1 buffer sizes to prevent overflows as @kahrl suggested * Remove unneccessary m_id from GenericCAO (shadowing protected superclass member for no reason) as @kahrl suggested
2015-05-31Mapblock: nodecount refactorest31
Spare direct multoplication, use constant MapBlock::nodecount instead of local nodecount variables. Also use strides at one place instead of multiplications.
2015-05-17Record MapBlock modification reasons as flags instead of stringskwolekr
This improves performance of MapBlock::raiseModified by a factor of 6. Also, clean up mapblock.h a bit and inline small functions.
2015-03-07For usages of assert() that are meant to persist in Release builds (when ↵Craig Robbins
NDEBUG is defined), replace those usages with persistent alternatives
2015-02-10Increase MapBlock::actuallyUpdateDayNightDiff() performance by 2-8x. ok ↵Craig Robbins
@celeron55 Before patch, function consumes up to ~8% of the main server loop. After, ~0% (below level of 2 places of significance)
2015-01-27Fix a crash (assert) when client set serial version < 24 in INITLoic Blot
When SER_FMT_VER_LOWEST is set to zero, then the test is stupid in INIT because all client works. In mapblock we check if client's serialization version is < 24, but if client sent serialization version < 24 (15 for example) the server set it and tried to send nodes, then BOOM To resolve the problem: * Create a different CLIENT_MIN_VERSION to handle this problem * Remove the exception * Use an assert in case of bad developer code
2015-01-27Revert "Fix a crash (assert) when client set serial version < 24 in INIT ↵Craig Robbins
command SER_FMT_VER_LOWEST is set to zero, then the test is stupid in INIT because all client works. In mapblock we check if client's serialization version is < 24, but if client sent serialization version < 24 (15 for example) the server set it and tried to send nodes, then BOOM" nerzhul is (may?) be working on a new solution. For the moment this is reverted because old worlds cannot be loaded (see discussion on github for the commit). This reverts commit 800d19270250bb13cc6b2d330199815bf8e96446.
2015-01-24Fix a crash (assert) when client set serial version < 24 in INIT command ↵(@U-Exp)
SER_FMT_VER_LOWEST is set to zero, then the test is stupid in INIT because all client works. In mapblock we check if client's serialization version is < 24, but if client sent serialization version < 24 (15 for example) the server set it and tried to send nodes, then BOOM
2015-01-18Fix all warnings and remove -Wno-unused-but-set cflagkwolekr
2014-11-14Remove most exceptions from getNode() (and variants)Craig Robbins
2014-06-23Speedup getBlockNodeIdMapping by up to factor 4 by using a fixed size ↵sapier
mapping array
2014-04-18Remove liquid_finite and weatherproller