Method Global:RegisterPacketEvent [-] [+]

Registers a WorldPacket event handler.

enum PacketEvents
{
    PACKET_EVENT_ON_PACKET_RECEIVE          =     5,       // (event, packet, player) - Player only if accessible. Can return false, newPacket
    PACKET_EVENT_ON_PACKET_RECEIVE_UNKNOWN  =     6,       // Not Implemented
    PACKET_EVENT_ON_PACKET_SEND             =     7,       // (event, packet, player) - Player only if accessible. Can return false, newPacket

    PACKET_EVENT_COUNT
};

Synopsis

cancel = RegisterPacketEvent( entry, event, function )

cancel = RegisterPacketEvent( entry, event, function, shots )

Arguments

number entry

Opcode.

Valid numbers: integers from 0 to 4,294,967,295.

number event

Packet event Id, refer to PacketEvents above.

Valid numbers: integers from 0 to 4,294,967,295.

function function

Function to register.

number shots (0)

The number of times the function will be called, 0 means "always call this function".

Valid numbers: integers from 0 to 4,294,967,295.

Returns

function cancel

A function that cancels the binding when called.

Generated on 11/04/2018
©2016 - Eluna Lua Engine