Merge pull request #1079 from KinglyKrab/disc_timer

Add GetDisciplineTimer() and ResetDisciplineTimer() to Perl/Lua.
This commit is contained in:
Chris Miles
2020-06-28 22:00:45 -05:00
committed by GitHub
5 changed files with 83 additions and 0 deletions
+50
View File
@@ -3796,6 +3796,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;
@@ -6577,6 +6625,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, "$");
@@ -6677,6 +6726,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, "$");