mirror of
https://github.com/EQEmu/Server.git
synced 2026-02-23 19:52:25 +00:00
Add AddReplayLockoutDuration api
This commit is contained in:
parent
3ed7215a92
commit
77406d7322
@ -485,6 +485,11 @@ void Expedition::AddLockoutDuration(const std::string& event_name, int seconds,
|
||||
SendWorldLockoutDuration(lockout, seconds, members_only);
|
||||
}
|
||||
|
||||
void Expedition::AddReplayLockoutDuration(int seconds, bool members_only)
|
||||
{
|
||||
AddLockoutDuration(DZ_REPLAY_TIMER_NAME, seconds, members_only);
|
||||
}
|
||||
|
||||
void Expedition::UpdateLockoutDuration(
|
||||
const std::string& event_name, uint32_t seconds, bool members_only)
|
||||
{
|
||||
|
||||
@ -129,6 +129,7 @@ public:
|
||||
void AddLockout(const std::string& event_name, uint32_t seconds);
|
||||
void AddLockoutDuration(const std::string& event_name, int seconds, bool members_only = true);
|
||||
void AddReplayLockout(uint32_t seconds);
|
||||
void AddReplayLockoutDuration(int seconds, bool members_only = true);
|
||||
bool HasLockout(const std::string& event_name);
|
||||
bool HasReplayLockout();
|
||||
void RemoveLockout(const std::string& event_name);
|
||||
|
||||
@ -47,6 +47,16 @@ void Lua_Expedition::AddReplayLockout(uint32_t seconds) {
|
||||
self->AddReplayLockout(seconds);
|
||||
}
|
||||
|
||||
void Lua_Expedition::AddReplayLockoutDuration(int seconds) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->AddReplayLockoutDuration(seconds);
|
||||
}
|
||||
|
||||
void Lua_Expedition::AddReplayLockoutDuration(int seconds, bool members_only) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->AddReplayLockoutDuration(seconds, members_only);
|
||||
}
|
||||
|
||||
uint32_t Lua_Expedition::GetID() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetID();
|
||||
@ -236,6 +246,8 @@ luabind::scope lua_register_expedition() {
|
||||
.def("AddLockoutDuration", (void(Lua_Expedition::*)(std::string, int))&Lua_Expedition::AddLockoutDuration)
|
||||
.def("AddLockoutDuration", (void(Lua_Expedition::*)(std::string, int, bool))&Lua_Expedition::AddLockoutDuration)
|
||||
.def("AddReplayLockout", (void(Lua_Expedition::*)(uint32_t))&Lua_Expedition::AddReplayLockout)
|
||||
.def("AddReplayLockoutDuration", (void(Lua_Expedition::*)(int))&Lua_Expedition::AddReplayLockoutDuration)
|
||||
.def("AddReplayLockoutDuration", (void(Lua_Expedition::*)(int, bool))&Lua_Expedition::AddReplayLockoutDuration)
|
||||
.def("GetID", (uint32_t(Lua_Expedition::*)(void))&Lua_Expedition::GetID)
|
||||
.def("GetInstanceID", (int(Lua_Expedition::*)(void))&Lua_Expedition::GetInstanceID)
|
||||
.def("GetLeaderName", (std::string(Lua_Expedition::*)(void))&Lua_Expedition::GetLeaderName)
|
||||
|
||||
@ -57,6 +57,8 @@ public:
|
||||
void AddLockoutDuration(std::string event_name, int seconds);
|
||||
void AddLockoutDuration(std::string event_name, int seconds, bool members_only);
|
||||
void AddReplayLockout(uint32_t seconds);
|
||||
void AddReplayLockoutDuration(int seconds);
|
||||
void AddReplayLockoutDuration(int seconds, bool members_only);
|
||||
uint32_t GetID();
|
||||
int GetInstanceID();
|
||||
std::string GetLeaderName();
|
||||
|
||||
@ -90,6 +90,7 @@ XS(XS_Expedition_AddLockoutDuration) {
|
||||
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
XS(XS_Expedition_AddReplayLockout);
|
||||
XS(XS_Expedition_AddReplayLockout) {
|
||||
dXSARGS;
|
||||
@ -107,6 +108,30 @@ XS(XS_Expedition_AddReplayLockout) {
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
XS(XS_Expedition_AddReplayLockoutDuration);
|
||||
XS(XS_Expedition_AddReplayLockoutDuration) {
|
||||
dXSARGS;
|
||||
if (items != 2 && items != 3) {
|
||||
Perl_croak(aTHX_ "Usage: Expedition::AddReplayLockoutDuration(THIS, int seconds [, bool members_only = true])");
|
||||
}
|
||||
|
||||
Expedition* THIS = nullptr;
|
||||
VALIDATE_THIS_IS_EXPEDITION;
|
||||
|
||||
int seconds = static_cast<int>(SvUV(ST(1)));
|
||||
if (items == 3)
|
||||
{
|
||||
bool members_only = (bool)SvTRUE(ST(2));
|
||||
THIS->AddReplayLockoutDuration(seconds, members_only);
|
||||
}
|
||||
else
|
||||
{
|
||||
THIS->AddReplayLockoutDuration(seconds);
|
||||
}
|
||||
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
XS(XS_Expedition_GetID);
|
||||
XS(XS_Expedition_GetID) {
|
||||
dXSARGS;
|
||||
@ -597,6 +622,7 @@ XS(boot_Expedition) {
|
||||
newXSproto(strcpy(buf, "AddLockout"), XS_Expedition_AddLockout, file, "$$$");
|
||||
newXSproto(strcpy(buf, "AddLockoutDuration"), XS_Expedition_AddLockoutDuration, file, "$$$;$");
|
||||
newXSproto(strcpy(buf, "AddReplayLockout"), XS_Expedition_AddReplayLockout, file, "$$");
|
||||
newXSproto(strcpy(buf, "AddReplayLockoutDuration"), XS_Expedition_AddReplayLockoutDuration, file, "$$;$");
|
||||
newXSproto(strcpy(buf, "GetID"), XS_Expedition_GetID, file, "$");
|
||||
newXSproto(strcpy(buf, "GetInstanceID"), XS_Expedition_GetInstanceID, file, "$");
|
||||
newXSproto(strcpy(buf, "GetLeaderName"), XS_Expedition_GetLeaderName, file, "$");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user