Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AttributeValue

Values for use in Player attribute key-value pairs.

This object lets you specify an attribute value using any of the valid data types: string, number, string array, or data map. Each AttributeValue object can use only one of the available properties.

Hierarchy

Index

Constructors

constructor

  • Constructs a new message instance.

    Parameters

    Returns AttributeValue

Properties

Readonly $type

$type: Type

Reference to the reflected type.

Optional N

N: number

For number values, expressed as double.

Optional S

S: number

For single string values.

Maximum string length is 100 characters.

Optional SDM

SDM: {}

For a map of up to 10 data string:double pairs.

Maximum length for each string value is 100 characters.

Type declaration

  • [key: string]: number

Optional SL

SL: string[]

For a list of up to 10 strings.

Maximum length for each string is 100 characters. Duplicate values are not recognized; all occurrences of the repeated value after the first of a repeated value are ignored.

type

type: number

"Enumeration" that determines the type of attribute value.

This isn't a true Protocol Buffer enumeration, just an integer that specifies NONE, STRING, DOUBLE, STRING_LIST, or STRING_DOUBLE_MAP.

Static Readonly $type

$type: Type

Reference to the reflected type.

Static Readonly DOUBLE

DOUBLE: 2 = 2

Defines DOUBLE type for type field.

Static Readonly NONE

NONE: 0 = 0

Defines NONE type for type field.

Static Readonly STRING

STRING: 1 = 1

Defines STRING type for type field.

Static Readonly STRING_DOUBLE_MAP

STRING_DOUBLE_MAP: 4 = 4

Defines STRING_DOUBLE_MAP type for type field.

Static Readonly STRING_LIST

STRING_LIST: 3 = 3

Defines STRING_LIST type for type field.

Methods

toJSON

  • toJSON(): {}
  • Converts this message to JSON.

    Returns {}

    JSON object

    • [k: string]: any

Static create

  • create<T>(this: Constructor<T>, properties?: {}): Message<T>
  • Creates a new message of this type using the specified properties.

    Type parameters

    Parameters

    • this: Constructor<T>
    • Optional properties: {}
      • [k: string]: any

    Returns Message<T>

    Message instance

Static decode

  • decode<T>(this: Constructor<T>, reader: Uint8Array | Reader): T
  • Decodes a message of this type.

    Type parameters

    Parameters

    • this: Constructor<T>
    • reader: Uint8Array | Reader

      Reader or buffer to decode

    Returns T

    Decoded message

Static decodeDelimited

  • decodeDelimited<T>(this: Constructor<T>, reader: Uint8Array | Reader): T
  • Decodes a message of this type preceeded by its length as a varint.

    Type parameters

    Parameters

    • this: Constructor<T>
    • reader: Uint8Array | Reader

      Reader or buffer to decode

    Returns T

    Decoded message

Static encode

  • encode<T>(this: Constructor<T>, message: T | {}, writer?: Writer): Writer
  • Encodes a message of this type.

    Type parameters

    Parameters

    • this: Constructor<T>
    • message: T | {}

      Message to encode

    • Optional writer: Writer

    Returns Writer

    Writer

Static encodeDelimited

  • encodeDelimited<T>(this: Constructor<T>, message: T | {}, writer?: Writer): Writer
  • Encodes a message of this type preceeded by its length as a varint.

    Type parameters

    Parameters

    • this: Constructor<T>
    • message: T | {}

      Message to encode

    • Optional writer: Writer

    Returns Writer

    Writer

Static fromObject

  • fromObject<T>(this: Constructor<T>, object: {}): T
  • Creates a new message of this type from a plain object. Also converts values to their respective internal types.

    Type parameters

    Parameters

    • this: Constructor<T>
    • object: {}

      Plain object

      • [k: string]: any

    Returns T

    Message instance

Static toObject

  • toObject<T>(this: Constructor<T>, message: T, options?: IConversionOptions): {}
  • Creates a plain object from a message of this type. Also converts values to other types if specified.

    Type parameters

    Parameters

    • this: Constructor<T>
    • message: T

      Message instance

    • Optional options: IConversionOptions

    Returns {}

    Plain object

    • [k: string]: any

Static verify

  • verify(message: {}): string
  • Verifies a message of this type.

    Parameters

    • message: {}

      Plain object to verify

      • [k: string]: any

    Returns string

    null if valid, otherwise the reason why it is not

Generated using TypeDoc