Skip to main content

DestroyMessage

A static class in Root.Township, Alta.Networking.

The network message that tells clients to destroy or unload an entity. Static fields hold one message's data between Set and Serialize.

Fields​

4 private and internal fields
MemberWhat it is
private static uint entitySpawnIndexDespawn spawn index; clients ignore the message for an entity spawned later than this.
private static bool isAllowingWaitWhether the message may wait. Sent, but not used when reading.
private static bool isUnloadTrue to unload the entity (out of range) rather than destroy it.
private static Logger loggerNLog logger for this class.

Methods​

MemberWhat it is
static void Serialize(Connection connection, Stream stream)Writes or reads the message. Client: destroys or unloads the entity (waiting for it to spawn if needed), unless it was respawned after this despawn.
static void Set(NetworkEntity entity, bool isUnload, bool isAllowingWait)Server: fills the message for an entity, with its despawn spawn index.