Commit Graph

169 Commits (0dbf454870dc17a12dec5a438bc87f81c5a3f1e3)

Author SHA1 Message Date
MoNTE48 0dbf454870 Fix some warnings 2019-10-11 20:21:22 +02:00
Maksim Gamarnik 35770f4abb Merge Minetest 0.4.16 2017-06-06 23:03:34 +03:00
sfan5 100a6036d8 Private nodemeta (#5702)
* Private node metadata that isn't sent to the client
2017-05-10 15:29:21 +02:00
Loïc Blot 32d85e68c6 Update server min protocol version to v24 (#5411)
* 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-03-19 08:44:29 +01:00
Dániel Juhász 3c4bd88430 Lighting: Update lighting at block loading
This commit updates mapblocks' light if necessary when they are loaded.
This removes ghost lighting.
2017-02-13 00:05:49 +00:00
Rogier 18bdc18f75 Move PP() and PP2() macros to basic_macros.h
Instead of redefining them everywhere.
2016-12-24 00:32:50 +00:00
Maksim Gamarnik 919be490f9 Update
Sync all Minetest commits
2015-11-10 13:49:24 +02:00
ShadowNinja 85dbe50ec1 Rename macros with two leading underscores
These names are reserved for the compiler/library implementations.
2015-10-14 02:39:37 -04:00
ShadowNinja 29e8adeadc Use warningstream for log messages with WARNING
Remove DTIME macro and its uses, too
2015-10-14 01:36:48 -04:00
est31 41bdbf33f9 Various style cleanups + unused code removal
-> 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-19 20:57:29 +02:00
est31 69399235ef Serialisation: documentation fixes, clarifying renames and whitespace fixes
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-09-14 07:02:15 +02:00
David Jones 9d1284b324 Change i++ to ++i 2015-08-25 18:33:52 -04:00
ShadowNinja 098d28aa5e Clean up threading
* 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-08-23 22:04:06 -04:00
Maksim Gamarnik 9247f32e0e LGPL 2.1 to 3.0 on all files 2015-08-14 01:26:28 +03:00
nerzhul 858d78bd05 Precalculate mapblock relative size. This permit to remove many s16 calculs on runtime 2015-07-29 11:45:44 +02:00
kwolekr 515f488490 Misc. minor fixes 2015-07-10 15:58:57 -04:00
est31 6ddde110e2 Generic CAO cleanups and renames for clarification
* 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-06-20 03:37:30 +02:00
est31 f8ca5cec37 Mapblock: nodecount refactor
Spare direct multoplication, use constant MapBlock::nodecount instead of
local nodecount variables.

Also use strides at one place instead of multiplications.
2015-05-31 23:22:24 +10:00
kwolekr 8b8b11d1a3 Record MapBlock modification reasons as flags instead of strings
This improves performance of MapBlock::raiseModified by a factor of 6.
Also, clean up mapblock.h a bit and inline small functions.
2015-05-31 23:20:51 +10:00
est31 6fe143f2e5 Mapblock: nodecount refactor
Spare direct multoplication, use constant MapBlock::nodecount instead of
local nodecount variables.

Also use strides at one place instead of multiplications.
2015-05-31 06:24:41 +02:00
kwolekr d013e12e5a Record MapBlock modification reasons as flags instead of strings
This improves performance of MapBlock::raiseModified by a factor of 6.
Also, clean up mapblock.h a bit and inline small functions.
2015-05-17 22:14:26 -04:00
Craig Robbins 27791ee1aa For usages of assert() that are meant to persist in Release builds (when NDEBUG is defined), replace those usages with persistent alternatives 2015-03-07 22:41:47 +10:00
Craig Robbins f271835134 Increase MapBlock::actuallyUpdateDayNightDiff() performance by 2-8x. ok @celeron55
Before patch, function consumes up to ~8% of the main server loop. After, ~0% (below level of 2 places of significance)
2015-02-10 16:23:37 +01:00
Loic Blot 306b69dbdd Fix a crash (assert) when client set serial version < 24 in INIT
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-27 16:55:25 +01:00
Craig Robbins 1e89b53c74 Revert "Fix a crash (assert) when client set serial version < 24 in INIT 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-27 00:39:33 +10:00
(@U-Exp) a53acfb2da Fix a crash (assert) when client set serial version < 24 in INIT 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 2015-01-24 22:41:02 +10:00
kwolekr 87330183bf Fix all warnings and remove -Wno-unused-but-set cflag 2015-01-18 23:29:19 -05:00
Craig Robbins aacc3cba46 Remove most exceptions from getNode() (and variants) 2014-11-14 18:05:34 +10:00
sapier 414e9f17a4 Speedup getBlockNodeIdMapping by up to factor 4 by using a fixed size mapping array 2014-06-23 00:13:41 +02:00
proller 495ed5ec8b Remove liquid_finite and weather 2014-04-18 21:56:48 +04:00
sapier 396602432c Cleanup jthread and fix win32 build 2013-12-01 16:25:46 +01:00
kwolekr 76f37cadb0 Actually fix weather
The real problem was that MapBlocks were not activated before getting sent to the client
2013-11-17 01:59:04 -05:00
kwolekr d8e65be2d3 Weather: Clean up getHeat/getHumidity somewhat 2013-09-16 23:33:53 -04:00
Kahrl ee90d438b8 Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenu 2013-08-14 21:03:33 +02:00
proller f821824943 Weather backward compatibility 2013-08-02 00:51:36 +04:00
PilzAdam a21807926a Fix warnings in mapblock.cpp 2013-07-28 23:34:58 +02:00
proller cdb2b82262 Weather support 2013-07-27 23:21:48 +04:00
Ilya Zhuravlev a12df55f29 Migrate to STL containers/algorithms. 2013-03-11 19:08:39 -04:00
Sfan5 3fab3825aa Update Copyright Years 2013-02-24 20:15:24 +01:00
PilzAdam 269f01224b Change Minetest-c55 to Minetest 2013-02-24 18:49:03 +01:00
Perttu Ahola ee8f9f45ee Move util/serialize.h out from staticobject.h for smaller header dependencies 2012-11-26 11:18:34 +02:00
Perttu Ahola 22f8ca992b Reorganize ClientMap rendering code for a bit more performance
- Don't select blocks for drawing in every frame
- Sort meshbuffers by material before drawing
2012-09-04 22:41:03 +03:00
Perttu Ahola 0a975204b2 Improve node timer format (map format version 25) and update mapformat.txt 2012-07-24 15:03:46 +03:00
Perttu Ahola 2c7babb397 Fix map deserialization and remove old serialization code 2012-07-23 08:18:39 +03:00
darkrose 92a389f848 Increase node id/param0 to 16 bits, leaving param2 always with 8 bits 2012-07-23 08:18:39 +03:00
darkrose e5bebe42e9 Implement node timers 2012-07-23 08:18:37 +03:00
Perttu Ahola ec937ecdd8 Properly and efficiently use split utility headers 2012-06-17 02:40:36 +03:00
Perttu Ahola 3f01b586b9 Update and fix doc/mapformat.txt; make current format more solid in mapblock.cpp 2012-06-08 14:57:02 +03:00
Perttu Ahola e70b6545b1 Switch the license to be LGPLv2/later, with small parts still remaining as GPLv2/later, by agreement of major contributors 2012-06-05 18:54:07 +03:00
Perttu Ahola d77fc9ac99 Add ignore_world_load_errors configuration option and provide better error messages 2012-06-04 22:34:40 +03:00