buildCache

open override fun <T : ZoneProt> buildCache(allocator: ByteBufAllocator, messages: List<T>): ByteBuf

Builds a cache of a given zone's list of zone prots. This is intended so the server only requests one cache per zone per game cycle, rather than re-building the same buffer N times, where N is the number of players observing the zone. With this in mind however, zone prots which are player-specific, such as OBJ_ADD cannot be grouped together and must be sent separately, as they also are in OldSchool RuneScape.

Parameters

allocator

the byte buffer allocator used for the cached buffer. Note that it is the server's responsibility to release the buffer once the cycle has ended. The individual writes of UpdateZonePartialEnclosed do not modify the reference count in any way.

messages

the list of zone prot messages to be encoded.