| Commit message (Collapse) | Author | Age |
|
|
| |
Caused by dc5bc6c and them made worse by 5ebf8f9
|
|
|
|
| |
lua_tonumber overflow in snprintf (12 bytes and only 10 can be written)
|
|
|
|
|
|
|
| |
This unifies the settings APIs.
This also unifies the sync and async registration APIs, since the async
registration API did not support adding non-functions to the API table.
|
| |
|
|
|
|
| |
* [CSM] Add event on_place_node API lua
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix various performance issues reported by cppcheck + code style (CI)
* Make CI happy with code style on master
* guiFileSelectMenu: remove useless includes
* some performance fixes pointed by cppcheck
* remove some useless casts
* TextDest: remove unused setFormSpec function
* Fix various iterator post-increment reported by cppcheck
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This callback is called if a liquid definitely floods a non-air
node on the map. The callback arguments are (pos, oldnode, newnode)
and can return a `bool` value indicating whether flooding the
node should be cancelled (`return true` will prevent the node
from flooding).
Documentation is added, the callback function was tested with a
modified minetest_game.
Note that `return true` will likely cause the node's `on_flood()`
callback to be called every second until the node gets removed,
so care must be taken to prevent many callbacks from using this
return value. The current default liquid update interval is 1.0
seconds, which isn't unmanageable.
The larger aim of this patch is to remove the lava cooling ABM,
which is a significant cost to idle servers that have lava on their
map. This callback will be much more efficient.
|
|
|
|
| |
* Also remove 2 non declared but defined functions
* Make some functions around const ref changes const
|
|
|
|
|
|
|
|
|
|
| |
* Resource leak: CHECK_FILE_ERR returns, without freeing chunk_name.
Found with static analysis.
* Resource leak: leaks `page` on error path.
Found with static analysis.
|
|
|
|
|
|
|
|
|
|
| |
Adds the possibility to colorize item stacks based on their metadata.
In the item/node definition you can specify palette (an image file)
and color (fallback color if the item has no palette or metadata).
Then you can add palette_index to the metadata.
Dropped itemstacks with different colors do not merge.
|
| |
|
|
|
|
| |
* Add event on_connect player API lua
|
|
|
|
| |
Also remove them from whitelist
|
|
|
|
|
|
|
| |
Add the missing paramtype2 for param2 controlling the liquid level
inside the glasslike_framed drawtype.
Add missing documentation of the feature to lua_api.txt.
Update and improve comments for drawtype enumerations in nodedef.h.
|
| |
|
|
|
|
|
|
| |
* [CSM] Add core.get_timeofday & core.get_day_count env calls
* [CSM] Add core.get_node_level, core.get_node_max_level, core.find_node_near
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* squashed: CSM: Implement register_globalstep
* Re-use fatal error mechanism from server to disconnect client on CSM error
* Little client functions cleanups
* squashed: CSM: add core.after function
* core.after is shared code between client & server
* ModApiUtil get_us_time feature enabled for client
|
|
|
|
|
|
| |
* Add on_death callback
* Add on_hp_modification & on_damage_taken callbacks
* move preview code to preview.lua
|
|
|
|
|
|
|
|
|
|
| |
* rename GameScripting to ServerScripting
* Make getBuiltinLuaPath static serverside
* Add on_shutdown callback
* Add on_receiving_chat_message & on_sending_chat_message callbacks
* ScriptApiBase: use IGameDef instead of Server
This permits to share common attribute between client & server
* Enable mod security in client side modding without conditions
|
|
|
|
|
| |
The return value should be interpreted as a boolean saying whether
the lua on_punch function handled damage or the system needs to.
|
| |
|
|
|
|
|
|
| |
- Increase ContentFeatures serialization version
- Color property and palettes for nodes
- paramtype2 = "color", "colored facedir" or "colored wallmounted"
|
|
|
|
|
| |
os.exit will exit not using proper resource liberation paths.
Mods should call the proper exit mod using our API
|
|
|
|
| |
* Added lua tracebacks to some errors where you have been blind to what actually went wrong
|
|
|
|
|
|
|
| |
Currently, lua does a regular exit() after a lua panic, which can make
a problem hard to debug. Invoking FATAL_ERROR() instead will print
some useful information, and abort() minetest, so that a debugger can
be used to analyze the situation.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Trying to resolve a path with RemoveRelativePathComponents that can't
be resolved without leaving leading parent components (e.g. "../worlds/foo"
or "bar/../../worlds/foo") will fail. To work around this, we leave
the relative components and simply remove the trailing components one
at a time, and bail out when we find a parent component. This will
still fail for paths like "worlds/foo/noexist/../auth.txt" (the path
before the last parent component must not exist), but this is fine
since you won't be able to open a file with a path like that anyways
(the O.S. will determine that the path doesn't exist.
Try `cat /a/../etc/passwd`).
|
| |
|
|
|
|
|
| |
It used to drop all of the return values from the
insecure version of the function.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Modification of the emergeblocks internal state was not protected
by a lock, causing a race condition.
This can be reproduced by repeatedly running emergeblocks for an
already-generated section of the map (with multiple emerge threads).
|
|
|
|
| |
Also remove some unused parameters/functions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds several new ways that the plantlike drawtype mesh can be changed.
This requires paramtype2 = "meshoptions" to be set in the node
definition. The drawtype for these nodes should be "plantlike".
These modifications are all done using param2. This field is now
a complex bitfield that allows some or more of the combinations to
be chosen, and the mesh draw code will choose the options based as
neeeded for each plantlike node.
bit layout:
bits 0, 1 and 2 (values 0x1 through 0x7) are for choosing the plant
mesh shape:
0 - ordinary plantlike plant ("x" shaped)
1 - ordinary plant, but rotated 45 degrees ("+" shaped)
2 - a plant with 3 faces ("*" shaped)
3 - a plant with 4 faces ("#" shaped)
4 - a plant with 4 faces ("#" shaped, leaning outwards)
5 through 7 are unused and reserved for future mesh shapes.
bit 3 (0x8) causes the plant to be randomly offset in the x,z
plane. The plant should fall within the 1x1x1 nodebox if regularly
sized.
bit 4 (0x10) causes the plant mesh to grow by sqrt(2), and will cause
the plant mesh to fill out 1x1x1, and appear slightly larger. Texture
makers will want to make their plant texture 23x16 pixels to have the
best visual fit in 1x1x1 size.
bit 5 (0x20) causes each face of the plant to have a slight negative
Y offset in position, descending up to 0.125 downwards into the node
below. Because this is per face, this causes the plant model to be
less symmetric.
bit 6 (0x40) through bit 7 (0x80) are unused and reserved for
future use.
!(https://youtu.be/qWuI664krsI)
|
| |
|
| |
|
|
|
| |
Note that the macro CHECK_FILE_ERR implements the code removed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We introduce a new nodebox type "connected", and allow these nodes to
have optional nodeboxes that connect it to other connecting nodeboxes.
This is all done at scenedraw time in the client. The client will
inspect the surrounding nodes and if they are to be connected to,
it will draw the appropriate connecting nodeboxes to make those
connections.
In the node_box definition, we have to specify separate nodeboxes for
each valid connection. This allows us to make nodes that connect only
horizontally (the common case) by providing optional nodeboxes for +x,
-x, +z, -z directions. Or this allows us to make wires that can connect
up and down, by providing nodeboxes that connect it up and down (+y,
-y) as well.
The optional nodeboxes can be arrays. They are named "connect_top,
"connect_bottom", "connect_front", "connect_left", "connect_back" and
"connect_right". Here, "front" means the south facing side of the node
that has facedir = 0.
Additionally, a "fixed" nodebox list present will always be drawn,
so one can make a central post, for instance. This "fixed" nodebox
can be omitted, or it can be an array of nodeboxes.
Collision boxes are also updated in exactly the same fashion, which
allows you to walk over the upper extremities of the individual
node boxes, or stand really close to them. You can also walk up
node noxes that are small in height, all as expected, and unlike the
NDT_FENCELIKE nodes.
I've posted a screenshot demonstrating the flexibility at
http://i.imgur.com/zaJq8jo.png
In the screenshot, all connecting nodes are of this new subtype.
Transparent textures render incorrectly, Which I don't think is
related to this text, as other nodeboxes also have issues with this.
A protocol bump is performed in order to be able to send older clients
a nodeblock that is usable for them. In order to avoid abuse of users
we send older clients a "full-size" node, so that it's impossible for
them to try and walk through a fence or wall that's created in this
fashion. This was tested with a pre-bump client connected against a
server running the new protocol.
These nodes connect to other nodes, and you can select which ones
those are by specifying node names (or group names) in the
connects_to string array:
connects_to = { "group:fence", "default:wood" }
By default, nodes do not connect to anything, allowing you to create
nodes that always have to be paired in order to connect. lua_api.txt
is updated to reflect the extension to the node_box API.
Example lua code needed to generate these nodes can be found here:
https://gist.github.com/sofar/b381c8c192c8e53e6062
|
|
|
|
|
|
| |
* Replace string by-val passing with const reference
* Fix code style
* Remove redundant `int table` definition and indentation level
|
| |
|
|
|
|
|
| |
Throwing a LuaError calls destructors as it propagates up the stack,
wheres lua_error just executes a longjmp.
|
|
|
|
| |
This function could be used to steal insecure environments from trusted mods.
|
|
|
|
| |
Previous commits broke it... :(
|
| |
|