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

Event for a client status. More...

#include <clientevents.hpp>

Inheritance diagram for ClientStatusEvent:
IEvent< ClientStatusEvent >

Public Member Functions

 ClientStatusEvent (ServerListPacket *packet)
 Construct a new Client Status Event object.
 

Static Public Member Functions

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

Public Attributes

ServerListPacketpacket
 Pointer to server list packet.
 

Detailed Description

Event for a client status.

Launched when a new clients was connected, it was a minecraft connection and it asked for the status of the server. Should implement in lua as such :

local function onStatus(e)
-- do your thing, like random max players
e.packet.maxPlayers = math.random(1,100)
end
event.onClientStatus(onStatus)

Constructor & Destructor Documentation

◆ ClientStatusEvent()

ClientStatusEvent::ClientStatusEvent ( ServerListPacket * packet)
inline

Construct a new Client Status Event object.

Parameters
packetthe pointer to the packet

Member Function Documentation

◆ loadLua()

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

Loads this event to lua.

Parameters
statethe lua state to load to

Member Data Documentation

◆ packet

ServerListPacket* ClientStatusEvent::packet

Pointer to server list packet.

Pointer to the server list 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: