Class

InputData

InputData()

Constructor

# new InputData()

View Source packets/InputData.js, line 8

Extends

Members

# fields

Fields Object
Properties:
Name Type Description
player_id UByteType Player's id
key_states UByteType A byte that each bit is a key state

View Source packets/InputData.js, line 23

Integer

# id

Packet Id

View Source packets/InputData.js, line 16

Methods

# encodeInfos() → {Buffer}

Write all fields to the buffer.
Overrides:

View Source packets/BasePacket.js, line 23

Buffer

# getKeyStates() → {WalkInputs}

Get the an object with the key_states fields

View Source packets/InputData.js, line 56

WalkInputs

# getValue(Field) → {string}

Get a field's value
Parameters:
Name Type Description
Field string Field's name
Overrides:

View Source packets/BasePacket.js, line 57

string

# organize(Game)

This function is used for packets organize infos inside game's class
Parameters:
Name Type Description
Game Game Game Class
Overrides:

View Source packets/BasePacket.js, line 65

# parseInfos(Packet)

Read a packet and assign the values for fields.
Parameters:
Name Type Description
Packet Buffer
Overrides:

View Source packets/BasePacket.js, line 10

# setKeyStates(KeyStates)

Set key states field using object
Parameters:
Name Type Description
KeyStates WalkInputs Object with key states.

View Source packets/InputData.js, line 40

# setValue(Field, Value)

Set a fields's value
Parameters:
Name Type Description
Field string Field's name
Value any Field's value
Overrides:

View Source packets/BasePacket.js, line 48