mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
[CSM] Add function to get the server protocol version. (#5529)
This commit is contained in:
parent
be06636965
commit
88b9b9652a
4 changed files with 15 additions and 0 deletions
|
@ -234,6 +234,13 @@ int ModApiClient::l_sound_stop(lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
// get_protocol_version()
|
||||
int ModApiClient::l_get_protocol_version(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, getClient(L)->getProtoVersion());
|
||||
return 1;
|
||||
}
|
||||
|
||||
void ModApiClient::Initialize(lua_State *L, int top)
|
||||
{
|
||||
API_FCT(get_current_modname);
|
||||
|
@ -251,4 +258,5 @@ void ModApiClient::Initialize(lua_State *L, int top)
|
|||
API_FCT(get_meta);
|
||||
API_FCT(sound_play);
|
||||
API_FCT(sound_stop);
|
||||
API_FCT(get_protocol_version);
|
||||
}
|
||||
|
|
|
@ -69,6 +69,9 @@ private:
|
|||
|
||||
static int l_sound_stop(lua_State *L);
|
||||
|
||||
// get_protocol_version()
|
||||
static int l_get_protocol_version(lua_State *L);
|
||||
|
||||
public:
|
||||
static void Initialize(lua_State *L, int top);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue