ThrottledMethodSync
A class in Root.Township, Alta.Networking.
Wraps an entity message so it is sent at most once per set interval; extra sends inside the interval are dropped, not delayed.
- Listed in Networking and servers
Constructors
| Member | What it is |
|---|---|
ThrottledMethodSync(NetworkEntity entity, EntityMessageType type, SerializeMethod handler, float throttleFrequencyInSeconds) | Creates a ThrottledMethodSync from entity, type, handler and throttleFrequencyInSeconds. |
Fields
5 private and internal fields
| Member | What it is |
|---|---|
private readonly NetworkEntity entity | The entity the message belongs to. |
private readonly SerializeMethod handler | Method that writes and reads the message; registered as the entity's handler for type. |
private float nextAvailableMessage | Real time after which the next send is allowed. |
private readonly float throttleFrequencyInSeconds | Minimum seconds between sends. |
private readonly EntityMessageType type | The entity message type. |
Methods
| Member | What it is |
|---|---|
void SendToChunks(params Player[] except) | Sends the message to players in the entity's chunks (minus except), unless throttled. |
void SendToPlayer(Player player) | Sends the message to one player, unless throttled. |
1 private and internal method
Used in
Members of other types that take, return or hold a ThrottledMethodSync: