Commit Graph

356 Commits

Author SHA1 Message Date
Jude Melton-Houghton 8817af07fb
Deprecate special handling of `${key}` syntax in metadata values (#12970) 2022-11-24 17:56:43 -05:00
Wuzzy 3c7f26d937
Add support for attached facedir/4dir nodes (#11432) 2022-11-24 17:56:07 -05:00
Abdou-31 d1b80b462e
Fix typos and en_US/en_GB inconsistency in various files (#12902) 2022-11-09 11:57:19 -05:00
Lars Müller 077627181e
Allow rotating entity selectionboxes (#12379) 2022-10-30 16:53:14 +01:00
DS 7153cb8a0b
Fix formspec focus (#12795) 2022-10-21 17:11:41 +02:00
fluxionary 6b6f886bcd
object ids are u16, not s16 (#12848) 2022-10-13 08:46:48 -04:00
ndren 2c3f641e0b
Simplify bit flip in sha1.cpp 2022-09-20 10:54:35 +02:00
Jude Melton-Houghton fe13f9dfd1
Fix potential use-after-free with item metadata (#12729)
This fixes a use-after-free bug in the case where itemstack metadata is accessed after the itemstack has been garbage-collected.
2022-09-11 19:28:37 +02:00
Herman Semenov 038da00e79
Code optimizations / refactor (#12704)
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
Co-authored-by: sfan5 <sfan5@live.de>
2022-09-06 11:21:09 +01:00
Mantar 95d7fcb949
Apply NetBSD string conversion workaround to OpenBSD as well (#12618) 2022-07-31 15:18:19 +02:00
sfan5 137eef6590 Move f1000 sanitizing to the places that still use this type 2022-07-14 20:55:45 +02:00
Lexi Hale 20bd6bdb68
Animated particlespawners and more (#11545)
Co-authored-by: Lars Mueller <appgurulars@gmx.de>
Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: Dmitry Kostenko <codeforsmile@gmail.com>
2022-07-13 11:57:12 +02:00
Nathanaël Courant 622d857bed Update my name 2022-06-16 21:38:32 +02:00
sfan5 3ac5a24b12
Sanitize player position and speed server-side (#12396) 2022-06-07 21:27:05 +02:00
savilli 1f39948bc3
Fix BSD iconv declaration 2022-06-05 15:20:29 +02:00
sfan5 9ee3dc71f1 Optimize JSON string (de)serialization routines
stringstreams were shown to be slow when reading/writing single characters
and there is lots of potential by having functions perform on existing
buffers whenever possible.
2022-05-21 17:46:10 +02:00
sfan5 70dc23f996 Improve testSerializeJsonString unit tests
this also removes the requirement that / is escaped, there is
no reason for doing so.
2022-05-21 17:46:10 +02:00
sfan5 f5a8593b11
Add more Prometheus metrics (#12274) 2022-05-09 21:20:58 +02:00
paradust7 0704ca0550
Make logging cost free when there is no output target (#12247)
The logging streams now do almost no work when there is no output target for them.

For example, if LL_VERBOSE has no output targets, then `verbosestream << x` will return a StreamProxy with a null target. Any further `<<` operations applied to it will do nothing.
2022-05-04 20:55:01 +02:00
sfan5 e7659883cc Async environment for mods to do concurrent tasks (#11131) 2022-05-02 20:56:06 +02:00
Lars Müller fccf1e2eac
Support CSS Color Module Level 4 (#12204) 2022-04-27 17:00:02 -04:00
ShadowNinja f5e54cd398 Fix OOB read in trim("") 2022-04-08 14:55:21 +01:00
ShadowNinja dae6fe91a1 Update directory name sanitization
Only ASCII spaces have to be handles specially, and leading spaces are
also disallowed.
2022-04-08 14:55:21 +01:00
ShadowNinja 00ebedad93 Add additional reserved directory names 2022-04-08 14:55:21 +01:00
ShadowNinja 7993909fab Spacing fixes 2022-04-08 14:55:21 +01:00
ShadowNinja 5683bb76cc Fix compiler warnings 2022-04-08 14:55:21 +01:00
Daroc Alden 598efbf7f9
Fix memory leak from SpatialAreaStore (#12120) 2022-03-09 19:28:12 +01:00
sfan5 04bd253390 Move the codebase to C++14 2022-02-26 14:39:41 +01:00
ShadowNinja 29d2b2ccd0
Print announce error response (#11878)
Fix HTTPFetch caller and request ID to 64 bits
Check that allocated caller ID is not DISCARD
Print body if serverlist request returns error
Don't print control characters from HTTP responses
Document special HTTPFetch caller IDs
Allow unicode to be printed
2022-01-01 22:44:56 +01:00
JosiahWI 7f6306ca96
Restore GCC 5 compatibility (#11778) 2021-12-28 14:05:49 +01:00
SmallJoker 57a59ae92d
Network: Delete copy constructor and use std::move instead (#11642)
This is a follow-up change which disables class copies where possible to avoid unnecessary memory movements.
2021-12-01 20:22:33 +01:00
sfan5 660e63dbae
Fix item duplication if player dies during interact callback (alternative) (#11662) 2021-10-25 20:30:27 +02:00
Wuzzy fe7195badb Make /status message easier to read 2021-10-15 18:13:57 +02:00
nia 2628316842
Fix src/util/string.cpp on NetBSD
- iconv() prototype changed from traditional Unix defintion
  to POSIX definition in 9.99.x.
- wchar_t is not a valid character set for iconv. Share code
  with Android for using UTF-32.
2021-09-19 20:23:52 +02:00
sfan5 fd8a8501bc
Shave off buffer copies in networking code (#11607) 2021-09-17 18:14:25 +02:00
sfan5 75bf9b75ca
Make sure relevant std::stringstreams are set to binary 2021-09-11 21:06:57 +02:00
hecks 80d12dbedb
Add a simple PNG image encoder with Lua API (#11485)
* Add a simple PNG image encoder with Lua API
Add ColorSpec to RGBA converter
Make a safety wrapper for the encoder
Create devtest examples

Co-authored-by: hecktest <>
Co-authored-by: sfan5 <sfan5@live.de>
2021-07-29 05:10:10 +02:00
x2048 f5706d444b
Improve shadow rendering with non-default camera FOV (#11385)
* Adjust minimum filter radius for perspective

* Expand shadow frustum when camera FOV changes, reuse FOV distance adjustment from numeric.cpp

* Read shadow_soft_radius setting as float

* Use adaptive filter radius to accomodate for PSM distortion

* Adjust filter radius for texture resolution
2021-07-11 08:15:19 -07:00
Lars Müller 89f3991351
Fix base64 validation and add unittests (#10515)
Implement proper padding character checks
2021-05-30 20:23:12 +02:00
Vincent Robinson 074e6a67de
Add `minetest.colorspec_to_colorstring` (#10425) 2021-04-23 21:37:24 +02:00
sfan5 f0bad0e2ba
Reserve vectors before pushing and other code quality changes (#11161) 2021-04-05 13:38:31 +02:00
Wuzzy 62e3593944 Tweak duration_to_string formatting 2021-03-16 18:37:46 +01:00
hecks 225e69063f
Keep mapblocks in memory if they're in range (#10714)
Some other minor parts of clientmap.cpp have been cleaned up along the way
2021-02-26 21:23:46 +01:00
rubenwardy f85e9ab925
Add nametag background setting and object property (#10937) 2021-02-17 19:51:28 +00:00
sfan5 c834d2ab25 Drop wide/narrow conversion functions
The only valid usecase for these is interfacing with OS APIs
that want a locale/OS-specific multibyte encoding.
But they weren't used for that anywhere, instead UTF-8 is pretty
much assumed when it comes to that.
Since these are only a potential source of bugs and do not fulfil
their purpose at all, drop them entirely.
2021-02-02 20:46:08 +01:00
sfan5 5e392cf34f Refactor utf8_to_wide/wide_to_utf8 functions 2021-02-02 20:46:08 +01:00
sfan5 74762470b2 Fix some minor code issues all over the place 2020-12-24 13:44:54 +01:00
SmallJoker 947466ab28 (se)SerializeString: Include max length in the name
This commit clarifies the maximal length of the serialized strings.
It will avoid accidental use of serializeString() when a larger string can be expected.

Removes unused Wide String serialization functions
2020-10-01 09:52:59 +02:00
SmallJoker ca5c2dbefa Clean up serialization
This reverts 1a5b4b3 and further functions in serialize.cpp that are unused

The intend for a sane NetworkPacket/stream replacement was good, but a wrapper
class around i/ostream might be more versatile than introducing a new
vector-based serialization class.
2020-10-01 09:52:59 +02:00
Seeker d22fd6fc34
Fix build for Visual Studio (explicitly cast pointers) (#10256) 2020-08-03 23:38:45 +02:00
SmallJoker f34abaedd2 decode_base64: Allow '=' padding character
'=' is a valid character, but minetest.decode_base64 returned nil when it was used for padding.
2020-07-29 20:46:42 +02:00
Hugues Ross 3ce03d1c2a
Sanitize world directory names on create. Keep original name separate (#9432)
Blacklisted characters are replaced by '_' in the path. The display name is stored in world.mt, and duplicate file names are resolved by adding an incrementing suffix (_1, _2, _3, etc).
2020-07-28 19:16:57 +02:00
sfan5 471e567657 Value copy / allocation optimizations mostly in server, SAO and serialize code 2020-05-27 21:58:40 +02:00
Awkor 037422fdba
Modernize include guards and add missing ones (#9898) 2020-05-23 13:23:05 +02:00
Loic Blot 56bababcdf Add MetricsBackend with prometheus counter support 2020-04-29 07:48:08 +02:00
sfan5 515d38a702 Fix truncation warning for F1000_MIN, F1000_MAX 2020-04-27 06:58:34 +02:00
EvidenceB Kidscode cee3c5e73d
Add server side translations capability (#9733)
* Add server side translations capability
2020-04-25 07:20:00 +02:00
Maksim 23c6d0c31f
Android: fix handling non-latin characters on older Android devices (#9309) 2020-04-17 23:46:30 +02:00
Hugues Ross f780bae05c
Formspecs: Add state-selection to style elements (#9378) 2020-04-11 21:39:30 +01:00
Jean-Patrick Guerrero 0e88176db8
GUIHyperText: Fix bug with UTF8 chars in action name + simplify UTF8 stringw conversion (#9437)
Co-authored-by: Pierre-Yves Rollo <dev@pyrollo.com>
2020-03-07 14:01:11 +01:00
SmallJoker 9cb3219f34 EnrichedString: Fix substr segfault caused by non-formatted text 2020-01-24 21:06:30 +01:00
SmallJoker a1da9caecf EnrichedString: Fix uninitialized variable m_default_length 2020-01-23 20:14:46 +01:00
SmallJoker 1892ff3c0d
StaticText/EnrichedString: Styling support (#9187)
* StaticText/EnrichedString: Styling support

* Fix tooltip fg/bgcolor

* Fix default color for substr(), add unittests
2020-01-22 19:09:11 +01:00
Maksim c396800629 Android: fix cyrillic characters, update iconv lib (#9117) 2020-01-13 07:10:15 +01:00
Pierre-Yves Rollo 72416a6a1f Formspec: add hypertext element 2019-11-03 11:45:33 +01:00
ANAND 3799ffd9d5 Move Quicktune code to util/ (#8871) 2019-09-29 13:41:13 +02:00
SmallJoker fec30e37ac
Fix AreaStore's IDs persistence (#8888)
Improve documentation
Read old formats
Fix free ID function. Return first gap in map
2019-09-21 17:54:52 +02:00
ANAND 8306f7d2e2 util/hex.h: Remove whitespace-only line (#8460) 2019-04-08 19:40:02 +01:00
starling13 1db4ae96b1 util/hex.h: Reserve result space in hex_encode()
Reserve enough space for the result of hex_encode() to eliminate reallocations
2019-04-07 12:01:42 +02:00
SmallJoker b7e1bca28c numeric: Fix clang, broken since d5456da 2019-02-09 18:33:31 +01:00
Paul Ouellette d5456da69d Use true pitch/yaw/roll rotations without loss of precision by pgimeno (#8019)
Store the rotation in the node as a 4x4 transformation matrix internally (through IDummyTransformationSceneNode), which allows more manipulations without losing precision or having gimbal lock issues.

Network rotation is still transmitted as Eulers, though, not as matrix. But it will stay this way in 5.0.
2019-02-07 21:26:06 +00:00
Leonid Bobrov 339341ba4e DragonFly BSD is somewhat identical to FreeBSD (#8159) 2019-02-03 09:53:54 +01:00
Loïc Blot 9854340c0b Drop libgmp on Android and use mini-gmp (#8047) 2019-01-04 16:45:37 +01:00
SmallJoker bba4563d89 Proselytize the network. Use IEEE F32 (#8030)
* Proselytize the network. Use IEEE F32
* Remove unused V2F1000 functions
2019-01-03 17:04:26 +01:00
SmallJoker 80eb762af1 ieee_float: Silence compiler warning
Trivial issue reported by @pgimeno
2018-12-18 19:50:07 +01:00
SmallJoker 839e935ba0 Network: Send IEEE floats (#7768) 2018-12-13 11:20:57 +01:00
CoderForTheBetter faa358e797 Add Lua methods 'set_rotation()' and 'get_rotation()' (#7395)
* Adds Lua methods 'set_rotation()' and 'get_rotation'. Also changed some method names to be more clear. Instead of an f32 being sent over network for yaw, now a v3f is sent for rotation on xyz axes. Perserved Lua method set_yaw/setyaw so that old mods still work, other wise to set yaw they would need to switch to set_rotation(0, yaw, 0).
2018-11-28 09:38:50 +01:00
Vitaliy 79e393cf4b Light curve: Simplify and improve code, fix darkened daytime sky (#7693) 2018-09-16 17:59:42 +01:00
Dániel Juhász 325bf68041 Raycast: export exact pointing location (#6304)
* Return intersection point in node coordinates.
* Clarify 'intersection_point' documentation
2018-08-16 20:10:08 +02:00
Ben Deutsch 153fb211ac Replace auth.txt with SQLite auth database (#7279)
* Replace auth.txt with SQLite auth database
2018-08-05 13:13:38 +02:00
SmallJoker f3997025fd Smoothed yaw rotation for objects (#6825) 2018-08-02 23:25:37 +01:00
zeuner d7d451c647 Fix build on gcc 5.0 (#7586) 2018-07-26 21:49:38 +02:00
HybridDog 53dd781927 Fix memory leak in guiConfirmRegistration 2018-07-06 11:13:18 +02:00
red-001 7bdf5eae05 Fix buffer overrun in SRP (#7484)
The old code got a pointer to the array instead of the first element, this resulted in a buffer overflow when the function was used more than once.
2018-06-26 10:02:26 +02:00
sfan5 b298b0339c Fix MurmurHash implementation to really be unaligned (#7482) 2018-06-26 00:12:09 +01:00
Lars Hofhansl a1868e8f6c Use server's zoom fov for distant world loading. 2018-05-15 18:49:11 -07:00
Thomas--S 9577a4396a Formspecs: Allow setting alpha value for the box[] element 2018-04-23 18:50:50 +01:00
Paramat c6975febba
Zoom adjustDist(): Improve variable name (#7208) 2018-04-05 20:15:38 +01:00
Loic Blot 8e0b80aa36
Fix last performance-type-promotion-in-math-fn problems 2018-04-04 07:42:40 +02:00
Loïc Blot a90d27e1e2
Optimize a little bit isBlockInSight, adjustDist & collisions (#7193)
* Use constexpr + unroll some calculations to cache definitively some calculations
* Unroll some calls in collision code & use a constref instead of a copy in one occurence
2018-04-04 00:43:08 +02:00
Loic Blot 05fe3b06c8
Fix last clang-tidy reported problems for performance-type-promotion-in-math-fn
Based on https://travis-ci.org/minetest/minetest/jobs/361810382 output

Also fix 2 missing copyright notices
2018-04-03 23:05:22 +02:00
Loïc Blot 67a4cb7d8a Fix various clang-tidy reported performance-type-promotion-in-math-fn 2018-04-03 18:16:17 +02:00
Lars Hofhansl fad263dec9 Revert "Add an active object step time budget #6721"
This reverts commit 9c669016d1.
See #6907
2018-01-12 23:47:39 -08:00
you e7b44c3295 Fix Wstringop-overflow warning from util/srp.cpp (#6855)
* Fix Wstringop-overflow warning from util/srp.cpp
2018-01-04 14:25:20 +01:00
rubenwardy 026ad912af Fix rounding error in g/set_node caused by truncation to float 2017-12-26 21:55:08 +00:00
adrido 551c12391a directiontables: Fix MSVC compiler error (#6785) 2017-12-14 19:46:42 +01:00
Lars Hofhansl 9c669016d1 Add an active object step time budget #6721
This can be set via the active_object_interval option.
2017-12-06 12:21:54 -08:00
Lars Hofhansl ae9b1aa177 Allow zoom to actually show more data.
This allows the client to retrieve blocks at a greater distance
from the server, thus allowing for a real zoom.
2017-11-15 22:03:58 -08:00
Vitaliy 20a85d76d9 Move files to subdirectories (#6599)
* Move files around
2017-11-08 23:56:20 +01:00
Loic Blot f36e323175
directiontables.cpp: fix a warning reported by VS2017 2017-10-17 22:29:15 +02:00