Skip to content

WorldEntitiesSystem

jmpala edited this page Aug 20, 2020 · 2 revisions

PassiveSystem that manages the Entities on the world

  • registerEntity(int id) the system calls the MapSystem to update the Entities into the map

  • registerEntity(int connectionId, int id) the system calls the ServerSystem to register the user connection, and then calls registerEntity(int id)

  • unregisterEntity(int entityId) the system calls the UserSystem sending the entityId and a Runnable implementation that calls the ServerSystem and mapSystem to remove the requested Entity. Also the same is removed from the World

  • sendEntityUpdate(int user, Object update) the system verifies that the user is still connected to the server, if True, the object is sent to the client

  • notifyToNearEntities(int entityId, Object update) the system get the near entities related to the entityId and each entity obtained on the set (nearPlayer), is process by the member method sendEntityUpdate(nearPlayer, update)

  • notifyUpdate(int entityId, Object update) the system calls the member methods sendEntityUpdate(entityId, update) and notifyToNearEntities(entityId, update)

  • entityDie(int entityId) the system obtains the Entity by the entityId. Then the system evaluates if the Entity is an NPC. If True, the NPC is deleted and the respawn timer is set. If the Entity is a player, random item is dropped and the player then is converted into a ghost

  • resurrectRequest(int entityId) the system tries to revive the Entity

  • resurrect(int entityId, boolean resurrected) the system obtains the requested Entity and resets its health, head and body. Then the system evaluate if it needs to resuscitate the Entity on its current position or on the city (resurrected = False -> current position)

  • dropItem(Integer key, Integer value, WorldPos worldPos) the system creates an item to be drop on the world

  • login(int connectionId, int entity) the system gets all the components (ComponentSystem.Visibility.CLIENT_ALL) of the requested Entity and adds the Focused, AOPhysics and CanWrite components to it.

<< Back to Server Systems

Get Starting

Requirements

Source Code

Reference

run

Graphics

balance

external documentation

Clone this wiki locally