PlayerAvatarExtendedInfo

class PlayerAvatarExtendedInfo(localIndex: Int, filter: ExtendedInfoFilter, extendedInfoWriters: List<PlayerAvatarExtendedInfoWriter>, allocator: ByteBufAllocator, huffmanCodec: HuffmanCodecProvider)

This data structure keeps track of all the extended info blocks for a given player avatar.

Parameters

localIndex

the index of the avatar who owns this extended info block.

filter

the filter responsible for ensuring the total packet size constraint is not broken in any way. If this filter does not conform to the contract correctly, crashes are likely to happen during encoding.

extendedInfoWriters

the list of client-specific writers & encoders of all extended info blocks. During caching procedure, all registered client buffers will be built concurrently among players.

allocator

the byte buffer allocator used to allocate buffers during the caching procedure. Any extended info block which is built on-demand is written directly into the main buffer.

huffmanCodec

the Huffman codec is used to compress public chat extended info blocks.

Constructors

Link copied to clipboard
constructor(localIndex: Int, filter: ExtendedInfoFilter, extendedInfoWriters: List<PlayerAvatarExtendedInfoWriter>, allocator: ByteBufAllocator, huffmanCodec: HuffmanCodecProvider)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun addHeadBar(sourceIndex: Int, selfType: Int, otherType: Int = selfType, startFill: Int, endFill: Int = startFill, startTime: Int = 0, endTime: Int = 0)

Adds a headbar onto the avatar. If a headbar by the same id already exists, updates the status of the old one. Up to four distinct headbars can be rendered simultaneously.

Link copied to clipboard
fun addHitMark(sourceIndex: Int, selfType: Int, otherType: Int = selfType, value: Int, delay: Int = 0)

Adds a simple hitmark on this avatar.

Link copied to clipboard
fun addSoakedHitMark(sourceIndex: Int, selfType: Int, otherType: Int = selfType, value: Int, selfSoakType: Int, otherSoakType: Int = selfSoakType, soakValue: Int, delay: Int = 0)

Adds a simple hitmark on this avatar.

Link copied to clipboard

Clears any obj type customisations applied to wearpos.

Link copied to clipboard

Forces a model refresh client-side even if the worn objects + base colour + gender have not changed. This is particularly important to enable when setting or clearing any obj type customisations, as those are not considered when calculating the hash code.

Link copied to clipboard
fun nameExtras(beforeName: String, afterName: String, afterCombatLevel: String)

Sets the name extras of this avatar, rendered when right-clicking users.

Link copied to clipboard
fun objRecol1(wearpos: Int, index: Int, value: Int)

Recolours part of an obj in the first slot (out of two).

Link copied to clipboard
fun objRecol2(wearpos: Int, index: Int, value: Int)

Recolours part of an obj in the second slot (out of two).

Link copied to clipboard
fun objRetex1(wearpos: Int, index: Int, value: Int)

Retextures part of an obj in the first slot (out of two).

Link copied to clipboard
fun objRetex2(wearpos: Int, index: Int, value: Int)

Retextures part of an obj in the second slot (out of two).

Link copied to clipboard

Removes a headbar on this avatar by the id of id, if one renders.

Link copied to clipboard
fun removeHitMark(delay: Int = 0)

Removes the oldest currently showing hitmark on this avatar, if one exists.

Link copied to clipboard

Clears any obj type customisations applied to wearpos.

Link copied to clipboard
fun setBaseAnimationSet(readyAnim: Int, turnAnim: Int, walkAnim: Int, walkAnimBack: Int, walkAnimLeft: Int, walkAnimRight: Int, runAnim: Int)

Sets the base animations of this avatar.

Link copied to clipboard
fun setBodyType(type: Int)

Sets the body type of the character.

Link copied to clipboard
fun setChat(colour: Int, effects: Int, modicon: Int, autotyper: Boolean, text: String, pattern: ByteArray?)

Sets the public chat of this avatar.

Link copied to clipboard
fun setColour(slot: Int, value: Int)

Sets the colour of this avatar's appearance.

Link copied to clipboard
fun setCombatLevel(combatLevel: Int)

Sets the combat level of the avatar.

Link copied to clipboard
fun setExactMove(deltaX1: Int, deltaZ1: Int, delay1: Int, deltaX2: Int, deltaZ2: Int, delay2: Int, angle: Int)

Sets an exact movement for this avatar. It should be noted that this is done in conjunction with actual movement, as the exact move extended info block is only responsible for visualizing precise movement, and will synchronize to the real coordinate once the exact movement has finished.

Link copied to clipboard
fun setFaceAngle(angle: Int)

Sets the angle for this avatar to face.

Link copied to clipboard

Sets the face-locking onto the avatar with index index. If the target avatar is a player, add 0x10000 to the real index value (0-2048). If the target avatar is a NPC, set the index as it is. In order to stop facing an entity, set the index value to -1.

Link copied to clipboard

Forces a model refresh client-side even if the worn objects + base colour + gender have not changed. This is particularly important to enable when setting or clearing any obj type customisations, as those are not considered when calculating the hash code.

Link copied to clipboard
fun setHidden(hidden: Boolean)

Sets this avatar hidden (or un-hidden) client-sided. If the observer is a J-Mod or above, the character will render regardless. It is worth noting that plugin clients such as RuneLite will render information about these avatars regardless of their hidden status.

Link copied to clipboard
fun setIdentKit(identKitSlot: Int, value: Int)

Sets an ident kit. Note that this function does not rely on wearpos values, as those range from 0 to 11. Ident kit values only range from 0 to 6, which would result in some wasted memory. A list of wearpos to ident kit can also be found in net.rsprot.protocol.common.game.outgoing.info.playerinfo.extendedinfo.Appearance.identKitSlotList

Link copied to clipboard
fun setMale(isMale: Boolean)

Sets the character male or female.

Link copied to clipboard
fun setMoveSpeed(value: Int)

Sets the movement speed for this avatar. This move speed will be used whenever the player moves, unless a temporary move speed is utilized, which will take priority. The known values are:

Link copied to clipboard
fun setName(name: String)

Sets the name of the avatar.

Link copied to clipboard
fun setNameExtras(beforeName: String, afterName: String, afterCombatLevel: String)

Sets the name extras of this avatar, rendered when right-clicking users.

Link copied to clipboard
fun setObjHeadModels(wearpos: Int, manHead: Int, womanHead: Int)

Sets the head models of an obj at wearpos wearpos.

Link copied to clipboard
fun setObjRecol1(wearpos: Int, index: Int, value: Int)

Recolours part of an obj in the first slot (out of two).

Link copied to clipboard
fun setObjRecol2(wearpos: Int, index: Int, value: Int)

Recolours part of an obj in the second slot (out of two).

Link copied to clipboard
fun setObjRetex1(wearpos: Int, index: Int, value: Int)

Retextures part of an obj in the first slot (out of two).

Link copied to clipboard
fun setObjRetex2(wearpos: Int, index: Int, value: Int)

Retextures part of an obj in the second slot (out of two).

Link copied to clipboard
fun setObjWearModels(wearpos: Int, manWear: Int, womanWear: Int)

Sets the worn models of an obj at wearpos wearpos.

Link copied to clipboard
fun setOverheadIcon(icon: Int)

Sets the overhead icon over this avatar (e.g. prayer icons)

Link copied to clipboard
fun setPronoun(num: Int)

Sets the pronoun of this avatar.

Link copied to clipboard
fun setSay(text: String)

Sets the overhead chat of this avatar. If the text starts with the character ~, the message will additionally also be rendered in the chatbox of everyone nearby, although no chat icons will appear alongside. The first ~ character itself will not be rendered in that scenario.

Link copied to clipboard
fun setSequence(id: Int, delay: Int)

Sets the sequence for this avatar to play.

Link copied to clipboard
fun setSkillLevel(skillLevel: Int)

Sets the skill level of the avatar, seen when right-clicking players as "skill: value", instead of the usual combat level. Set to 0 to render combat level instead.

Link copied to clipboard
fun setSkullIcon(icon: Int)

Sets the skull icon over this avatar.

Link copied to clipboard
fun setSpecificTinting(startTime: Int, endTime: Int, hue: Int, saturation: Int, lightness: Int, weight: Int, visibleTo: PlayerInfo)

Applies a tint over the non-textured parts of the character.

Link copied to clipboard
fun setSpotAnim(slot: Int, id: Int, delay: Int, height: Int)

Sets the spotanim in slot slot, overriding any previous spotanim in that slot in doing so.

Link copied to clipboard
fun setTempMoveSpeed(value: Int)

Sets the temporary movement speed for this avatar - this move speed will only apply for a single game cycle. The known values are:

Link copied to clipboard
fun setTextGender(num: Int)

Sets the pronoun of this avatar.

Link copied to clipboard
fun setTinting(startTime: Int, endTime: Int, hue: Int, saturation: Int, lightness: Int, weight: Int)

Applies a tint over the non-textured parts of the character.

Link copied to clipboard

Transforms this avatar to the respective NPC, or back to player if the id is -1.

Link copied to clipboard
fun setWornObj(wearpos: Int, id: Int, wearpos2: Int, wearpos3: Int)

Sets a worn object in the given wearpos.

Link copied to clipboard
fun specificTinting(startTime: Int, endTime: Int, hue: Int, saturation: Int, lightness: Int, weight: Int, visibleTo: PlayerInfo)

Applies a tint over the non-textured parts of the character.

Link copied to clipboard
fun syncAngle(angle: Int)

Silently synchronizes the angle of the avatar, meaning any new observers will see them at this specific angle.

Link copied to clipboard
fun tinting(startTime: Int, endTime: Int, hue: Int, saturation: Int, lightness: Int, weight: Int)

Applies a tint over the non-textured parts of the character.

Link copied to clipboard

Transforms this avatar to the respective NPC, or back to player if the id is -1.