1
0
mirror of https://github.com/minetest/minetest.git synced 2025-07-04 08:50:22 +02:00

984 Commits

Author SHA1 Message Date
0ade097e99 Allow the server to control fog_distance and fog_start via the sky-api (#13448) 2023-06-30 19:11:17 -07:00
32ff832108 Save Lua globals after mod loading
These are used for the async env currently and will be needed elsewhere soon.
2023-06-23 09:05:26 +02:00
DS
edcbfa31c9 Sound refactor and improvements (#12764) 2023-06-16 20:15:21 +02:00
8b73743baa Reduce number of recursively included headers
This should improve compilation speed.

Things changed:
* Prefer forward-declarations in headers.
* Move header-includes out of headers if possible.
* Move some functions definitions out of headers.
* Put some member variables into unique_ptrs (see Client).
2023-04-27 18:50:33 +02:00
f9b1176fa9 Track server's max AsyncRunStep 2023-04-14 00:09:48 +01:00
ba2fee0751 Particle spawner: Fix missing parameters
The changes done to clientpackethandler.cpp and server.cpp move the
compatibility code into a protocol version check so that older code
parts can easily be removed in the future (e.g. bump of minimal version).
2023-04-08 17:23:17 +02:00
DS
ed632f3854 Safely handle block deletion (#13315)
Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com>
2023-03-24 12:34:44 +01:00
5fa63a0b0c Fix server-side formspec state keeping issue (#13332) 2023-03-19 20:23:11 +01:00
39f4d26177 Add minetest.get_player_window_information() (#12367) 2023-02-27 22:58:41 +00:00
2083252c05 Sky: transmit body_orbit_tilt to client. (#13193)
This obsoletes the current client-side setting entirely. The server can
transmit the tilt to the client directly and will send 0.0f as default
value.

Co-authored-by: x2048 <codeforsmile@gmail.com>
Co-authored-by: sfan5 <sfan5@live.de>
2023-02-26 01:08:33 +01:00
8fded9d990 Disable Prometheus in singleplayer mode 2023-01-14 13:11:15 +01:00
6d45c243f8 Add dynamic exposure correction (#12959)
* Add uniform for frame delta time
* Adjust exposure in logarithmic (EV) space
* Add network support and LUA API
* Add testing mod
2023-01-06 22:33:25 +01:00
1e7804aaf6 Allow saturation to be controlled by the server. (#13075) 2022-12-25 16:15:32 -08:00
d13b12b791 Store MapEditEvent blocks in a vector (#13071) 2022-12-24 12:21:59 -05:00
7701e70dc9 Make MapEditEvent more complete
SetBlocksNotSent is no longer used.
2022-12-24 08:24:59 -05:00
7c21347a40 Rename "mod metadata" to "mod storage" everywhere 2022-11-24 17:58:25 -05:00
aaa05f901a Add mod storage PostgreSQL backend 2022-11-10 18:56:48 +01:00
d1b80b462e Fix typos and en_US/en_GB inconsistency in various files (#12902) 2022-11-09 11:57:19 -05:00
322c8cf270 Reduce exposure of various internals (#12885)
* refactoring(StaticObjectList): don't expose m_active and m_stored anymore

This prevents our old crap code where anyone can access to StaticObjectList. use proper modifiers. It also permits to do a short cleanup on MapBlock using a helper

* refactoring(MapBlock): reduce a bit exposed m_active_blocks variable

* refactoring: MapBlock::m_node_timers is now private

We already had various helpers to perform this privatization, just use it. Also factorize the MapBlock stepping code for timers using already existing code and importing them from ServerEnvironment to MapBlock.

It's currently done pretty straight forward without any inheritance as MapBlock is just used everywhere, maybe in a future we'll have ServerMapBlock over MapBlock. Currently for a simple function let's just use proper objects and add a comment warning

* refactoring(Server): fix duplicated function for add/remove node

* refactoring(guiFormSpecMenu): add removeAll function to prevent duplicated code

* refactoring(ShadowRenderer) + perf: code quality  + increase performance

* All callers are already using the point and we should never test a function with nullptr node, it's a bug. Removed workaround which was hacky and fix the bug
* Drop clientmap lookup from shadowrendered, just use directly its
  pointer and forbid to push it in the generic list
* Reduce memory pressure on the renderShadowObject by preventing
  deallocating and reallocating multiple vectors on each node

* refactoring(MapBlock): reduce exposure of MapBlock::m_static_objects

It's not complete as some parts of the code are pretty nested, but it's better than before :)

* fix: better working on new functions & drop unwanted 2 lines

Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com>

Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com>
2022-11-03 17:35:31 +01:00
b38ffdec27 Implement vector and node conversion in Lua (#12609)
Co-authored-by: sfan5 <sfan5@live.de>
2022-10-18 18:01:44 -04:00
907dcdcf7b Add unittests for item movement code (#11885) 2022-09-27 16:22:11 -04:00
f4a01f3a5d Avoid duplication of mod metadata in memory (#12562)
Co-authored-by: sfan5 <sfan5@live.de>
2022-09-26 17:03:43 -04:00
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
2d10fa7867 Prevent loading a world with unresolved dependencies (#12542) 2022-08-19 12:31:36 +01:00
4648d8f499 Deprecate loading a world with unresolved dependencies (#12541)
Co-authored-by: sfan5 <sfan5@live.de>
2022-07-17 14:45:20 +01:00
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
e51f474613 Sounds: Various little improvements (#12486)
Use SimpleSoundSpec where reasonable (OpenAL)
Ensure the sound IDs do not underflow or get overwritten -> loop in u16
Proper use of an enum.
2022-07-09 22:32:24 +02:00
051181fa6e Enforce limits of settings that could cause buggy behaviour (#12450)
Enforces the setting value bounds that are currently only limited by the GUI (settingtypes.txt).
2022-07-09 22:32:08 +02:00
142928e944 Allow to set maximum star opacity at daytime (#11663) 2022-07-02 19:57:48 +01:00
a463620edb Re-order sound-related code (#12382)
Dropped ServerSoundParams -> moved to ServerPlayingSound. This gets rid of the duplicated
'fade' and 'pitch' values on server-side where only one was used anyway.
SimpleSoundSpec is the basic sound without positional information, hence 'loop' is included.

Recursively added PROTOCOL_VERSION to most functions to reduce the versioning mess in the
future. Per-type version numbers are kept for now as a safety rope in a special case.
2022-06-20 21:56:12 +02:00
f4a53f7ee6 No damage effects on hp_max change (#11846) 2022-06-11 20:00:40 +02:00
261a8db9dd Optimize Server::sendMetadataChanged a bit
The distance check also never worked as intended, now fixed.
2022-05-29 14:00:19 +02:00
f195db2d14 Add API function to invoke player respawn
closes #12272
2022-05-29 14:00:19 +02:00
4e9e230e34 Deprecate game.conf name, use title instead (#12030) 2022-05-21 16:23:30 +01:00
ec9f157512 Use native packer to transfer globals into async env(s) 2022-05-10 22:37:42 +02:00
f5a8593b11 Add more Prometheus metrics (#12274) 2022-05-09 21:20:58 +02:00
1fa4f58080 Cache serialized mapblocks during sending
This reduces the
(absolute) time spent in Server::SendBlocks() from 700ms to 300ms
(relative) share of MapBlock::serialize() from 80% to 60%
in a test setup with 10 players and many block changes
2022-05-08 19:12:10 +02:00
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
e7659883cc Async environment for mods to do concurrent tasks (#11131) 2022-05-02 20:56:06 +02:00
56a558baf8 Refactor some Lua API functions in preparation for async env 2022-05-02 20:54:55 +02:00
a65f6f07f3 Clean up some auth packet handling related code 2022-04-28 20:05:26 +02:00
0b5b2b2633 Disentangle map implementations (#12148)
Fixes violation of Liskov substitution principle
Fixes #12144
2022-04-07 21:58:04 +02:00
0f25fa7af6 Add API to control shadow intensity from the game/mod (#11944)
* Also Disable shadows when sun/moon is hidden. Fixes #11972.
2022-03-26 16:58:26 +01:00
04bd253390 Move the codebase to C++14 2022-02-26 14:39:41 +01:00
c31b301722 Clean up ClientReady packet handling
fixes #12073
2022-02-17 23:20:33 +01:00
b9ee29a945 Send HUD flags only if changed 2022-02-08 19:28:32 +01:00
1c73902005 Clean up ClientInterface locking 2022-02-03 11:43:51 +01:00
91c6728eb8 Add game name to server status string 2022-01-28 17:15:10 +01:00
7c93b2d7a3 Give the ASCII console splash a facelift 2022-01-15 17:45:33 +01:00
379473b670 Improve situation around race condition with dynamic_add_media during client join 2022-01-15 17:45:08 +01:00