mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Add GetDisciplineTimer() and ResetDisciplineTimer() to Perl/Lua.
This commit is contained in:
@@ -3670,6 +3670,54 @@ XS(XS_Client_UseDiscipline) {
|
||||
XSRETURN(1);
|
||||
}
|
||||
|
||||
XS(XS_Client_GetDisciplineTimer); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_Client_GetDisciplineTimer) {
|
||||
dXSARGS;
|
||||
if (items != 2)
|
||||
Perl_croak(aTHX_ "Usage: Client::GetDisciplineTimer(THIS, uint32 timer_id)");
|
||||
{
|
||||
Client *THIS;
|
||||
uint32 RETVAL;
|
||||
dXSTARG;
|
||||
uint32 timer_id = (uint32) SvUV(ST(1));
|
||||
|
||||
if (sv_derived_from(ST(0), "Client")) {
|
||||
IV tmp = SvIV((SV *) SvRV(ST(0)));
|
||||
THIS = INT2PTR(Client *, tmp);
|
||||
} else
|
||||
Perl_croak(aTHX_ "THIS is not of type Client");
|
||||
if (THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
RETVAL = THIS->GetDisciplineTimer(timer_id);
|
||||
XSprePUSH;
|
||||
PUSHu((UV) RETVAL);
|
||||
}
|
||||
XSRETURN(1);
|
||||
}
|
||||
|
||||
XS(XS_Client_ResetDisciplineTimer); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_Client_ResetDisciplineTimer) {
|
||||
dXSARGS;
|
||||
if (items != 2)
|
||||
Perl_croak(aTHX_ "Usage: Client::ResetDisciplineTimer(THIS, uint32 timer_id)");
|
||||
{
|
||||
Client *THIS;
|
||||
uint32 timer_id = (uint32) SvUV(ST(1));
|
||||
|
||||
if (sv_derived_from(ST(0), "Client")) {
|
||||
IV tmp = SvIV((SV *) SvRV(ST(0)));
|
||||
THIS = INT2PTR(Client *, tmp);
|
||||
} else
|
||||
Perl_croak(aTHX_ "THIS is not of type Client");
|
||||
if (THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
THIS->ResetDisciplineTimer(timer_id);
|
||||
}
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
XS(XS_Client_GetCharacterFactionLevel); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_Client_GetCharacterFactionLevel) {
|
||||
dXSARGS;
|
||||
@@ -6451,6 +6499,7 @@ XS(boot_Client) {
|
||||
newXSproto(strcpy(buf, "GetCorpseID"), XS_Client_GetCorpseID, file, "$$");
|
||||
newXSproto(strcpy(buf, "GetCorpseItemAt"), XS_Client_GetCorpseItemAt, file, "$$$");
|
||||
newXSproto(strcpy(buf, "GetCustomItemData"), XS_Client_GetCustomItemData, file, "$$$");
|
||||
newXSproto(strcpy(buf, "GetDisciplineTimer"), XS_Client_GetDisciplineTimer, file, "$$");
|
||||
newXSproto(strcpy(buf, "GetDiscSlotBySpellID"), XS_Client_GetDiscSlotBySpellID, file, "$$");
|
||||
newXSproto(strcpy(buf, "GetDuelTarget"), XS_Client_GetDuelTarget, file, "$");
|
||||
newXSproto(strcpy(buf, "GetEbonCrystals"), XS_Client_GetEbonCrystals, file, "$");
|
||||
@@ -6548,6 +6597,7 @@ XS(boot_Client) {
|
||||
newXSproto(strcpy(buf, "RefundAA"), XS_Client_RefundAA, file, "$$");
|
||||
newXSproto(strcpy(buf, "RemoveNoRent"), XS_Client_RemoveNoRent, file, "$");
|
||||
newXSproto(strcpy(buf, "ResetAA"), XS_Client_ResetAA, file, "$");
|
||||
newXSproto(strcpy(buf, "ResetDisciplineTimer"), XS_Client_ResetDisciplineTimer, file, "$$");
|
||||
newXSproto(strcpy(buf, "ResetTrade"), XS_Client_ResetTrade, file, "$");
|
||||
newXSproto(strcpy(buf, "Save"), XS_Client_Save, file, "$$");
|
||||
newXSproto(strcpy(buf, "SaveBackup"), XS_Client_SaveBackup, file, "$");
|
||||
|
||||
Reference in New Issue
Block a user