mirror of
https://github.com/cuberite/cuberite.git
synced 2025-01-07 03:16:55 +08:00
Use new cLuaStateParams::Read
This commit is contained in:
parent
a24147d970
commit
bc7ffc5448
@ -9,6 +9,7 @@
|
||||
|
||||
|
||||
#include "LuaState.h"
|
||||
#include "tolua++/include/tolua++.h"
|
||||
|
||||
|
||||
|
||||
|
@ -3,9 +3,9 @@
|
||||
|
||||
#include "ManualBindings.h"
|
||||
#undef TOLUA_TEMPLATE_BIND
|
||||
#include "LuaStateParams.h"
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include "tolua++/include/tolua++.h"
|
||||
#include "polarssl/md5.h"
|
||||
#include "polarssl/sha1.h"
|
||||
#include "PluginLua.h"
|
||||
@ -3452,6 +3452,56 @@ static int tolua_cServer_RegisterForgeMod(lua_State * a_LuaState)
|
||||
|
||||
|
||||
|
||||
static int tolua_cServer_TestApiSpeedOld(lua_State * a_LuaState)
|
||||
{
|
||||
cLuaState L(a_LuaState);
|
||||
if (
|
||||
!L.CheckParamSelf("cServer") ||
|
||||
!L.CheckParamString(2, 3) ||
|
||||
!L.CheckParamNumber(4) ||
|
||||
!L.CheckParamEnd(5)
|
||||
)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
cServer * Server;
|
||||
AString Name, Version;
|
||||
UInt32 Protocol;
|
||||
L.GetStackValues(1, Server, Name, Version, Protocol);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static int tolua_cServer_TestApiSpeedNew(lua_State * a_LuaState)
|
||||
{
|
||||
cLuaState L(a_LuaState);
|
||||
cServer * Server;
|
||||
AString Name, Version;
|
||||
UInt32 Protocol;
|
||||
auto self = cLuaStateParams::self(Server);
|
||||
auto staticSelf = cLuaStateParams::staticSelf<cServer>();
|
||||
switch (cLuaStateParams::Read(L,
|
||||
std::tie(self, Name, Version, Protocol),
|
||||
std::tie(staticSelf, Name, Version, Protocol)
|
||||
))
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static int tolua_cScoreboard_GetTeamNames(lua_State * L)
|
||||
{
|
||||
cLuaState S(L);
|
||||
@ -4220,7 +4270,9 @@ void cManualBindings::Bind(lua_State * tolua_S)
|
||||
tolua_endmodule(tolua_S);
|
||||
|
||||
tolua_beginmodule(tolua_S, "cServer");
|
||||
tolua_function(tolua_S, "RegisterForgeMod", tolua_cServer_RegisterForgeMod);
|
||||
tolua_function(tolua_S, "RegisterForgeMod", tolua_cServer_RegisterForgeMod);
|
||||
tolua_function(tolua_S, "TestApiSpeedOld", tolua_cServer_TestApiSpeedOld);
|
||||
tolua_function(tolua_S, "TestApiSpeedNew", tolua_cServer_TestApiSpeedNew);
|
||||
tolua_endmodule(tolua_S);
|
||||
|
||||
tolua_beginmodule(tolua_S, "cStringCompression");
|
||||
|
Loading…
Reference in New Issue
Block a user