Skip to main content

INetworkSerialized

An interface in Root.Township, Alta.Networking.

Implement on a component of a NetworkEntity to have its state sent by the entity's serializer on each sync. The owning side writes, others read.

Properties​

MemberWhat it is
int MaximumBits { get; }Most bits Serialize can write. Too small and the serializer logs an error for the entity.
AccumulativeAverageCount PrepareForWriteTimer { get; }Counts PrepareForWrite calls, for profiling.
AccumulativeAverageCount SerializeTimer { get; }Counts Serialize calls, for profiling.

Methods​

MemberWhat it is
bool PrepareForWrite(bool isWriteFull)Called on the authoritative side before writing. Return true if anything changed and the state needs sending.
void Serialize(Stream stream, bool isWriteFull)Reads or writes the component's state. isWriteFull means a full state rather than a change.

Used in​

Members of other types that take, return or hold a INetworkSerialized: