mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 13:41:31 +00:00
[Quest API] Add get_data_remaining(bucket_name) to Perl/Lua. (#1421)
- Add quest::get_data_remaining(bucket_name) to Perl. - Add eq.get_data_remaining(bucket_name) to Lua.
This commit is contained in:
parent
68fe95786e
commit
40db13d33e
@ -6824,6 +6824,21 @@ XS(XS__rename) {
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
XS(XS__get_data_remaining);
|
||||
XS(XS__get_data_remaining) {
|
||||
dXSARGS;
|
||||
if (items != 1)
|
||||
Perl_croak(aTHX_ "Usage: quest::get_data_remaining(string bucket_name)");
|
||||
|
||||
dXSTARG;
|
||||
std::string bucket_name = (std::string) SvPV_nolen(ST(0));
|
||||
|
||||
sv_setpv(TARG, DataBucket::GetDataRemaining(bucket_name).c_str());
|
||||
XSprePUSH;
|
||||
PUSHTARG;
|
||||
XSRETURN(1);
|
||||
}
|
||||
|
||||
/*
|
||||
This is the callback perl will look for to setup the
|
||||
quest package's XSUBs
|
||||
@ -6878,6 +6893,7 @@ EXTERN_C XS(boot_quest) {
|
||||
newXS(strcpy(buf, "get_rule"), XS__get_rule, file);
|
||||
newXS(strcpy(buf, "get_data"), XS__get_data, file);
|
||||
newXS(strcpy(buf, "get_data_expires"), XS__get_data_expires, file);
|
||||
newXS(strcpy(buf, "get_data_remaining"), XS__get_data_remaining, file);
|
||||
newXS(strcpy(buf, "set_data"), XS__set_data, file);
|
||||
newXS(strcpy(buf, "delete_data"), XS__delete_data, file);
|
||||
newXS(strcpy(buf, "IsBeneficialSpell"), XS__IsBeneficialSpell, file);
|
||||
|
||||
@ -2475,6 +2475,10 @@ void lua_rename(std::string name) {
|
||||
quest_manager.rename(name);
|
||||
}
|
||||
|
||||
std::string lua_get_data_remaining(std::string bucket_name) {
|
||||
return DataBucket::GetDataRemaining(bucket_name);
|
||||
}
|
||||
|
||||
#define LuaCreateNPCParse(name, c_type, default_value) do { \
|
||||
cur = table[#name]; \
|
||||
if(luabind::type(cur) != LUA_TNIL) { \
|
||||
@ -3044,6 +3048,7 @@ luabind::scope lua_register_general() {
|
||||
luabind::def("get_deity_name", &lua_get_deity_name),
|
||||
luabind::def("get_inventory_slot_name", &lua_get_inventory_slot_name),
|
||||
luabind::def("rename", &lua_rename),
|
||||
luabind::def("get_data_remaining", &lua_get_data_remaining),
|
||||
|
||||
/**
|
||||
* Expansions
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user