summaryrefslogtreecommitdiff
path: root/src/content_sao.h
Commit message (Collapse)AuthorAge
* Fix problems when overriding the hand:Ekdohibs2017-04-06
| | | | | - If the hand can dig a node the item wielded can't, allow to dig it anyway. - Fix the API callbacks from setting the hand instead of the wielded item.
* Fix anticheat resetting client position after the client is teleportedEkdohibs2017-02-01
| | | | | | | | | | | | | | | Previously, m_move_pool could accomodate the client moving from the new position to the old one, and the server accepted the client to go back to its old position. However, it couldn't then accomodate the client moving from its old to its new position, and therefore would reset position to the old position. Thus, by emptying m_move_pool after a teleport, the server no longer accepts the client to go back to its old position. A drawback is however that a laggy client *will* trigger a few "moved_too_fast" anticheats before being told about its new position. Don't report player cheated if caused by lag. Fixes #5118
* Implement player attribute backend (#4155)Loïc Blot2017-01-27
| | | | | | | | | | | | | | | * This backend permit mods to store extra players attributes to a common interface. * Add the obj:set_attribute(attr, value) Lua call * Add the obj:get_attribute(attr) Lua call Examples: * player:set_attribute("home:home", "10,25,-78") * player:get_attribute("default:mana") Attributes are saved as a json in the player file in extended_attributes key They are saved only if a modification on the attributes occurs and loaded when emergePlayer is called (they are attached to PlayerSAO).
* Revert "Detach the player from entities on death." (#5087)Loïc Blot2017-01-21
|
* Add Entity get_texture_mod() to Lua APIsapier2017-01-21
| | | | Send texture modifier to clients connecting later too
* Detach the player from entities on death. (#5077)red-0012017-01-21
|
* Optimize SAO getStaticData by using std::string pointer instead of return copyLoic Blot2017-01-13
| | | | Signed-off-by: Loic Blot <loic.blot@unix-experience.fr>
* Cleanup content_sao by factorizing similar code partsRogier2017-01-13
| | | | Signed-off-by: Loic Blot <loic.blot@unix-experience.fr>
* Performance fix + SAO factorizationRogier2017-01-11
| | | | | | | | | | Original credits goes to @Rogier-5 * Merge common attributes between LuaEntitySAO & PlayerSAO to UnitSAO * Make some functions const * Improve some lists performance by returning const ref Signed-off-by: Loic Blot <loic.blot@unix-experience.fr>
* Breath cheat fix: server sideLoic Blot2017-01-01
| | | | | | | | | Breath is now handled server side. Changing this behaviour required some modifications to core: * Ignore TOSERVER_BREATH package, marking it as obsolete * Clients doesn't send the breath to server anymore * Use PlayerSAO pointer instead of peer_id in Server::SendPlayerBreath to prevent a useless lookup (little perf gain) * drop a useless static_cast in emergePlayer
* Optimize/adjust blocks/ActiveObjects sent at the server based on client ↵lhofhansl2016-11-30
| | | | | | | settings. (#4811) Optimize/adjust blocks and active blocks sent at the server based on client settings.
* Wieldhand: Allow overriding the handTeTpaAka2016-11-26
|
* PlayerSAO saving fix (#4734)Ner'zhul2016-11-05
| | | | | PlayerSAO::disconnected() function was historical and remove the link between SAO and RemotePlayer session. With previous attributes linked to RemotePlayer saving was working. But now attributes are read from SAO not RemotePlayer and the current serialize function verify SAO exists to save the player attributes. Because PlayerSAO::disconnected marks playersao for removal, only mark playerSAO for removal and let PlayerSAO::removingFromEnvironment do the correct saving behaviour and all the disconnection process instead of doing a partial removal and let the server loop doing the RemotePlayer cleanup and remove some saved attributes...
* Fix overloading problems mentioned by clangLoic Blot2016-10-30
|
* PlayerSAO/LocalPlayer refactor: (#4612)Ner'zhul2016-10-30
| | | | | | | | | | | | | | | | | * Create UnitSAO, a common part between PlayerSAO & LuaEntitySAO * Move breath to PlayerSAO & LocalPlayer * Migrate m_yaw from (Remote)Player & LuaEntitySAO to UnitSAO * Migrate m_yaw from Player to LocalPlayer for client * Move some functions outside of player class to PlayerSAO/RemotePlayer or LocalPlayer depending on which class needs it * Move pitch to LocalPlayer & PlayerSAO * Move m_position from Player to LocalPlayer * Move camera_barely_in_ceiling to LocalPlayer as it's used only there * use PlayerSAO::m_base_position for Server side positions * remove a unused variable * ServerActiveObject::setPos now uses const ref * use ServerEnv::loadPlayer unconditionnaly as it creates RemotePlayer only if it's not already loaded * Move hp from Player to LocalPlayer * Move m_hp from LuaEntitySAO to UnitSAO * Use m_hp from PlayerSAO/UnitSAO instead of RemotePlayer
* Move RemotePlayer code to its own cpp/headerLoic Blot2016-10-08
|
* Prevent attached models from disappearing during parent reload (#4128)Foghrye42016-10-08
|
* Player/LocalPlayer/RemotePlayer inheritance cleanup (part 1 on X)Loic Blot2016-10-08
| | | | | | | | | | | * LocalPlayer take ownership of maxHudId as it's the only caller * RemotePlayer take ownership of day night ratio as it's the only user * Pass getPlayerControl as const reference to prevent object copy on each call (perf improvement in ObjectRef::l_get_player_control call) * getPlayerSAO is now only RemotePlayer call * get/setHotbarItemCount is now RemotePlayer owned * Server: Use RemotePlayer instead of Player object on concerned call to properly fix the object type * PlayerSAO now uses RemotePlayer instead of Player because it's only server side * ObjectRef::getplayer also returns RemotePlayer as it's linked with PlayerSAO
* use unordered containers where possible (patch 4 on X)Loic Blot2016-10-06
| | | | Also remove some unused parameters/functions
* Add option to give every object a nametagBlockMen2015-12-15
| | | | or change the nametag text of players
* Fix invisible player when the attached entity is removedTeTpaAka2015-07-18
|
* Fix some issues with animations, and allow non-looped animations to be definedMirceaKitsune2015-06-22
|
* Add some missing getter functions to the lua APITeTpaAka2015-05-28
| | | | | | | | | | | | | | | | | | | | | | | ObjectRef: get_properties get_armor_groups get_animation get_attach get_bone_position Players: get_physics_override hud_get_hotbar_itemcount hud_get_hotbar_image hud_get_hotbar_selected_image get_sky get_day_night_ratio get_local_animation get_eye_offset Global: minetest.get_gen_notify minetest.get_noiseparams
* Spare some string copiesest312015-05-27
|
* Add get and set functions for the nametag colorTeTpaAka2015-05-15
|
* Send Position packet on event, don't check it at each AsyncRunStep.Loic Blot2015-03-04
| | | | * This permit to cleanup the player checking loop
* Send Inventory packet on event, don't check it at each AsyncRunStep.Loic Blot2015-03-04
| | | | | | * Call UpdateCrafting into SendInventory because this functions is only called before SendInventory * Use Player* instead of peer_id for UpdateCrafting because SendInventory already has the Player* pointer, then don't loop for searching Player* per peer_id * m_env_mutex don't need to be used with this modification because it's already locked before the calls
* Remove unused m_wielded_item_not_sentLoic Blot2015-03-03
|
* Send Breath packet on event, don't check it at each AsyncRunStepLoic Blot2015-03-03
|
* Send Player HP when setHP (or a setHP caller) is called instead of looping ↵Loic Blot2015-03-03
| | | | and testing the state change.
* SAO work: ActiveObject types & SAO cleanup * Replace u8 types with ↵Loic Blot2015-02-17
| | | | ActiveObjectType. * Merge content_object.h into activeobject.h * Remove DummyLoadSAO, it's now unused. * Remove ItemSAO, it's also unused
* Replace setting unlimited_player_transfer_distance with player_transfer_distanceSmallJoker2014-11-08
|
* Pass arguments by referenceSelat2014-03-12
|
* Add sneak and sneak_glitch to set_physics_override()PilzAdam2013-12-03
|
* Send player damage to all clients and apply [brightenPilzAdam2013-08-17
|
* Rename LagPool's member variables to avoid MSVC freaking up due to it's ↵Perttu Ahola2013-08-06
| | | | #define max
* Allow mods to listen to cheat detections using minetest.register_on_cheat()Perttu Ahola2013-08-04
|
* Fix anticheatPerttu Ahola2013-08-03
|
* Add an option to disable object <-> object collision for Lua entitiesPilzAdam2013-07-20
|
* Add set_breath and get_breath to lua API.RealBadAngel2013-07-20
|
* Allow modifying movement speed, jump height and gravity per-player via the ↵MirceaKitsune2013-04-05
| | | | Lua API.
* Closed add object <-> object collision handlingsapier2013-03-28
|
* lua methods set_look_pitch and set_look_yawRealBadAngel2013-03-17
|
* Update Copyright YearsSfan52013-02-24
|
* Change Minetest-c55 to MinetestPilzAdam2013-02-24
|
* Full protocol 13 compatibility on server sidePerttu Ahola2012-11-29
|
* A bunch of fixesMirceaKitsune2012-11-25
| | | | | | | | | | | | No longer hide players who are dead. With models, a death animation should be used instead Some changes requested by celeron55 Rename a lot of things in the code, and use better lua api function names Minor code corrections Bump protocol version up, since the models / animations / attachments code creates new client<->server messages
* Update attachments at the ending of the addToScene function for parents. And ↵MirceaKitsune2012-11-25
| | | | | | | | | | | | | | | | | | | | with this... *drum roll* Client-side attachments are at last functional and stick visibly. Fix the last segmentation fault (apparently). So far attachments seem to be fully functional, although removing the parent causes children to go to origin 0,0,0 and possibly still cause such a fault (though this should already be addressed) Fix a bug in falling code where entities get stuck Also check if the parent has been removed server-side, and detach the child if so. Fixes children going to origin 0,0,0 when their parent is removed. Unset all attachment properties when permanently detaching (on both the client and server). Also store less data we don't need Create a separate function for detaching, and also update lua api documentation When a child is detached, update its position from the server to clients. This WILL cause it to get positioned slightly differently client side, as the server attachment system only copies parent origin and knows not about mesh / bone transformation. This prevents different clients seeing the object detached in different spots which is most correct Update the position of attached players to clients. An attached player will see himself move, but this is currently VERY ugly and laggy as it is done by the server (it probably must stay this way too) Use a different approach for locally attached players. This allows for smooth positio transitions to work, as well at the player turning around freely. Still buggy however
* Send animations, bone overrides and attachments in entity initialization. ↵MirceaKitsune2012-11-25
| | | | | | | | | | | | | | | | | | | | Clients no longer have to be near an object when an animation or attachment is set to see the changes, and newly connected clients (or a client that simply renders the object for the first time) will get all of those settings. Therefore, the lua script no longer needs to run every X seconds either, just once per entity. Finish fixing the material color code. But it won't work until MineTest has dynamic lighting... another day another feature. Extra checks for the bone positioning / rotation code Many checks and consistency improvements to the client attachment code Make a separate function for checking if a client object is attached. A more in-depth change will be needed here to fix reading of invalid pointers Use a different method of fetching the parent. Fixes the mass segmentation faults when rendering an attachment (some still happen though) Major change to how attachments are handled. Fix the last segmentaton fault, which was due to the parent becoming invalid while being refreshed / removed which would bause the child to remain attached to nothing. Parents remove their children when being deleted themselves and add them back when re-added. Attachments are stored inside a 2D a vector which easily allows both a child to find their parent and a parent to find its children. Remove attachment list entry when an object is being permanently removed. Also avoid duplicate entries in this list when re-attaching the same object The "big code comments" can now go away. Client attachments almost work properly, and I know what else needs to be done
* Enable client-side attachments, add detachment codeMirceaKitsune2012-11-25
|