Class

BasePacket

BasePacket()

Base class for packets
Constructor

# new BasePacket()

View Source packets/BasePacket.js, line 5

Methods

# encodeInfos() → {Buffer}

Write all fields to the buffer.

View Source packets/BasePacket.js, line 23

Buffer

# getValue(Field) → {string}

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

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

View Source packets/BasePacket.js, line 65

# parseInfos(Packet)

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

View Source packets/BasePacket.js, line 10

# setValue(Field, Value)

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

View Source packets/BasePacket.js, line 48