NpcInfoProtocol

class NpcInfoProtocol(allocator: ByteBufAllocator, resolutionChangeEncoders: ClientTypeMap<NpcResolutionChangeEncoder>, avatarFactory: NpcAvatarFactory, exceptionHandler: NpcAvatarExceptionHandler, worker: ProtocolWorker = DefaultProtocolWorker(), zoneIndexStorage: ZoneIndexStorage)

NPC info protocol is the root class bringing everything together about NPC info.

Parameters

avatarFactory

the factory responsible for allocating new npc avatars.

Constructors

Link copied to clipboard
constructor(allocator: ByteBufAllocator, resolutionChangeEncoders: ClientTypeMap<NpcResolutionChangeEncoder>, avatarFactory: NpcAvatarFactory, exceptionHandler: NpcAvatarExceptionHandler, worker: ProtocolWorker = DefaultProtocolWorker(), zoneIndexStorage: ZoneIndexStorage)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun alloc(idx: Int, oldSchoolClientType: OldSchoolClientType): NpcInfo

Allocates a new npc info object, or re-uses an older one if possible.

Link copied to clipboard
fun dealloc(info: NpcInfo)

Deallocates the provided npc info object, allowing it to be used up by another player in the future.

Link copied to clipboard
operator fun get(idx: Int): NpcInfo

Gets the npc info at the provided index.

Link copied to clipboard
fun getOrNull(idx: Int): NpcInfo?

Gets the npc info at the provided index, or null if it doesn't exist.

Link copied to clipboard
fun update()

Updates the npc info protocol for this cycle. The jobs here will be executed according to the worker specified, allowing multithreaded execution if selected.