| Commit message (Collapse) | Author | Age |
|
|
|
|
| |
- 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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).
|
| |
|
|
|
|
| |
Send texture modifier to clients connecting later too
|
| |
|
|
|
|
| |
Signed-off-by: Loic Blot <loic.blot@unix-experience.fr>
|
|
|
|
| |
Signed-off-by: Loic Blot <loic.blot@unix-experience.fr>
|
|
|
|
|
|
|
|
|
|
| |
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 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
|
|
|
|
|
|
|
| |
settings. (#4811)
Optimize/adjust blocks and active blocks sent at the server based on client settings.
|
| |
|
|
|
|
|
| |
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...
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
| |
Also remove some unused parameters/functions
|
|
|
|
| |
or change the nametag text of players
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
|
|
|
| |
* This permit to cleanup the player checking loop
|
|
|
|
|
|
| |
* 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
|
| |
|
| |
|
|
|
|
| |
and testing the state change.
|
|
|
|
| |
ActiveObjectType. * Merge content_object.h into activeobject.h * Remove DummyLoadSAO, it's now unused. * Remove ItemSAO, it's also unused
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
#define max
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Lua API.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|