12#ifndef MINESERVER_CLIENTEVENTS_H
13#define MINESERVER_CLIENTEVENTS_H
76 luabridge::getGlobalNamespace(state)
77 .beginNamespace(
"event")
78 .addFunction(
"onClientHandshake", [](
const luabridge::LuaRef &
ref)
133 luabridge::getGlobalNamespace(state)
134 .beginNamespace(
"event")
135 .addFunction(
"onClientStatus", [](
const luabridge::LuaRef &
ref)
137 if(!
ref.isFunction())
Event for a client connection.
Definition clientevents.hpp:32
Event for a client status.
Definition clientevents.hpp:51
ClientHandshakeEvent(HandshakePacket *packet)
Construct a new Client Handshake Event object.
Definition clientevents.hpp:67
static void loadLua(lua_State *state)
Loads this event to lua.
Definition clientevents.hpp:74
HandshakePacket * packet
Pointer to handshake packet.
Definition clientevents.hpp:60
Event for a client status.
Definition clientevents.hpp:108
ServerListPacket * packet
Pointer to server list packet.
Definition clientevents.hpp:117
static void loadLua(lua_State *state)
Loads this event to lua.
Definition clientevents.hpp:131
ClientStatusEvent(ServerListPacket *packet)
Construct a new Client Status Event object.
Definition clientevents.hpp:124
static EventsManager * inst()
Gets the instance of the events manager.
Definition event.cpp:20
EventHandler< T >::subId subscribe(const typename EventHandler< T >::callbackType &callback)
Subscribe to T event.
Definition event.h:285
Handshake Packet.
Definition handshake.h:26
Event interface.
Definition event.h:28
Server List packet.
Definition serverlist.h:27
The header-only containing event logic.
constexpr std::string_view type_name()
Gets the name of the type paramater.
Definition event.h:56
The file containing handshake protocol.
The file containing packet logic for server list.