Commit Graph

3709 Commits

Author SHA1 Message Date
est31 94f1e5d9bd Send proper block to old clients for swap_node calls
The legacy code added in commit

d879a539cd - "Add minetest.swap_node"

for sending the whole mapblock to older clients on the case of a node
modification with swap_node, had the problem that the block chosen to be
sent to the client was referenced with node coordinates and not with
block coordinates, resulting in getting the wrong block sent to the client.
2015-09-17 20:23:31 +02:00
kwolekr dcbb95338a Ore: Add puff ore type 2015-09-17 03:04:50 -04:00
est31 6c81be51ff Fix object position border checking
Borders have to be converted into BS format in order to be accurately comparable to
object positions.
2015-09-16 17:39:49 +02:00
est31 f61f817b9c Disallow placing entities outside safe boundaries
Entity positions are serialized as F1000. Disallow placing
entities outside safe borders with the minetest.add_entity
call.

Note that this patch only enforces those boundaries for
placing entities, moving entities that move outside boundaries
aren't affected.

Thanks to @nanepiwo for pointing this out.
2015-09-15 19:45:17 +02:00
paramat 8e9c9e305a Firelike drawtype: Improve code
Remove unusable fine rotation by param2
Remove unused and redundant code
Fix code style issues
2015-09-14 08:04:01 +01:00
est31 283bf97a1c 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
kwolekr beba969413 Ore: Add ore sheet column height range selection
Modders are now able to select the range of ore column height,
and the midpoint at which they 'grow' starting from.
This commit adds three new parameters for the 'sheet' ore type:
column_height_min, column_height_max, and column_midpoint_factor.
clust_size is now deprecated for this ore type.
2015-09-13 00:11:50 -04:00
est31 64a5eec1bd networkprotocol.h: remove "u16 command" from doc
Its obvious that "u16 command" is inside every packet, therefore this
commit removes all mentions of the command, if non-array like notation
is used. We already didn't add "u16 command" to new packets or removed
it at packet changes, so now we remove it from existing packets.
2015-09-10 10:26:00 +02:00
est31 2a9da62b21 Improve locale directory detection
Use in-place locale directory if that exists, and
static one (RUN_IN_PLACE or CUSTOM_LOCALEDIR) doesn't exist.
Report to errorstream if neither static nor in-place locale
dirs exist, and report successfully found paths to infostreem.

Fixes two bugs:

-> Regression of commit [1] where if we use RUN_IN_PLACE=false,
	but don't make install, locales aren't found. One might
	think this is no regression, as its no bug, but all other
	paths (mainmenu, etc.) are detected properly.
-> Regression of commit [1] where locales don't work on windows.

References:
[1]: Commit 645e208673 "Use CUSTOM_LOCALEDIR if specified" by @ShadowNinja
2015-09-10 08:32:58 +02:00
Loic Blot 1f1e14ab7f Change m_client_event_queue's type to std::queue
As indicated in its name, m_client_event_queue should be a queue.
Change std::list to std::queue to improve the queue's performance.
2015-09-08 21:23:09 +02:00
paramat 4967e483b6 Mgv5/mgv7 biomes: Reduce heat and humidity noise spreads to former value of 750 2015-09-07 02:56:20 +01:00
ShadowNinja 645e208673 Use CUSTOM_LOCALEDIR if specified 2015-09-06 11:21:26 +02:00
Pavel Puchkin 588f0c1fb0 Fix building on OSX, broken since "Clean up threading"
Commit

e4bff8be94 - Clean up threading

by @ShadowNinja has broken the OSX build.

Including things inside a namespace isn't good.

Also fixes #3124.
2015-09-06 05:34:02 +02:00
est31 2035bfc3a6 Areastore: fix "attempt to index a number value"
Before, calling get_areas_in_area for an areastore with both
include_borders and include_data would result in a lua error,
if there was at least one area as result:
attempt to index a number value in function 'get_areas_in_area'
2015-09-03 06:17:02 +02:00
ShadowNinja e511282d78 Warn when building without cURL 2015-09-01 14:43:59 -04:00
ShadowNinja 7419504079 Enable server build when no builds are enabled 2015-09-01 14:43:59 -04:00
est31 0903190ba2 Hide minimap if it has been disabled by server 2015-09-01 19:00:33 +02:00
jh10001 dce9468925 gettext.cpp: Fix syntax error when using MSVC
Also remove trailing whitespaces from the file
2015-09-01 00:26:11 +02:00
est31 2c637ce1c2 Make ClientInterface::statenames consistent with the state enum again
Fixes minetest.get_player_information segfault due
to out of bounds access problems, when compiled as debug build.
2015-08-31 13:31:29 +02:00
est31 9c44aace4f l_mainmenu.h: remove unused l_get_dirlist function
The commit
8f9af57314 "Add core.get_dir_list" by @ShadowNinja
has removed the implementation of the l_get_dirlist function and all its usages
from the l_mainmenu.cpp file, but hasn't removed it from the header file.

The reason why this hasn't been detected earlier is that C++ has this interesting
feature to still make it possible to create instances of classes whose never used
private methods are declared but not defined.
2015-08-30 01:17:03 +02:00
Gael-de-Sailly 18973f9af1 Ores: change ore chance in clusters to better respect clust_num_ores for dense clusters 2015-08-29 23:30:17 +01:00
paramat 17b7b7c85f Dungeongen: Remove floating frames
Preserves the rare unbroken protruding dungeons
Fix random range for first room roomplace
Fix checked volume for first room 'fits' bool
and check for 'untouchable' flag instead of 'inside'
Remove 'enable floating dungeons' setting
2015-08-29 06:27:29 +01:00
Kahrl 3304e1e517 Push error handler afresh each time lua_pcall is used
Fixes "double fault" / "error in error handling" messages
(issue #1423) and instead shows a complete backtrace.
2015-08-27 01:56:06 +02:00
Kahrl 8658c8d9b5 Use numeric indices and raw table access with LUA_REGISTRYINDEX 2015-08-27 01:56:06 +02:00
David Jones 34b7a147dc Change i++ to ++i 2015-08-25 18:33:52 -04:00
ShadowNinja e4bff8be94 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
RealBadAngel 980d095e32 tileable flags are needed also without shaders because of filters 2015-08-20 03:42:22 +02:00
RealBadAngel 8b8d17b22b Remove use of engine sent texture tiling flags - theyre no longer needed 2015-08-20 02:41:40 +02:00
Rui 3a2bfd4548 Fix indianred and indigo of color-string 2015-08-19 19:49:45 +02:00
est31 457d42c599 Android: bypass broken wide_to_utf8 with wide_to_narrow (again)
This bypass had to be re-enabled as some users reported issues,
even after the iconv build fix.

While utf8_to_wide works well, wide_to_utf8 is quite broken
on android, for some reason, and some devices (unrelated from build
configuration).
2015-08-19 18:38:00 +02:00
est31 1fadf7f21e Fix inventory replace bug 2015-08-19 03:42:00 +02:00
kwolekr c2d23ff9cc SAPI: Disable unlockable time profiling 2015-08-18 01:26:11 -04:00
kwolekr bcf38a2ad1 SEnv: Remove static_exists from ActiveObjects in deleted blocks 2015-08-16 15:55:07 -04:00
onkrot 5556ba168f Remove unused functions. 2015-08-16 14:29:33 +02:00
paramat ee6cad1546 Defaultsettings: Increase client_mapblock_limit to 5000 2015-08-15 20:29:30 +01:00
kwolekr 0ba1cf8203 Rollback: Fail on bad precondition instead of causing assertion error 2015-08-15 14:51:38 -04:00
BlockMen 7238df4c59 Fix sneaking (fixes #665 and #3045) 2015-08-15 20:36:45 +02:00
nerzhul c4b5561b3f Remove unused function from connection.{cpp,h} 2015-08-15 08:48:20 +02:00
kwolekr be9024a397 minimap: Add ability to disable from server 2015-08-13 15:05:48 -04:00
est31 a670ecfde4 game.cpp: Update cached settings 2015-08-13 20:05:53 +02:00
Perttu Ahola def274a583 Fix segfault caused by a8e238ed06 2015-08-13 19:02:48 +03:00
est31 a8e238ed06 Add count based unload limit for mapblocks 2015-08-13 07:56:07 +02:00
kwolekr 2b04ab874d SAPI: Track last executed mod and include in error messages 2015-08-12 23:56:12 -04:00
est31 738fbc66d0 Fix Lua PcgRandom
Before, this lua code led to a crash:

local pcg = PcgRandom(42)
local value = pcg:next()

This was because if you called s32 PcgRandom::range(min, max) with the
minimum and maximum possible values for s32 integers (which the lua
binding code did), u32 PcgRandom::range(bound) got called with 0 as the
bound. The bound however is one above the maximum value, so 0 is a "special"
value to pass to this function. This commit fixes the lua crash by
assigning the RNG's full range to the bound 0, which is also fits to the
"maximum is bound - 1" principle, as (u32)-1 is the maximum value in the
u32 range.
2015-08-12 11:36:22 +02:00
paramat f0b325254f Treegen: Rename pine tree mapgen alias 2015-08-10 09:50:58 +01:00
Kahrl 6c0c27f662 Fix intlGUIEditBox leak and uninitialized value in Mapper (reported by valgrind) 2015-08-10 08:41:45 +02:00
kwolekr 1c408c4f1d Make NetworkPacket respect serialized string size limits 2015-08-10 02:16:55 -04:00
kwolekr 18cfd89a86 Display Lua memory usage at the time of Out-of-Memory error
Also misc. minor cleanups
2015-08-10 01:38:09 -04:00
rubenwardy a953ff4dfc Fix segfaults caused by the Environment not being initialized yet 2015-08-09 23:36:55 +02:00
Loic Blot 35cc90b086 Remove unused file 2015-08-09 13:27:42 +02:00
Kahrl 63b12f1f04 Fix camera updates being toggled by N key in release mode (#2762) 2015-08-07 06:02:06 +02:00
gregorycu 5c3c965c1a Fix detection of sneaking node
This fixes bug 1551
2015-08-06 03:14:56 -04:00
kwolekr 8560ece02e Fix BufferedPacket race condition (fixes #2983)
This was caused by the use the non-threadsafe SharedBuffer in a
threaded context.
2015-08-06 02:25:35 -04:00
kwolekr bd0b469d3d Fix critical vulnerabilities and bugs with NetworkPacket 2015-08-06 00:10:57 -04:00
est31 49cf66d785 Initialize random for verification key generation too 2015-08-06 05:48:07 +02:00
kwolekr bcf47bc67c Improve Script CPP API diagnostics 2015-08-05 21:13:03 -04:00
kwolekr 3183d5a403 connection: Make assertions non-fatal for received data 2015-08-05 21:01:13 -04:00
RealBadAngel 3295f3c401 Fix tiling issues for PLANTLIKE and FIRELIKE with FSAA 2015-08-05 22:52:32 +02:00
paramat 7a6e4dc54a Cavegen V6: Make all caves consistent with 0.4.12 stable
When tunnels entirely above ground were avoided, the
missing pseudorandom calls changed the allowed caves.
Now, above ground tunnels are not placed while
still running all previous pseudorandom calls.
2015-08-03 06:39:23 +01:00
paramat cf77e0333d Biome API: Make fallback biome stone and water, disable filler 2015-08-03 02:34:32 +01:00
Břetislav Štec abe6c072d6 src/util/numeric.{cpp,h}: Fix FacePositionCache data race 2015-08-02 19:42:22 +02:00
Miner59 060e56b24c Fix "bouncy" blocks
Before players "bounced" too high. Now, while still allowing to bounce, higher speed bounces are throttled.
2015-08-02 19:40:23 +02:00
Břetislav Štec 868a1a5c13 src/client/tile.cpp: Fix reference counting 2015-08-02 19:26:15 +02:00
rubenwardy ec796b8e81 Add map limit config option 2015-08-02 14:27:04 +02:00
Břetislav Štec a5e5aa5be9 Prepend "Lua: " before lua exceptions
src/server.cpp
src/emerge.cpp
2015-08-02 02:17:37 -04:00
Břetislav Štec c4287a0d68 src/wieldmesh.cpp: Fix mesh extrusion memory leak 2015-08-02 02:16:30 -04:00
Břetislav Štec ebe7b31538 src/client.cpp: Fix mapper memory leak 2015-08-02 02:15:38 -04:00
kwolekr 42cf5e972d Improve accuracy and safety of float serialization
Multiplying by a factor of 1/1000.f (rather than dividing by 1000.f) directly
introduces an error of 1 ULP.  With this patch, an exact comparison of a
floating point literal with the deserialized F1000 form representing it is now
guaranteed to be successful.
In addition, the maxmium and minimum safely representible floating point
numbers are now well-defined as constants.
2015-08-01 19:30:08 -04:00
kwolekr bf991bde45 Clean up util/serialization.{cpp,h} and add unit tests 2015-08-01 19:24:46 -04:00
Břetislav Štec 67997af67f src/environment.cpp: Fix NULL pointer dereference 2015-08-01 20:44:18 +02:00
Břetislav Štec 79e2647556 src/network/connection.h: Fix race condition 2015-08-01 20:44:17 +02:00
est31 c39a85a88d Android: Add githash header to spare rebuilds after new commits
Before, android_version.h got changed at every new commit. Now, we
only change it with new minetest releases. Analogous to how cmake
does it,  we add an android_version_githash.h file that communicates
the git hash to C++ code.

Also, unify VERS_MAJOR, VERS_MINOR and VERS_PATCH variable
calculation inside the whole makefile.
2015-08-01 20:42:07 +02:00
kwolekr 7919318be7 tests: Log exceptions thrown inside of unit tests 2015-07-31 23:30:25 -04:00
paramat cfed682d04 Dungeon generation: Fix code style issues in dungeongen.cpp 2015-08-01 00:37:26 +01:00
Loic Blot 05fe9ab2d4 Small SendableMediaAnnouncement cleanup
-> Remove the SendableMediaAnnouncement struct
-> Forge the packet directly in the m_media loop, spare one loop and the construction of a vector
-> Use preincrement to spare iterator copies
2015-07-31 01:01:00 +02:00
est31 eb3aac20c8 Android: fix horrible libiconv build
Before, our libiconv build was a joke. We first called configure for our own build host system,
then called make, before we executed a Android.mk script we provided as patch. The first "native make"
always failed, and the LIBICONV_LIB file setting in our Makefile didn't match the built one,
resulting in an always-rebuild of iconv.

This commit cleans up this total mess, removes the double-build, and the Android.mk, and properly calls
./configure with the according target platform, and uses a built toolchain.

As we have to deal with the android bug "NDK: Support for prebuild libs with full sonames"
https://code.google.com/p/android/issues/detail?id=55868
as the 2013 patch
https://lists.gnu.org/archive/html/libtool-patches/2013-06/msg00002.html
by Google's David Turner wasn't inside the 2011 libtool, we pass -avoid-version to
libtool.

Thanks to the proper build, wide_to_utf8 works for android now, removing us of the need to disable it.
2015-07-29 15:59:06 +02:00
nerzhul ca63f7f10d Precalculate mapblock relative size. This permit to remove many s16 calculs on runtime 2015-07-29 11:45:44 +02:00
Břetislav Štec 88a6b9f52d Fixed minimap memory leak 2015-07-27 11:06:46 -04:00
est31 f336d3ffb6 Fix srp.cpp:815 leak
Thanks @Zeno-
2015-07-27 08:15:39 +02:00
est31 c30a2d6854 Add AreaStore data structure 2015-07-27 06:42:56 +02:00
SmallJoker 454a290370 Fix MSVC number conversion warning 2015-07-25 17:38:04 +02:00
est31 fa1096ec49 Fix minetest.get_(all)_craft_recipe(s) regression
Since 03e0dd33a8 the calls didn't return an output count
for the recipes.
2015-07-25 17:33:41 +02:00
Loic Blot 4e6971e593 Cleanup server addparticle(spawner) by merge two identical functions. 2015-07-25 12:24:28 +02:00
est31 288302a1f0 Fix documentation of dedicated_server_loop 2015-07-24 23:11:19 +02:00
est31 5bde7798e9 Check output of mpz_set_str and fix leak on error condition
Also add static identifier as upstream did
2015-07-24 22:42:54 +02:00
Loic Blot aab7c83d02 Remove some old dead code. Fix some Clang warnings in SRP (ng->N... will
always evaluate to true.
2015-07-24 21:48:02 +02:00
est31 2eb329cc63 Bump protocol to 26
This was needed due to the TileDef serialisation changes. Originally it has been planned
to also add utf-8 based chat to 26, but chat changes aren't final yet, so they are done
in one change, after the release, and not two small ones, causing us having to be compliant
to three versions of the packet.
2015-07-24 20:32:26 +02:00
est31 3b50b2766a Optional reconnect functionality
Enable the server to request the client to reconnect.

This can be done with the now extended minetest.request_shutdown([reason], [reconnect]) setting.
2015-07-23 07:38:13 +02:00
RealBadAngel 1e0e85f82e Fix issues with light of attached CAOs 2015-07-23 04:35:13 +02:00
paramat d569c91f48 Mgv7: Use density noise + density gradient for mountain terrain
Tune and optimise noise parameters
2015-07-21 23:16:14 +01:00
RealBadAngel 60350699c7 Add wielded (and CAOs) shader 2015-07-21 23:56:41 +02:00
est31 254dbe7abd Clarify docs for auth.cpp method 2015-07-21 18:14:39 +02:00
est31 a57d83b46a Ask auth handler to create auth when a default password is set
-> Fix server crash with protocol >=25 if a default password is set.
-> Remove some useless and possibly confusion causing code for the TOCLIENT_FIRST_SRP packet handler
2015-07-21 18:12:28 +02:00
Loic Blot fa7fe510d9 Remove profiler.h include where it's not needed. Remove some unreachable and very old code 2015-07-21 08:10:43 +02:00
Elia Argentieri 5ebb4237e2 Added get_player_velocity() method. Fixes #1176 2015-07-20 05:40:44 +02:00
est31 7bbb9b066a MoveItemSomewhere double bugfix
-> Fix bug where MoveSomewhere from an infinite source would fill the destination inventory with copies of itself.
-> Fix bug where MoveSomewhere would needlessly call callbacks.
-> Remove trailing whitespaces
2015-07-19 06:23:41 +02:00
paramat 4046f3e302 Cavegen: Mgv6: No small caves entirely above ground
Mgv5/mgv7: Remove 'should make cave hole' feature
Remove ravine code
2015-07-19 02:47:11 +01:00
TeTpaAka e47f390e0d Refactor particle code to remove the while loops
Replaces while loops with proper getfield calls
2015-07-18 14:54:07 +02:00
TeTpaAka dd2e08e117 Make acc and vel deprecated in add_particle and search for acceleration and velocity instead
The doc and the actual behaviour differed.
2015-07-18 07:57:20 +02:00
TeTpaAka 8d03301138 Fix invisible player when the attached entity is removed 2015-07-18 07:41:43 +02:00