Mineserver
A rewrite of Minecraft 1.8.9 in C++ !
Loading...
Searching...
No Matches
ClientHandshakeEvent Class Reference

Event for a client status. More...

#include <clientevents.hpp>

Inheritance diagram for ClientHandshakeEvent:
IEvent< ClientHandshakeEvent >

Public Member Functions

 ClientHandshakeEvent (HandshakePacket *packet)
 Construct a new Client Handshake Event object.
 

Static Public Member Functions

static void loadLua (lua_State *state)
 Loads this event to lua.
 
- Static Public Member Functions inherited from IEvent< ClientHandshakeEvent >
static void loadLua (lua_State *state)
 Loads the event to the lua state.
 

Public Attributes

HandshakePacketpacket
 Pointer to handshake packet.
 

Detailed Description

Event for a client status.

Launched when a new clients was connected, and we received it seems an handshake. Should implement in lua as such :

local function onStatus(e)
-- do your thing, like printing the client protocol version
print("Client protocol version : " .. e.packet.protocolVersion)
end
event.onClientHandshake(onStatus)

Constructor & Destructor Documentation

◆ ClientHandshakeEvent()

ClientHandshakeEvent::ClientHandshakeEvent ( HandshakePacket * packet)
inline

Construct a new Client Handshake Event object.

Parameters
packetthe pointer to the packet

Member Function Documentation

◆ loadLua()

static void ClientHandshakeEvent::loadLua ( lua_State * state)
inlinestatic

Loads this event to lua.

Parameters
statethe lua state to load to

Member Data Documentation

◆ packet

HandshakePacket* ClientHandshakeEvent::packet

Pointer to handshake packet.

Pointer to the handshake packet, so that lua and other listeners can modify the data sent to clients individually.


The documentation for this class was generated from the following file: