601 Commits

Author SHA1 Message Date
paramat
c307b0ae1d Find nodes in area (under air): Raise volume limit and document it 2018-06-03 17:32:00 +02:00
sfan5
588b02948b Check argument types inside MetaDataRef Lua API (#7045) 2018-06-03 17:32:00 +02:00
red-001
c0eeec2b1a Move setlocale from Lua to C++. 2018-06-03 17:32:00 +02:00
Pedro Gimeno
1cd770e812 Fix buffer parameter not working in LuaPerlinNoiseMap::l_getMapSlice() 2018-06-03 17:32:00 +02:00
rubenwardy
a7be7716f8 Fix rounding error in g/set_node caused by truncation to float 2018-06-03 17:32:00 +02:00
sfan5
bae4de48c6 Hint at problematic code when logging deprecated calls 2018-06-03 17:32:00 +02:00
sfan5
2f2a775590 Add minetest.safe_write_file() to script API 2018-06-03 17:32:00 +02:00
Rob Blanckaert
c9e758408d Add sha1 to lua utils. (#6563) 2018-06-03 17:32:00 +02:00
SmallJoker
483f0e27ca Unkown nodes: Provide position on interact (#6505)
* Unkown nodes: Provide position on interact
2018-06-03 17:31:59 +02:00
DTA7
1219f8ef7b Set placer to nil instead of a non-functional one in item_OnPlace (#6449)
* Set placer to nil instead of a non-functional one

This requires nil checks in core.rotate_node and core.rotate_and_place.
2018-06-03 17:31:59 +02:00
sfan5
8e3a110314 ServerEnv: Clean up object lifecycle handling (#6414)
* ServerEnv: Clean up object lifecycle handling
2018-06-03 17:31:59 +02:00
Dániel Juhász
4836612b9f Automatic item and node colorization (#5640)
* Automatic item and node colorization

Now nodes with a palette yield colored item stacks, and colored items
place colored nodes by default. The client predicts the colorization.

* Backwards compatibility

* Use nil

* Style fixes

* Fix code style

* Document changes
2018-06-03 17:31:59 +02:00
SmallJoker
a766044a0c find_nodes_in_area: Extend maximal count to U32_MAX (#5277)
Extend documentation, limit area volume
Remove u16 count limitation

* Prevent integer overflow, replace minp/maxp with pos1/pos2
2018-06-03 17:31:59 +02:00
Loïc Blot
bee06e6a53 Enhance ABM performance a little bit by removing two std::set copy (#5815)
* Enhance ABM performance a little bit by removing two std::set copy

* ActiveBlockModifier::getTriggerContents now returns a const ref
* ActiveBlockModifier::getRequiredNeighbors now returns a const ref
* ActiveBlockModifier::getRequiredNeighbors is now purely virtual

* Little code style fix
2017-05-25 16:43:55 +02:00
Loic Blot
c8fc6d9c0d Fix wrong return value in get_sky Lua call since ad9fcf859ec2347325830e09504ae96968b51ea8
Fix #5803
2017-05-23 19:59:47 +02:00
Loic Blot
30a5ff4c09 LINT fix & check all files with clang-format
Seems the diff mode doesn't work well, PR are detected as working whereas in master it's shown it's problematic (and really problematic). Use same check everywhere
2017-05-22 07:28:35 +02:00
Pierre-Adrien Langrognet
69f19f1af7 [CSM] Add send_chat_message and run_server_chatcommand API functions (#5747)
* [CSM] Add send_chat_message and run_server_chatcommand API functions

* Add client-side chat message rate limiting

* Limit out chat queue size

* [CSM] Add minetest.clear_out_chat_queue API function and .clear_chat_queue chatcommand

* Last fixes/cleanups before merge
2017-05-21 23:06:51 +02:00
Loic Blot
353db2e4a0 Fix LINT broken by dfa0c15ce045705f05487d623dc7beca6c945b4b 2017-05-21 17:30:00 +02:00
bigfoot547
004f49298c [CSM] Add function to get the definition of items (#5732)
Add node def and item def documentation.

Please be ready for merge!
2017-05-21 14:40:55 +02:00
SmallJoker
1dd555ebd4 [CSM] Correct the log destination of print() (#5784) 2017-05-20 16:46:12 +02:00
red-001
c39d110208 Fix CSM crash (#5779)
Caused by dc5bc6c and them made worse by 5ebf8f9
2017-05-20 16:45:49 +02:00
Loïc Blot
8fa097e102 When minimap is disabled in configuration, really disable it (#5771)
* When minimap is disabled in configuration, really disable it
2017-05-19 07:25:27 +02:00
Loic Blot
2ffea9f1e8 Fix a warning pointed by GCC 7.1
lua_tonumber overflow in snprintf (12 bytes and only 10 can be written)
2017-05-18 20:55:27 +02:00
sfan5
100a6036d8 Private nodemeta (#5702)
* Private node metadata that isn't sent to the client
2017-05-10 15:29:21 +02:00
Loïc Blot
289f26ef4a read_schematic_replacements: ensure fields are strings (#5726)
* read_schematic_replacements: ensure fields are strings

add a type check before reading strings on read_schematic_replacements deserializer

* throw LuaError instead of asserting the whole client
2017-05-08 20:43:03 +02:00
Loïc Blot
86253bb961 Player attrs: permits to remove an attribute by setting value to nil (#5716)
* Player attrs: permits to remove an attribute by setting value to nil

When doing player:set_attribute("attr", nil) remove attribute

Also remove a useless check on C++ API part (already done by checkplayer)

Fix #5709
2017-05-07 12:13:15 +02:00
Loic Blot
698e5b2ff1 LINT fix since d0678948165768472fc940c03e78cba787f49ea5 2017-05-07 11:07:17 +02:00
T0ny2
d71a4b4586 Replace occurrence of luaL_reg in l_camera.cpp
Related to commit 41c5483. Replace an occurrence of luaL_reg in
src/script/lua_api/l_camera.cpp (added by commit de028fc).
2017-05-07 06:09:30 +01:00
ShadowNinja
35d2f88f51 Clean up numeric.h and split FacePositionCache from it
I also optiized FacePositionCache a bit: I removed a map
lookup and vector copy from both branches of getFacePosition.
2017-05-06 16:09:45 -04:00
ShadowNinja
dfb4074a5a Use a settings object for the main settings
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.
2017-05-06 15:33:19 -04:00
Loic Blot
2a01ec3fdd Fix codestyle since CSM Camera API 2017-05-06 21:30:27 +02:00
red-001
67be889162 [CSM] add on_item_use (#5544) 2017-05-06 21:12:44 +02:00
bigfoot547
4a0dcb8788 [CSM] Add camera API (#5609)
* [CSM] Add camera API
roper rebase & squash

* Address nerzhul's review
2017-05-05 22:07:36 +02:00
red-001
845f1beccc Add option to also check the center to find_node_near (#5255)
* Add option to also check the center to `find_node_near`
2017-05-04 22:52:58 +02:00
red-001
c1cbc9b991 Add function to get server info. 2017-05-04 04:25:45 +01:00
paramat
ad2e38e257 Set sky API: Add bool for clouds in front of custom skybox
Default true.
Add 'm_clouds_enabled' bool to sky.h, set from new bool in 'set sky' API.
Make 'getCloudsVisible()' depend on 'm_clouds_enabled' instead of
'm_visible' (whether normal sky is visible).
2017-05-02 20:42:35 -07:00
SmallJoker
1b21a680f0 Sneak: Improve and fix various things
Remove useless `got_teleported`.
Fix jitter when walking against the sneak limits.
Fix damage evading on sneak ladders.
2017-05-03 03:16:20 +01:00
Brandon
893c2dfb5e Sound API: Add fading sounds 2017-05-03 03:12:45 +01:00
Ben Deutsch
4236cf8e5e Add clouds API 2017-04-30 00:06:13 +01:00
shivajiva101
f290d3c66d Fix visual slide issue with set_detach, fixes #5620 2017-04-29 18:18:46 +02:00
Vincent Glize
aa2fb725a0 [CSM] Add event on_place_node API lua (#5548)
* [CSM] Add event on_place_node API lua
2017-04-29 12:08:16 +02:00
Vincent Glize
8b9f88a170 [CSM] add screenshot api lua (#5674)
* [CSM] add screenshot api lua
2017-04-29 09:16:06 +02:00
Loïc Blot
0c74031aab Don't permit to copy Scripting classes (Client,Server,Mainmenu) 2017-04-27 11:52:44 +02:00
red-001
76bcda535e Allow scripts to get the client protocol version in non-debug builds. (#5649) 2017-04-27 11:49:44 +02:00
ShadowNinja
b41838b8ef Rename Scripting API files for consistency 2017-04-25 13:41:36 -04:00
Loïc Blot
24467fdfba Fix various points reported by cppcheck (#5656)
* 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
2017-04-25 10:21:42 +02:00
Loïc Blot
799890d946 Player data to Database (#5475)
* Player data to Database

Add player data into databases (SQLite3 & PG only)

PostgreSQL & SQLite: better POO Design for databases

Add --migrate-players argument to server + deprecation warning

* Remove players directory if empty
2017-04-23 14:35:08 +02:00
Loïc Blot
82c33da94f Pass clang-format on various cpp/header files (#5559) 2017-04-23 09:52:40 +02:00
Auke Kok
f106e1cb0b Add on_flood() callback.
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.
2017-04-22 01:23:51 +01:00
Loïc Blot
5cb71bd1f8 lua: remove core.cause_error call (#5637)
it was used in minimal to trigger core crash, not very useful
2017-04-22 00:34:00 +02:00