Commit Graph

174 Commits

Author SHA1 Message Date
x2048
f3b198e490 Return shadow_sky_body_orbit_tilt setting
Used as a default value when the game does not change the value via API (e.g. legacy server)
2023-03-24 12:34:21 +01:00
sofar
2083252c05 Sky: transmit body_orbit_tilt to client. ()
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
x2048
6d45c243f8 Add dynamic exposure correction ()
* 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
SmallJoker
03e710160f Lua API: Document shader dependencies of set_lighting() () 2022-12-26 21:59:55 +01:00
lhofhansl
1e7804aaf6 Allow saturation to be controlled by the server. () 2022-12-25 16:15:32 -08:00
Riceball LEE
6bf662cb9e set_nametag_attributes: don't reset nametags if text param is not touched
fixes 
2022-11-15 16:46:26 +01:00
Abdou-31
d1b80b462e Fix typos and en_US/en_GB inconsistency in various files () 2022-11-09 11:57:19 -05:00
Jude Melton-Houghton
7632af3c73 Consolidate API object code ()
Co-authored-by: sfan5 <sfan5@live.de>
2022-10-04 08:31:36 -04:00
SmallJoker
c8ee755c05 Physics overrides: Move values to a common struct ()
Co-authored-by: sfan5 <sfan5@live.de>
2022-08-12 10:17:02 +01:00
Zughy
bcc56803d7 Fix crash when stars are reset 2022-08-10 18:03:57 +02:00
Wuzzy
142928e944 Allow to set maximum star opacity at daytime () 2022-07-02 19:57:48 +01:00
sfan5
f195db2d14 Add API function to invoke player respawn
closes 
2022-05-29 14:00:19 +02:00
Lars Müller
1f27bf6380 Remove unneeded ObjectRef setter return values () 2022-04-10 23:20:51 +02:00
x2048
0f25fa7af6 Add API to control shadow intensity from the game/mod ()
* Also Disable shadows when sun/moon is hidden. Fixes .
2022-03-26 16:58:26 +01:00
Lars Müller
b9e886726c Readd basic_debug as a HUD flag () 2022-03-05 22:16:17 +01:00
Zughy
44fc888bd6 Allow get_sky to return a table () 2022-03-05 22:15:41 +01:00
Lars Müller
fe0b2d02bf Define control(bits) as "unset" for entities () 2022-01-27 22:22:58 +01:00
Zughy
37d80784dd Allow resetting celestial vault elements by leaving its arguments empty () 2022-01-22 12:42:49 +01:00
sfan5
5eb45e1ea0 Restore pass-through of direction keys ()
This moves relevant code into the PlayerControl class and gets rid of separate keyPressed variable.
2022-01-09 18:46:36 +01:00
Wuzzy
6910c8d920 Fix number of tool uses being off by 1..32767 () 2021-10-31 22:33:33 +00:00
savilli
3f1adb49ae Remove redundant on_dieplayer calls 2021-08-28 12:14:16 +02:00
NeroBurner
1d69a23ba4 Joystick sensitivity for player movement ()
This commit deprecates the forward, backward, left, and right binary
inputs currently used for player movement in the PlayerControl struct.
In their place, it adds the movement_speed and movement_direction
values, which represents the player movement is a polar coordinate
system.

movement_speed is a scalar from 0.0 to 1.0. movement_direction is
an angle from 0 to +-Pi:

	       FWD
	        0
	        _
	 LFT   / \   RGT
	-Pi/2 |   | +Pi/2
	       \_/
	       +-Pi
	       BCK

Boolean movement bits will still be set for server telegrams and
Lua script invocations to provide full backward compatibility.
When generating these values from an analog input, a direction is
considered active when it is 22.5 degrees away from either
orthogonal axis.

Co-authored-by: Markus Koch <markus@notsyncing.net>
Co-authored-by: sfan5 <sfan5@live.de>
2021-08-27 20:24:24 +02:00
SmallJoker
0c1e9603db HUD: Reject and warn on invalid stat types ()
This comes into play on older servers which do not know the "stat" type.
Warnings are only logged once to avoid spam within globalstep callbacks
2021-08-21 20:04:04 +02:00
sfan5
e7b05beb7d Validate staticdata and object property length limits ()
Some games provide users with enough freedom to create items
with metadata longer than 64KB, preventing this from causing
issues is on them but we'll still do the minimum not to abort
the server if this happens.
2021-08-19 20:14:22 +02:00
sfan5
a0047d6edc script: Replace calls to depreated luaL_openlib 2021-05-30 11:40:14 +02:00
rubenwardy
f85e9ab925 Add nametag background setting and object property () 2021-02-17 19:51:28 +00:00
sfan5
a01a02f7a1 Preserve immortal group for players when damage is disabled 2021-01-31 20:38:12 +01:00
Zughy
ea5d6312c1 ObjectRef: fix some v3f checks () 2021-01-21 18:37:38 +01:00
hecks
dd5a732fa9 Add on_deactivate callback for luaentities () 2021-01-02 15:14:29 +01:00
rubenwardy
2c3593b51e Fix unsafe cast in l_object 2020-12-23 22:24:58 +00:00
SmallJoker
fca4db4184 ObjectRef: Re-add legacy code for set_physics_override ()
These arguments are used at least by MTG beds and homedecor_common. A deprecation warning is shown to safely remove it in a future release.
2020-11-10 21:02:53 +01:00
Zughy
72b93ec0d7 Fix ObjectRef errors due to lua_isnil() ()
Treat 'none' values as 'nil'
2020-11-04 21:43:18 +01:00
rubenwardy
89dd05fdf3 Fix segfault in deprecation logging due to tail call, log by default () 2020-10-31 18:19:23 +00:00
Zughy
33b2c5f5b1 Clean up l_object.cpp ()
Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
2020-10-22 16:18:01 +01:00
Zughy
2341a4aff1 Add ObjectRef:get_children() ()
Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
2020-10-13 20:27:52 +01:00
Pierre-Yves Rollo
81c66d6efb Minimap as HUD element with API control
Features:
 * Define Minimap available modes (surface/radar, scale) from Lua, using player:set_minimap_modes()
 * New HUD elements for displaying minimap with custom size and placing
 * New minimap mode for displaying a texture instead of the map
2020-10-04 15:24:34 +02:00
Jordan Snelling
3068853e8a Add First Person Attachments ()
Fixes some other third person camera specific attachments.
Implements a single new flag for entities to be forced visible in first person mode.
Old mods do not need to be updated to use the new flag and are fully backwards compatible.
2020-10-04 15:10:34 +02:00
rubenwardy
3250b37e32 Deprecate get_player_velocity and add_player_velocity () 2020-10-04 00:33:45 +01:00
karamel59
d052593c7a Lua API: Register missing get_texture_mod function () 2020-08-27 21:47:38 +02:00
ANAND
291a6b70d6 Allow binding dig, place actions to keys; remove LMB/RMB hardcoding
Co-authored-by: Sam Caulfield <sam@samcaulfield.com>
2020-08-15 12:19:20 +03:00
Lars Müller
e7e065f553 Exposing the zoom key to Lua API ()
Co-authored-by: Raul Ferriz <raul.ferriz@gmail.com>
2020-06-13 22:46:20 +02:00
Loïc Blot
454dbf83a9 Server class code cleanups ()
* Server::overrideDayNightRatio doesn't require to return bool
There is no sense to sending null player, the caller should send a valid object

* Server::init: make private & cleanup
This function is always called before start() and loads some variables which can be loaded in constructor directly.
Make it private and call it directly in start

* Split Server inventory responsibility to a dedicated object

This splits permit to found various historical issues:
* duplicate lookups on player connection
* sending inventory to non related player when a player connects
* non friendly lookups on detached inventories ownership

This reduce the detached inventory complexity and also increased the
lookup performance in a quite interesting way for servers with thousands
of inventories.
2020-05-07 22:38:41 +02:00
SmallJoker
cad5b987ad Sky API: Rename *_tint to fog_*_tint for consistency 2020-05-05 08:37:04 +02:00
ANAND
e0ea87f1f3 set_fov: Add support for time-based transitions () 2020-05-02 12:52:11 +02:00
Loïc Blot
91c4f7f0ea Forbid object:attach(obj, ...) ()
Fixes 
2020-04-27 11:27:27 +02:00
sfan5
87829cd744 script: Move SAO usability check so that it covers all functions ()
see also 91eef646a59575bd9ae792e257bb6ad12fafc0b1
2020-04-18 17:21:58 +02:00
sfan5
2d5bd3bf79 scriptapi: Some small optimizations to value pushing () 2020-04-14 20:44:18 +02:00
Loic Blot
5146086a64 Drop content_sao.{cpp,h}
Move LuaEntitySAO to a new dedicated file
Drop TestSAO (useless object)
Drop the old static startup initialized SAO factory, which was pretty useless.
This factory was using a std::map for 2 elements, now just use a simple condition owned by ServerEnvironment, which will be lightweight, that will also drop a one time useful test on each LuaEntitySAO creation. This should reduce server load on massive SAO creation
2020-04-11 16:07:17 +02:00
Loic Blot
894a34aef4 Move PlayerSAO to dedicated files 2020-04-11 16:07:17 +02:00
Loic Blot
6d43736172 Move serveractiveobject & unitsao
Move serverobject.{cpp,h} to server/serveractiveobject.{cpp,h}
Move UnitSAO class to dedicated files
2020-04-11 16:07:17 +02:00