-
Notifications
You must be signed in to change notification settings - Fork 37
WorldEntitiesSystem
PassiveSystem
that manages the Entities on the world
-
registerEntity(int id)
the system calls theMapSystem
to update the Entities into the map -
registerEntity(int connectionId, int id)
the system calls theServerSystem
to register the user connection, and then callsregisterEntity(int id)
-
unregisterEntity(int entityId)
the system calls theUserSystem
sending the entityId and a Runnable implementation that calls theServerSystem
andmapSystem
to remove the requested Entity. Also the same is removed from theWorld
-
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 theentityId
and each entity obtained on the set (nearPlayer), is process by the member methodsendEntityUpdate(nearPlayer, update)
-
notifyUpdate(int entityId, Object update)
the system calls the member methodssendEntityUpdate(entityId, update)
andnotifyToNearEntities(entityId, update)
-
entityDie(int entityId)
the system obtains the Entity by theentityId
. 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 theworld
-
login(int connectionId, int entity)
the system gets all the components (ComponentSystem.Visibility.CLIENT_ALL
) of the requested Entity and adds theFocused
,AOPhysics
andCanWrite
components to it.
- IntelliJ
- Windows JDK
- Linux JDK
- Run client and server localhost
- Host a public server
- Import project to IntelliJ