Пример #1
0
        private void SendNetworkSubtraction(Entity entity)
        {
            var packet = new EntityRemovePacket(entity.ID);

            // Get all interested clients
            var characters = MapSimulator.EntityCollection.Filter<CharacterComponent>();

            // Send to all interested parties
            foreach (var character in characters.Entities)
            {
                var characterComponent = character.GetComponent<CharacterComponent>();
                ClientNetworkManager.Instance.SendPacket(packet, characterComponent.Connection);
            }
        }
Пример #2
0
 private void EntityRemoved(EntityRemovePacket entityRemovePacket)
 {
     ServiceManager.RemoveEntityByID(entityRemovePacket.EntityID);
 }
Пример #3
0
 public static new Packet FromNetBuffer(NetIncomingMessage incomingMessage)
 {
     var entityID = incomingMessage.ReadUInt64();
         var packet = new EntityRemovePacket(entityID);
         return packet;
 }