5915 Commits

Author SHA1 Message Date
Loic Blot
feaeb523d2 RemotePlayer/LocalPlayer Player base class proper separation (code cleanup) (patch 3 of X)
* remove IGameDef from Player class, only LocalPlayer has it now
* move many attributes/functions only used by LocalPlayer from Player to LocalPlayer
* move many attributes/functions only used by RemotePlayer from Player to RemotePlayer
* make some functions const
* hudGetHotbarSelectedImage now returns const ref
* RemotePlayer getHotbarSelectedImage now returns const ref
* various code style fixes
2016-10-08 22:27:44 +02:00
Loic Blot
aabbe38be9 Optimize ClientIface::getPlayerNames(): return const ref instead a copy of all names 2016-10-08 22:27:44 +02:00
Loic Blot
3558ac7829 More code cleanup (UNORDERED + RemotePlayer/LocalPlayer)
* ClientEnvironment now uses UNORDERED MAP for active objects
* Use RemotePlayer and LocalPlayer everywhere it's possible
* Minor code style fixes
* Drop Client::getBreath() unused function
2016-10-08 22:27:44 +02:00
rubenwardy
8c1271f645 Fix backwards compatibility issue introduced by close_on_enter 2016-10-08 18:58:28 +02:00
SmallJoker
c5e5557da7 Ensure std::unordered_ be used on MSVC 2010 too (#4600) 2016-10-09 00:25:34 +10:00
Loic Blot
d28e980e7c Player/LocalPlayer/RemotePlayer inheritance cleanup (part 2 on X)
* Server/Client Environments now have an helper to cast Player object in the right type to use it
* Server: use RemotePlayer everywhere and remove previous added casts
* Client: use LocalPlayer where needed
* Environment: remove unused functions (getPlayers(), getRandomConnectedPlayer(), getNearestConnectedPlayer())
2016-10-08 15:57:50 +02:00
gregorycu
52c84e242e Speed up emerge thread by using unordered map in a few places. Looking at 25% speedup in Emerge thread on Just Test. 2016-10-08 15:57:36 +02:00
gregorycu
015f529571 Ensure std::unordered_ will be used on supported MSVC compilers 2016-10-08 15:05:36 +02:00
Foghrye4
5f714c5c6f Prevent attached models from disappearing during parent reload (#4128) 2016-10-08 14:51:25 +02:00
HybridDog
a9d9256ddc VoxelArea: faster iter function (#4490) 2016-10-08 22:42:17 +10:00
Loic Blot
aca7929ced Remove some unused attributes/class functions in server.cpp/h 2016-10-08 11:36:28 +02:00
Loic Blot
aca9ff5961 Player/LocalPlayer/RemotePlayer inheritance cleanup (part 1 on X)
* LocalPlayer take ownership of maxHudId as it's the only caller
* RemotePlayer take ownership of day night ratio as it's the only user
* Pass getPlayerControl as const reference to prevent object copy on each call (perf improvement in ObjectRef::l_get_player_control call)
* getPlayerSAO is now only RemotePlayer call
* get/setHotbarItemCount is now RemotePlayer owned
* Server: Use RemotePlayer instead of Player object on concerned call to properly fix the object type
* PlayerSAO now uses RemotePlayer instead of Player because it's only server side
* ObjectRef::getplayer also returns RemotePlayer as it's linked with PlayerSAO
2016-10-08 11:36:28 +02:00
paramat
013e882c66 Lua_api.txt: Add biome and nodeupdate documentation
Add missing documentation for 'register_biome' and
'clear_registered_biomes'.
Add documentation for 'nodeupdate_single'. 'nodeupdate'
is not yet documented due to a bug it causes.
2016-10-08 00:09:01 +01:00
SmallJoker
0d1fc1963f Textures: Ignore unknown node in override.txt 2016-10-08 00:08:50 +01:00
sfan5
d6d05366c1 Fix C++11 Windows build of threading code
The initial problem was that mutex_auto_lock.h tries to use std::unique_lock<std::mutex>
	despite mutex.h not using C++11's std::mutex on Windows. The problem here is the mismatch
	between C++11 usage conditions of the two headers. This commit moves the decision logic
	to threads.h and makes sure mutex.h, mutex_auto_lock.h and event.h all use the same features.
2016-10-06 22:37:30 +02:00
Loic Blot
d33797e079 use unordered containers where possible (patch 4 on X)
Also remove some unused parameters/functions
2016-10-06 22:37:26 +02:00
SmallJoker
d5ee74b227 Fix narrow string compiling issue on MSVC2010 2016-10-06 13:57:40 +02:00
Loic Blot
2b5c276768 Use more unordered_maps to improve performance in c++11 builds 2016-10-06 12:33:35 +02:00
SmallJoker
ca56ba413f Use relative position for nametags 2016-10-06 12:13:37 +02:00
Loic Blot
2621f0ea5e Fix macosx build by disabling postgresql upgrade 2016-10-06 08:05:55 +02:00
est31
c82ef57202 Fix crash regression when chatting in the ncurses console
Fixes #4579, a regression introduced by commit

d4c76258e37337ea585cf24d8e05b50a30fa307d "Chat: new settings to prevent spam"
2016-10-06 07:45:50 +02:00
Loic Blot
cd7327255e Travis: build matrix improvements + CPP11 build 2016-10-06 00:28:24 +02:00
Loic Blot
0b2db1f16b Compilation fix 2016-10-05 20:58:05 +02:00
Loic Blot
17bad192fe Replace various std::map with UNORDERED_MAP + various cleanups
This is part 2 for 5f084cd98d7b3326b51320455364337539710efd

Other improvements:

* Use the defined ItemGroupList when used
* make Client::checkPrivilege const
* inline some trivial functions
* Add ActiveObjectMap typedef
* Add SettingsEntries typedef
2016-10-05 10:53:19 +02:00
Loic Blot
0df837698f Make some maps unordered to improve performance
* This permit to improve performance on C++11 builds
* use some existing typedefs in tools maps
* minor code style changes
2016-10-05 07:30:32 +02:00
Loic Blot
d462aa0753 Chat: new settings to prevent spam
Added the following chat coreside features
* Chat messages length limit
* Message rate limiting
* Message rate kicking

Note:
* handleChat now takes RemotePlayer pointer instead of u16 to remove useless
  lookups
2016-10-05 00:13:37 +02:00
paramat
2b26874299 Mapblock_mesh_generate_special: Improve performance
Remove uses of std::map.
Make sure we use ContentFeatures reference not value.
Original commit by gregorycu.
2016-10-04 00:06:28 +01:00
paramat
e3cb60dd85 Textures: New 'smoke puff' texture from TNT mod 2016-10-04 00:04:38 +01:00
est31
219e872f45 Fix build/warning on non X11 platforms 2016-10-03 15:55:47 +02:00
paramat
93a19718c8 Builtin/falling: Add fallback vector in case of nil 'wallmounted to dir'
The fallback vector is in case 'wallmounted to dir' is nil due
to voxelmanip placing a wallmounted node without resetting a
pre-existing param2 value that is out-of-range for wallmounted.
The fallback vector corresponds to param2 = 0.
2016-10-03 01:56:08 +01:00
raymoo
1c5eff9aac Forceloading: Transient forceloads
Adds a flag to forceload_block which lets you turn off persistence for
that forceload.
2016-10-03 01:54:36 +01:00
rubenwardy
ade3a24e75 Formspec: Add container[] and container_end[] elements 2016-10-03 01:53:13 +01:00
sfan5
37c5722422 Allow nothing to be selected from formspec parameters 2016-10-02 15:49:18 +02:00
Rui
d9ccbd026e Fix typo in core.after (#4560) 2016-10-01 16:16:50 +02:00
Wuzzy
80da7a4473 Update default controls in README.txt 2016-09-30 18:57:40 +01:00
paramat
7830f8cb71 Mgv7: Avoid mid-air spawn on disabled mountain terrain, optimise function
'getSpawnLevelAtPoint()' did not account for disabled mountains, it
was possible to be spawned in mid-air where a mountain surface would
have been.

Avoid check for river area if rivers are disabled.
2016-09-30 18:56:39 +01:00
est31
d2ed880b50 Fix android build
Fixes #4493.
2016-09-30 15:27:36 +02:00
sfan5
9006af8660 Only include keycode unittests in client build (fixes #4559) 2016-09-29 16:31:31 +02:00
sfan5
342b83cf2b Add keycode.cpp unittests 2016-09-25 17:26:38 +02:00
sfan5
cd1f3a39e7 Rewrite keycode.cpp (Keycode handling & names) 2016-09-25 17:26:38 +02:00
paramat
91de110b9b Conf.example: Re-add deleted noise parameter documentation
Re-add documentation of noise parameter formats.
Re-add 'mgv5_np_ground' noise parameters in group format.
Both these were deleted through auto-generation of conf.example.
Add note to builtin/mainmenu/dlg_settings_advanced.lua that this
documentation must be preserved.
2016-09-23 19:01:31 +01:00
sfan5
61e8fdb279 Update library versions in buildbot
The libraries updated in this commit were built with a set of scripts:
	https://gist.github.com/sfan5/780c24313c164d34634e18677683b9a3
Building new library versions or just using a different MinGW version
is now way easier. This means Windows builds no longer need to use
ancient library versions just because nobody knows how to build them.
2016-09-21 20:16:31 +02:00
sfan5
821d970b78 Don't use ZLIB_WINAPI if the required DLL is not provided to CMake
This allows you to use an stdcall zlib (zlib1.dll instead of zlibwapi.dll)
when building Minetest for win32.
2016-09-21 20:16:31 +02:00
sfan5
de7e5db90b Do not serialize empty NodeMetadata
This commit fixes #4516, though note that this will gradually fix MapBlocks
as they are used/modified and thus re-serialized.
2016-09-21 10:29:17 +02:00
paramat
746759828c Builtin: Change error to warning for light_source > 14 2016-09-21 08:04:11 +02:00
James Stevenson
c54c4c9ab4 Increase default font size by 1 2016-09-21 08:04:11 +02:00
est31
3a772f36c0 Fix a typo and use proper deprecation notification system
Fix a typo pointed out by @thecow275.

Also, use the deprecated notification system which respects the
deprecated_lua_api_handling setting.
2016-09-19 12:14:06 +02:00
paramat
5dd99dfd62 Register.lua: Throw error if node 'light_source' > core.LIGHT_MAX
Add 'core.LIGHT_MAX = 14' to builtin/game/constants.lua with the intention
to replace misplaced 'default.LIGHT_MAX = 14' in Minetest Game.
Add comment in light.h requiring the constant be changed in both places.
Add lighting bug warning to note in lua_api.txt.
There are hundreds of mod uses of 15 which causes a lighting bug.
2016-09-17 09:33:25 +01:00
paramat
ffa2fe8424 Lua_api.txt: Add note of maximum value for node 'light_source'
Maximum is 14.
A value of 15 (reserved for direct sunlight) causes a lighting bug.
2016-09-15 05:25:38 +01:00
Thomas--S
d2c8230ea1 Add an [invert:<mode> texture modifier
Inverts the given channels of the base image.
Mode may contain the characters "r", "g", "b", "a".
Only the channels that are mentioned in the mode string will be inverted.
2016-09-15 05:25:38 +01:00