Commit Graph

556 Commits

Author SHA1 Message Date
Auke Kok 2f45f007f4
Allow NodeTimer, ABM and block mgmt interval changes.
ABM's are hardcoded to run every 1.0s, NodeTimers are hard coded to
run at every 1.0s. Block mgmt is running every 2.0sec.

However, these timers can be better tuned for both higher and lower
values by server owners. Some server owners want to, and have the
resources to send more packets per second to clients, and so they
may wish to send smaller updates sooner. Right now all ABM's are
coalesced into 1.0 second intervals, resulting in large send queues
to all clients. By reducing the amount of possible timers, one can
get a far better response rate and lower the perception of lag.

On the other side of the camp, some servers may want to increase
these values, which again isn't easily doable.

The global settings abm_interval and nodetimer_interval are set to
current values by default. I've tested with 0.2/0.5 type values
and noticed a greatly improved response and better scattering of
nodetimers, as well as enjoying not faceplanting into doors with
pressure plates anymore.
2022-05-21 16:13:26 +02:00
est31 eaab9d5586
Add option to not send pre v25 init packet
The legacy init packet (pre v25) sends information about the client's
password that a server could use to log in to other servers if the
username and password are the same. All the other benefits of SRP of
protocol v25 are missed if the legacy init packet is still sent during
connection creation.

This patch adds an option to not send the v25 init packet. Not sending
the v25 packet means breaking compat with pre v25 servers, but as the
option is not enabled by default, no servers are affected unless the
user explicitly flips the switch. More than 90% of the servers on the
serverlist support post v25 protocols.

The patch also fixes a bug with greying out of non compliant servers
being done wrongly, the min and max params were mixed.
2022-05-21 16:13:26 +02:00
Diego Martínez 79667b4dc6
Add options for screenshot format and quality 2022-05-21 16:13:26 +02:00
paramat 7f85241781
Documentation: Clarify global and mapgen-specific mapgen flags 2022-05-21 16:13:25 +02:00
Auke Kok 9e994e0e39
Introduce "protection_bypass" privilege.
This privilege allows map protection bypassing for server operators
and world moderators.

Initially I had thought that bypassing protection mods would have been
something that could entirely be done inside mods and minetest_game,
but the concept of protection is defined in core, in the code of
core.is_protected().

I don't feel that it would be logical to introduce a protection
concept in core, but not some way around that for server operators
to maintain map parts that need fixing, de-griefing or cleanup.

Others had noticed the same problems, and proposed a patch to
minetest_game. That patch is fine by itself, but it fails to add
protection bypass functionality for digging normal nodes and placing
nodes.

So, instead, we indroduce the new priv "protection_bypass" in core,
and modify 'on_place_node' and 'node_dig' to allow bypassing node
protections if the player holds this priv.

This priv was tested with protector redo by tenplus1.

A followup patch to Minetest Game will include allowing special checks
for doors, trapdoors, chests in Minetest Game.

Protection mods will likely want to mimic the changes in their relevant
code sections.
2022-05-21 16:13:25 +02:00
Auke Kok da5a169a45
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.
2022-05-21 16:13:24 +02:00
ShadowNinja 96b86f8440
Add AreaStore custom ID API 2022-05-21 16:13:24 +02:00
est31 d1e698f4fb
Add minetest.register_lbm() to run code on block load only 2022-05-21 16:13:23 +02:00
Jean-Patrick Guerrero 7d23793e05
Settings Tab: Regroup dropdown datas in tables 2022-05-21 16:13:23 +02:00
Rui914 32752d2bc5
Faster insertion into table 2022-05-21 16:13:23 +02:00
srfqi 8660983a8e
Add forgotten valleys mapgen in mapgen name
Missing `valleys` in `settingtypes.txt` and `minetest.conf.example`.
2022-05-21 16:13:22 +02:00
Jean-Patrick Guerrero 9f6730de09
Update settings tab + some misc. clean-up 2022-05-21 16:13:22 +02:00
est31 250f67bf2f
Don't generate trailing spaces in minetest.conf.example
If the default value of a setting was empty,
it previously generated a trailing space.
2022-05-21 16:13:21 +02:00
RealBadAngel 3cb36ba9ac
Mapblock mesh: Allow to use VBO 2022-05-21 16:13:21 +02:00
RealBadAngel 362d382289
Remove new_style_water 2022-05-21 16:13:20 +02:00
Jeija d0a7fe455e
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.
2022-05-21 16:13:20 +02:00
RealBadAngel 6817425d4d
Camera: remove auto tune FPS, single view range setting 2022-05-21 16:13:20 +02:00
RealBadAngel e0bf406bea
Remove preload_item_visuals code
Closes #3748
2022-05-21 16:13:19 +02:00
BlockMen ae7b3ec177
Restore simple settings tab and add advanced settings as dialog 2022-05-21 16:13:19 +02:00
paramat 41bef56c82
Documentation: Remove now unused 'vertical spawn range' 2022-05-21 16:13:18 +02:00
Diego Martínez 60a5b2ac4d
Initialize facedir and wallmounted tables only once.
This makes the functions a bit faster since they don't
have to recreate the tables every invocation, and makes
the code more readable.

Also, document `wallmounted_to_dir`.

The function was implemented but not documented in `lua_api.txt`.
2022-05-21 16:13:18 +02:00
Kahrl c4db9d23ff
Log /clearobjects mode 2022-05-21 16:13:17 +02:00
Kahrl ed493305e4
Add '/clearobjects quick' 2022-05-21 16:13:17 +02:00
RealBadAngel d8c9c7deac
Filmic HDR tone mapping 2022-05-21 16:13:17 +02:00
RealBadAngel e942240abf
Cleanup selection mesh code, add shaders for halo and selection boxes 2022-05-21 16:13:16 +02:00
Diego Martínez 6dc6ea419e
builtin: Fix `print` crashing on nil "holes".
The engine implementation of `print` packs the varargs into a
table and passes the table directly to `table.concat`. If you
pass any value not supported by `table.concat` (particularly
`nil`), the server crashes. This is unexpected behavior, as
`print` is supposed to be able to work with anything.

This patch changes the implementation so it first converts
all arguments using `tostring`, which fixes the issue and
makes the custom `print` function compatible with the stock
Lua behavior.
2022-05-21 16:13:16 +02:00
RealBadAngel 204f43d9c9
Use meshes to display inventory items 2022-05-21 16:13:15 +02:00
Splizard 35bae38ca3
Add admin command which says who the administator is for the server. 2022-05-21 16:13:15 +02:00
Duane Robertson 3a9235fc1c
Mgvalleys: use standard caves
Replace simple caves with V5 caves, adding unpredictable water and lava
settings and massive caves based on subterrain. Remove fast terrain mode
and accompanying settings. Remove superfluous temperature/humidity
settings. Remove lava/water height setting. Fix errors in humidity
handling and remove humidity_break_point setting. Move cave noises to
generateCaves. Fix minor formatting/naming issues and use
MYMAX/MYMIN/myround.
2022-05-21 16:13:14 +02:00
Auke Kok 3cef28e731
New timer design.
I could honestly not make much sense of the timer implementation
that was here. Instead I've implemented the type of timer algorithm
that I've used before, and tested it instead.

The concept is extremely simple: all timers are put in an ordered
list. We check every server tick if any of the timers have
elapsed, and execute the function associated with this timer.

We know that many timers by themselves cause new timers to be
added to this list, so we iterate *backwards* over the timer
list. This means that new timers being added while timers are
being executed, can never be executed in the same function pass,
as they are always appended to the table *after* the end of
the table, which we will never reach in the current pass over
all the table elements.

We switch time keeping to minetest.get_us_time(). dtime is
likely unreliable and we have our own high-res timer that we
can fix if it is indeed broken. This removes the need to do
any sort of time keeping.
2022-05-21 16:13:14 +02:00
Diego Martínez d10a5cfedb
Fix world config menu ignoring `name` in `mod.conf`. 2022-05-21 16:13:13 +02:00
RealBadAngel 580ea1201e
Show infotext with description for item entities 2022-05-21 16:13:13 +02:00
Rogier e577c35a3c
Fix error message in settings tab overlapping 'save' button
The save button is now fully functional again when an error message
is shown.

After an invalid value is entered in the settings tab dialog, the GUI
label for the error message that is shown was partly overlapping the
'save' button, so that the top half of the button could not be clicked
on.
2022-05-21 16:13:12 +02:00
Duane Robertson e64db54315
Add Valleys mapgen. 2022-05-21 16:13:12 +02:00
paramat bffee113cf
Mgflat: Set blank default spflags. Unhide 2022-05-21 16:13:11 +02:00
Rogier 6a3484c135
Fix the checking of flags values in the settings tab
Changes:
- Accept setting an empty flags-type value in the settings tab
  if the variable specification permits it
- Don't accept substrings of flag values
  E.g. with values: 'one,two,three', 'hree', 'w', etc. used to
  be accepted. Not any more
- Don't accept flags with random pattern-matching special characters
  E.g. with values: 'one,two,three', 'on.', '(o)[n]e*' etc. used
  to be accepted. Not any more.
2022-05-21 16:13:11 +02:00
Rogier 4e30d1bb0a
Improve parsing of setting types from settingtypes.txt for settings tab
- Accept numbers prefixed with '+'
- Accept multiple spaces instead of just a single one where spaces are expected
- Allow flags to have an empty default value
2022-05-21 16:13:10 +02:00
Dalai Felinto 2461f6d985
New 3D Mode: Pageflip
The pageflip mode requires a stereo quadbuffer, and a modern graphic
card. Patch tested with NVidia 3D Vision.

The mini-map is not drawn, but that's what is done for topbottom and
sidebyside modes as well.

Also most of the time the user would prefer the HUD to be off. That's
for the user to decide though, and toggle it manually.

Finally, the interocular distance (aka eye separation) is twice as much
as the "3d_paralax_strength" settings. I find this a strange design
decision. I didn't want to chance this though, since it's how the other
3d modes interpret this settings.
2022-05-21 16:13:10 +02:00
paramat b36217f608
Liquids: Flow into and destroy 'floodable' nodes
Add new node property 'floodable', default false
Define "air" as floodable = true in C++ and lua
2022-05-21 16:13:10 +02:00
Jean-Patrick Guerrero eadd017507
Alphabetical sorting of texture packs in menu (fixes #3487) 2022-05-21 16:13:09 +02:00
HybridDog 93de351e5f
Fix missing localization for obj 2022-05-21 16:13:09 +02:00
paramat 681434bc5d
Mgfractal: Add 3D and 4D fractals
3D Mandelbrot/Mandelbar
3D Christmas Tree
3D Mandelbulb
3D Cosine Mandelbulb
4D Mandelbulb
Plus corresponding julia set for each
Add credits for formulas
Rename parameter 'formula' to 'fractal'
Speed optimisations
2022-05-21 16:13:08 +02:00
est31 111be664a8
Fix some setting documentation
* Horizontal and vertical are used wrongly. Use height and width because
	horizontal/vertical describes different things. Thanks @kilbith for pointing out.
* Update minetest.conf.example and settings_translation_file.cpp
* Correct maximum/minimum copy paste mistake.
2022-05-21 16:13:08 +02:00
Alex Ford 8341ca836e
Add on_secondary_use when right clicking an item in the air 2022-05-21 16:13:07 +02:00
Robert Zenz e7bc7c6857
Simplify regex used in check_modname_prefix and other improvements.
Simplified the regex used, added comments and changed the error message
to contain the correct mod name.
2022-05-21 16:13:07 +02:00
paramat 90edce95c3
Mgfractal: Move julia set selection into formula parameter
Improve default parameters
Update and improve documentation
Unhide mapgen, but is still unstable
2022-05-21 16:13:06 +02:00
paramat 93356f96df
Mapgen: Add global 'decorations' flag
Flag is set by default in MapgenParams
The global 'trees' flag remains but is now
undocumented and unset by default in MapgenParams
Add mgv6_spflag 'trees' set by default in
defaultsettings.cpp to affect new worlds only
This is automatically backwards
compatible for existing worlds
2022-05-21 16:13:06 +02:00
Rui aedf15826c
Log static_spawn error only once 2022-05-21 16:13:05 +02:00
paramat 78d2dee49e
Mgfractal: Revert unnecessary duplication of parameters 2022-05-21 16:13:05 +02:00
paramat dfce6ebd28
Mgfractal: Create a choice of 4 mandelbrot formulas 2022-05-21 16:13:04 +02:00