Commit Graph

3931 Commits

Author SHA1 Message Date
Auke Kok
dc8bf4e928 Avoid try/catch for settings.
We can just test for the presence of these settings nicely here,
no need to use a try / catch construct.
2016-03-09 01:45:23 +01:00
Auke Kok
4e59fcf5c1 Add consistent monotonic day counter - get_day_count()
I've written several experimental bits of code that revolve around the
need for a consistent calendar, but implementing one is extremely hard
in mods due to time changes and mods overriding core.get_timeofday(),
which will conflict.

The second part of the problem is that doing this from a mod requires
constant maintenance of a settings file.

An implementation in core is trivial, however, and solves all of
these problems at virtually no cost: No extra branches in server
steps, and a single branch when minetest.set_time_of_day(), which is
entirely reasonable.

We store the day_count value in env_meta.txt.

The use case is obvious: This change allows mods to create an actual
virtual calendar, or properly account for seasonal changes, etc..

We add a "/days" chatcommand that displays the current day count. No
permissions are needed. It can only retrieve the day count, not
modify it.
2016-03-09 01:45:23 +01:00
ShadowNinja
3ce6642a26 Add AreaStore custom ID API 2016-03-07 16:33:20 -05:00
ShadowNinja
821551a266 Implement AreaStore serialization 2016-03-07 16:33:20 -05:00
ShadowNinja
c4b7afed7e Fix SpatialAreaStore not freeing removed areas 2016-03-07 16:33:20 -05:00
ShadowNinja
8ae1e1f4d2 Add basic AreaStore method documentation 2016-03-07 16:33:20 -05:00
ShadowNinja
6e9d71342a Sort AreaStore header 2016-03-07 16:33:20 -05:00
ShadowNinja
5641da43d6 Clean up VectorAreaStore 2016-03-07 16:33:20 -05:00
ShadowNinja
2e74e9ee20 Move AreaStore container selection logic into getOptimalImplementation 2016-03-07 16:33:20 -05:00
ShadowNinja
0079887b64 Move AreaStore to util 2016-03-07 16:33:20 -05:00
ShadowNinja
f021db7243 Make AreaStore cache setting private 2016-03-07 16:33:20 -05:00
ShadowNinja
095db16990 Simplify AreaStore ID management 2016-03-07 16:33:20 -05:00
est31
725cb4eb07 s_env.{cpp, h} cleanups
* Replace string by-val passing with const reference
* Fix code style
* Remove redundant `int table` definition and indentation level
2016-03-07 19:54:26 +01:00
est31
d494733839 Add minetest.register_lbm() to run code on block load only 2016-03-07 19:54:26 +01:00
ShadowNinja
88fbe7ca1e Use LuaErrors in security check macros
Throwing a LuaError calls destructors as it propagates up the stack,
wheres lua_error just executes a longjmp.
2016-03-07 13:37:15 -05:00
Duane Robertson
af714c7ade Mgvalleys: Correct spawn problems
Increase maximum spawn altitude to reduce spawn issues.
2016-03-04 02:39:04 +00:00
paramat
48a718e715 Decoration API: Allow force_placement of simple decorations 2016-03-04 02:38:55 +00:00
Jeija
1100a5d614 Require minetest.request_http_api to be called from the mod's main scope
Fixes #3764
2016-03-03 22:42:00 +01:00
ShadowNinja
7bcbc0105b Fix main menu being unable to set secure settings 2016-03-03 00:57:19 -05:00
ShadowNinja
abd4a79acb Remove debug.getupvalue from the Lua sandbox whitelist
This function could be used to steal insecure environments from trusted mods.
2016-03-03 00:09:05 -05:00
ShadowNinja
8b006a154b Add support for non-ASCII characters to chat console
This still only supports 256 characters, but that's because
Irrlicht's clipboard handlers don't support wide characters.
2016-03-02 23:23:31 -05:00
ShadowNinja
9dd38cf968 Add Android chat form 2016-03-02 23:23:31 -05:00
ShadowNinja
430929e75a Add text selection and copying to console 2016-03-02 23:23:31 -05:00
ShadowNinja
3edb7575a1 Unlock cursor when opening console 2016-03-02 23:23:31 -05:00
Esteban I. Ruiz Moreno
effa24737d Use the console instead of a dedicated window when pressing keymap_chat/cmd
keymap_console opens a full window for chat history browsing.
2016-03-02 23:23:31 -05:00
nerzhul
ee50341297 Revert "Fix jumping at node edge"
This reverts commit 60dc01dc25.

This fixes issue #3773
2016-03-01 11:15:14 +01:00
paramat
6359ff9a87 Nodedef: Restore smooth lighting to water 2016-02-27 21:27:42 +00:00
Duane Robertson
6969dd4224 Mgvalleys: Add Dry Riverbeds
Lower water table where base humidity is low.
Alter heat and humidity to compensate for river humidity and altitude
chill.
Correct misuse of surface_max_y in generateTerrain.
Remove sand trails in the water at river mouths.
Remove river water below water_level.
Correct heat/humidity calculations where noises are less than zero.
Correct heightmap errors as much as possible.
Make humidity calculations more readable.
2016-02-27 21:27:32 +00:00
est31
158bd76e87 Update po files, minetest.conf.example and settings_translation_file.cpp 2016-02-27 05:50:42 +01:00
Jeija
033a510cf3 Fix minetest.request_insecure_environment() always returning nil
Fixes #3765
2016-02-26 06:36:48 +01:00
RealBadAngel
f9d727764f Mapblock mesh: Allow to use VBO 2016-02-26 00:51:01 +00:00
RealBadAngel
8eb7ddb0a2 Remove new_style_water 2016-02-26 00:50:46 +00:00
rubenwardy
4efb7eb734 Cache some settings 2016-02-26 00:50:39 +00:00
paramat
8591713405 Sheet Ore: Eliminate crash caused by PcgRandom range max < min
In the calculation of y_start,
when 'column height max' was large it caused
nmin.Y + max_height > nmax.Y - max_height
Now, in this situation y_start is set to the
midpoint between nmin.Y and nmax.Y

Limit y0 and y1 to between nmin.Y and nmax.Y,
otherwise index calculation, which has no checks for limits,
places them at unwanted locations in the voxelmanip
2016-02-23 23:51:29 +00:00
nerzhul
147425483a GOTBLOCKS & DELETEBLOCKS: test packet size only once 2016-02-23 14:24:21 +01:00
orwell96
e17fbb31d6 Reset block send timer when invoking setBlock(s)NotSent()
As stated in this forum thread [1], I noticed that there is a
2 second interval in which inventory changes are shown on the
client. @yyt16384 found the source of these 2 seconds:
m_nothing_to_send_pause_timer is set to 2.0 every time there
are no changes to make, but this timer is not reset when
SetBlockNotSent or setBlocksNotSent are invoked. So in worst
case, the changed block will be sent over 2 seconds too late.

With this change, changed inventories are updated almost
immediately, but it causes additional connection load.
2016-02-22 19:59:56 +01:00
RealBadAngel
9961185550 Fix getting pointed node
Fixes #3719
Closes #3753
2016-02-22 15:54:32 +01:00
Jeija
31e0667a4a Add Lua interface to HTTPFetchRequest
This allows mods to perform both asynchronous and synchronous HTTP
requests. Mods are only granted access to HTTP APIs if either mod
security is disabled or if they are whitelisted in any of the
the secure.http_mods and secure.trusted_mods settings.

Adds httpfetch_caller_alloc_secure to generate random, non-predictable
caller IDs so that lua mods cannot spy on each others HTTP queries.
2016-02-22 15:39:41 +01:00
Jeija
a3892f5a66 Fix HTTPFetchRequest performing a GET request if post_data is supplied
Instead, perform a POST request with post_data.
2016-02-22 15:39:19 +01:00
RealBadAngel
b2aabdfe07 Camera: remove auto tune FPS, single view range setting 2016-02-21 18:18:13 +01:00
RealBadAngel
2f4cf0bcca Remove preload_item_visuals code
Closes #3748
2016-02-21 17:46:50 +01:00
RealBadAngel
354635f9fb Dont make fastface if tile is not seamless
Fixes #3378
Closes #3751
2016-02-21 17:30:16 +01:00
Loic Blot
c6d7d2097c Little collision.cpp cleanups 2016-02-20 09:44:22 +01:00
gregorycu
60dc01dc25 Fix jumping at node edge 2016-02-19 20:05:58 -05:00
ShadowNinja
a44393e43a Don't print locale directory error message when GetText is disabled
Also, downgrade the error to a warning.
2016-02-19 19:56:34 -05:00
Jeija
1b9aef43c9 Ignore spaces in secure.trusted_mods setting 2016-02-19 18:50:42 -05:00
RealBadAngel
5f4ed94d90 Minimap: show player markers 2016-02-19 21:31:22 +01:00
RealBadAngel
5dbaa68967 Camera: Don't count camera offset twice for Nametagged CAOs 2016-02-19 14:52:19 +00:00
ShadowNinja
4827ee1258 Require request_insecure_environment to be called from the mod's main scope
Previously you could steal a secure environment from a trusted mod by wrapping
request_insecure_environment with some code like this:

local rie_cp = minetest.request_insecure_environment
local stolen_ie
function minetest.request_insecure_environment()
	local ie = rie_cp()
	stolen_ie = stolen_ie or ie
	return ie
end
2016-02-19 14:52:10 +00:00
paramat
997be666e3 Clientmap: Define p_nodes_min/max as v3s32 instead of v3s16
'cam_pos_nodes -/+ box_nodes_d' can exceed the range of v3s16
when a player is near the world edge using a large view range
This previously caused world to disappear
Create new function getBlocksInViewRange() called from
updateDrawList() and renderMap()
Correct code style throughout updateDrawList() and renderMap()
2016-02-19 14:51:41 +00:00