Function veloren_server::events::player::persist_entity

source ยท
pub(super) fn persist_entity(state: &mut State, entity: Entity) -> Entity
Expand description

When a player logs out, their data is queued for persistence in the next tick of the persistence batch update unless the character logging out is dead and has hardcore enabled, in which case the character is deleted instead of being persisted. The player will be temporarily unable to log in during this period to avoid the race condition of their login fetching their old data and overwriting the data saved here.

This function is also used by the Transform event and MUST NOT assume that the persisting entity is deleted afterwards. It is however safe to assume that this function will not be called twice on an entity with the same character id.