Class NamingReplyBatches<TConnection>
- Namespace
- FishMMO.Server.Core.World.SceneServer
- Assembly
- FishMMO.Server.dll
Batched name answers grouped by the connection they go to, then split into replies of at most a given size. Reusable; main thread only.
public sealed class NamingReplyBatches<TConnection>
Type Parameters
TConnectionThe connection type.
- Inheritance
-
NamingReplyBatches<TConnection>
- Inherited Members
Remarks
One lookup can finish for many connections at once, and one connection can be waiting on
many of its IDs. Each connection is sent one reply per maxEntries answers, not one
message per ID.
Properties
ConnectionCount
Connections with at least one answer queued.
public int ConnectionCount { get; }
Property Value
Methods
Add(TConnection, long, string)
Queues one answer for a connection.
public void Add(TConnection connection, long id, string name)
Parameters
connectionTConnectionWho receives it.
idlongThe ID answered.
namestringIts name, or empty for "no such entity".
Clear()
Drops every queued answer.
public void Clear()
Drain(int, Action<TConnection, long[], string[]>)
Hands every queued answer to send, at most maxEntries
per call, connection by connection in the order they were first added; then empties.
public void Drain(int maxEntries, Action<TConnection, long[], string[]> send)