Mineserver
A rewrite of Minecraft 1.8.9 in C++ !
Loading...
Searching...
No Matches
clientstate.h
Go to the documentation of this file.
1
19#ifndef MINESERVER_CLIENTSTATE_H
20#define MINESERVER_CLIENTSTATE_H
21
22#include <plugins/luaheaders.h>
23
31{
47 STATUS = 1,
55 LOGIN = 2,
62 PLAY = 3
63};
64
65#ifndef DOXYGEN_IGNORE_THIS
66template <>
67struct luabridge::Stack<ClientState> : luabridge::Enum<ClientState,
68 ClientState::HANDSHAKE,
69 ClientState::STATUS,
70 ClientState::LOGIN,
71 ClientState::PLAY>
72{
73};
74#endif
75
82inline void loadClientStateLua(lua_State* state, const char* namespaceName) {
83 luabridge::getGlobalNamespace(state)
84 .beginNamespace(namespaceName)
85 .beginNamespace("ClientState")
86 .addProperty("HANDSHAKE", +[] {return ClientState::HANDSHAKE;})
87 .addProperty("STATUS", +[] {return ClientState::STATUS;})
88 .addProperty("LOGIN", +[] {return ClientState::LOGIN;})
89 .addProperty("PLAY", +[] {return ClientState::PLAY;})
91 .endNamespace();
92}
93#endif // MINESERVER_CLIENTSTATE_H
ClientState
Client State.
Definition clientstate.h:31
@ PLAY
Play state.
Definition clientstate.h:62
@ LOGIN
Login state.
Definition clientstate.h:55
@ STATUS
Status state.
Definition clientstate.h:47
@ HANDSHAKE
Handshake state.
Definition clientstate.h:39
void loadClientStateLua(lua_State *state, const char *namespaceName)
Loads ClientState to lua.
Definition clientstate.h:82
constexpr std::string_view type_name()
Gets the name of the type paramater.
Definition event.h:56
Utility header file for lua things.