summaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_object.cpp
Commit message (Collapse)AuthorAge
* Server class code cleanups (#9769)Loïc Blot2020-05-07
| | | | | | | | | | | | | | | | | | | * 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.
* Sky API: Rename *_tint to fog_*_tint for consistencySmallJoker2020-05-05
|
* set_fov: Add support for time-based transitions (#9705)ANAND2020-05-02
|
* Forbid object:attach(obj, ...) (#9762)Loïc Blot2020-04-27
| | | Fixes #9761
* script: Move SAO usability check so that it covers all functions (#9698)sfan52020-04-18
| | | see also 91eef646a59575bd9ae792e257bb6ad12fafc0b1
* scriptapi: Some small optimizations to value pushing (#9669)sfan52020-04-14
|
* Drop content_sao.{cpp,h}Loic Blot2020-04-11
| | | | | | | 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
* Move PlayerSAO to dedicated filesLoic Blot2020-04-11
|
* Move serveractiveobject & unitsaoLoic Blot2020-04-11
| | | | | Move serverobject.{cpp,h} to server/serveractiveobject.{cpp,h} Move UnitSAO class to dedicated files
* scriptapi: Sort out ServerEnvironment / Environment distinction properlysfan52020-04-11
| | | | | | The API implementation is shared between CSM and SSM. Functions should retrieve a plain env when they do not need any server-specific functions.
* Fix star visilibity and documentation (since 946c03c6)Jordan Snelling2020-03-08
| | | | | | | Fix memory leak (unused allocation) Fix star rendering Rename sky color struct Fix stars on android Remove extraneous .data() from android star draw
* set_sky improvements, set_sun, set_moon and set_starsJordach2020-03-05
|
* Move core.get_connected_players() implementation to C++sfan52020-02-23
| | | | | Keeping the ObjectRefs around in a table isn't ideal and this allows removing the somewhat nonsensical is_player_connected() added in 86ef7147.
* Script API: Check that SAOs are still usable before attempting to use themsfan52020-02-11
|
* Punchwear (improved) (#8959)sfan52019-09-22
|
* Wieldhand: Specify which ItemStack to use (#8961)SmallJoker2019-09-21
| | | Makes 'get_wield_item' to return the "main" ItemStack
* Add support for per-player FOV overrides and multipliersAnand S2019-09-19
|
* Inventory: Send dirty lists where appropriate (#8742)SmallJoker2019-08-24
| | | | | This change reduces the amount of sent data towards clients. Inventory lists that are already known to the player are skipped, saving quite some data over time. Raises protocol version to 38 to ensure correct backwards-compatible code.
* Implement adding velocity to player from Luasfan52019-08-10
| | | | The intended usecase is knockback, but there's potential for more.
* Unify wield item handling (#8677)SmallJoker2019-08-07
| | | | This moves the wield item functions to Player and the tool utils for range calculation Also 'local_inventory' was removed due to redundancy in Client
* Move the clamping of hp/breath when their maximums change to ↵Beha2019-07-30
| | | | | read_object_properties(). (#8689) This prevents set_properties() calls that have nothing to do with hp_max or breath_max overriding the saved hp before another mod has the chance to set a player's intended hp_max (such as in on_joinplayer).
* Fix forgotten PlayerSAO cast in a90f2efSmallJoker2019-05-21
|
* Check for out-of-bounds breath when setting breath_max (#8493)ANAND ツ2019-05-21
|
* Force send a mapblock to a player (#8140)sofar2019-04-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Force send a mapblock to a player. Send a single mapblock to a specific remote player. This is badly needed for mods and games where players are teleported into terrain which may be not generated, loaded, or modified significantly since the last player visit. In all these cases, the player currently ends up in void, air, or inside blocks which not only looks bad, but has the effect that the player might end up falling and then the server needs to correct for the player position again later, which is a hack. The best solution is to send at least the single mapblock that the player will be teleported to. I've tested this with ITB which does this all the time, and I can see it functioning as expected (it even shows a half loaded entry hallway, as the further blocks aren't loaded yet). The parameter is a blockpos (table of x, y, z), not a regular pos. The function may return false if the call failed. This is most likely due to the target position not being generated or emerged yet, or another internal failure, such as the player not being initialized. * Always send mapblock on teleport or respawn. This avoids the need for mods to send a mapblock on teleport or respawn, since any call to `player:set_pos()` will pass this code.
* Add node field to PlayerHPChangeReason table (#8368)Paul Ouellette2019-04-11
|
* Add deprecation warnings for ObjectRef:get/set_attribute (#8443)ANAND2019-04-07
|
* HPChange Reason: Fix push after free, and type being overwritten (#8359)rubenwardy2019-03-12
| | | | | | * HPChange Reason: Fix push after free, and type being overwritten Fixes #8227 and #8344
* Consistent HP and damage types (#8167)SmallJoker2019-02-10
| | | | | Remove deprecated HUDs and chat message handling. Remove unused m_damage variable (compat break). HP: s32 for setter/calculations, u16 for getter.
* Fix various bugs (Anticheat, Lua helpers) (#8013)SmallJoker2019-01-06
| | | | | | | | | | | * Fix various bugs (Anticheat, Lua helpers) Anticheat: Use camera position instead of player position for shoot line calculations Lua helpers: Increase 'i' to not overwrite earlier added table values * Remove lag compensation * * 1.5 for larger selection boxes
* Add Lua methods 'set_rotation()' and 'get_rotation()' (#7395)CoderForTheBetter2018-11-28
| | | | * 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).
* Lua templating reading (part 4): s16, v2s16, v2f (#7512)Loïc Blot2018-07-08
|
* Log deprecated Lua function calls (#7491)SmallJoker2018-07-01
|
* Modernize lua read (part 2 & 3): C++ templating assurance (#7410)Loïc Blot2018-06-30
| | | | | | | | | * Modernize lua read (part 2 & 3): C++ templating assurance Implement the boolean reader Implement the string reader Also remove unused & unimplemented script_error_handler Add a reader with default value
* Modernize lua read (part 1): C++ templating insurance (#7394)Loïc Blot2018-06-04
| | | | | | | * Modernize lua read (part 1): C++ templating assurance Implement the float reader
* Fix isNan on setYaw Lua call (#7380)Loïc Blot2018-05-31
| | | | * Fix isNan on setYaw Lua call
* Allow damage for attached objects, add attach/detach callbacks (#6786)SmallJoker2018-04-30
| | | * Allow right-clicking on attached LuaEntities
* Add player:get_meta(), deprecate player attributes (#7202)rubenwardy2018-04-06
| | | | * Add player:get_meta(), deprecate player attributes
* Fix many issues reported by clang-tidy (#7189)Loïc Blot2018-04-02
| | | | | | | | | | | * Fix many issues reported by clang-tidy We have many issues in code related to some performance to float <-> double. Clang-tidy reported it in performance-type-promotion-in-math-fn I fixed many of them. It's not ready for a promote to blocking Also fix some value which should be const-ref
* ObjectRef: Add add_velocity() (#3208)you2018-03-31
| | | | Allow changing the velocity of objects relatively to their current velocity
* Add reasons to on_dieplayer and on_hpchangeAndrew Ward2018-03-28
|
* Add formspec theming using prepended stringsAndrew Ward2018-03-28
|
* Cleanup & bugfixLoic Blot2018-03-08
| | | | | | | | * ObjectRef::set_local_animation: fix wrong lua return (should push a boolean, currently returns nil) * ObjectRef::set_eye_offset: fix wrong lua return (should push a boolean, currently returns nil) * Fix various Server functions which depends on RemotePlayer objet and return true/false when player object is nil whereas it's a caller implementation error. Change those bool functions to void and add sanitize_check call instead. Current callers are always checking player object validity * Optimize Server::setClouds : use CloudParams object ref instead of attribute deserialization from structure & perform RemotePlayer::setCloudParams directly in server class like many other calls * Optimize Server::SendCloudParams: use CloudParams object ref instead of deserialized attributes
* Cleanup: drop Server::hudGetHotbarSelectedImage()Loic Blot2018-03-08
| | | | Call directly accessible RemotePlayer::getHotbarSelectedImage() from server api
* Cleanup: drop Server::hudGetHotbarImage()Loic Blot2018-03-08
| | | | Call directly accessible RemotePlayer::getHotbarImage() from server api & make it const ref
* Cleanup: drop Server::hudGetHotbarItemcount()Loic Blot2018-03-08
| | | | Call directly accessible RemotePlayer::getHotbarItemcount() from server api
* [CSM] Add basic HUD manipulation. (#6067)red-0012018-01-20
| | | | | | * [CSM] Add basic HUD manipulation. Workaround for on_connect not working right now.
* Make Player::peer_id server-side only and add getters and setters (#6478)Loïc Blot2017-09-30
| | | | | | | * Make Player::peer_id server-side only and add getters and setters Player::peer_id has no sense client side, move it to server, make it private and add setter and getter Also add some PEER_ID_INEXISTENT instead of harcoded 0
* ServerEnv: Clean up object lifecycle handling (#6414)sfan52017-09-15
| | | | * ServerEnv: Clean up object lifecycle handling
* Fix animation frame_speed and blend loosing precision due to incorrec… (#6357)sapier2017-09-01
| | | | | * Fix animation frame_speed and blend loosing precision due to incorrect data type Add lua function set_animation_frame_speed to update the frame speed without resetting the animation to start
* Respect object property hp_max field for players (#6287)SmallJoker2017-08-23
| | | | | | | | | | | * Respect object property hp_max field for players This allows modders to configure the maximal HP per player * Statbars: Downscale bar to full 20 HP when exceeding this value Add default max HP for players and breath constants to builtin Document the constants * Rename PLAYER_MAX_HP -> PLAYER_MAX_HP_DEFAULT