Merge pull request #1088 from EQEmu/move_zone_instance

Add MoveZoneInstance methods to Perl/Lua.
This commit is contained in:
Chris Miles
2020-06-30 14:47:16 -05:00
committed by GitHub
5 changed files with 200 additions and 0 deletions
+129
View File
@@ -1473,6 +1473,132 @@ XS(XS_Client_MoveZoneRaid) {
XSRETURN_EMPTY;
}
XS(XS_Client_MoveZoneInstance); /* prototype to pass -Wmissing-prototypes */
XS(XS_Client_MoveZoneInstance) {
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage: Client::MoveZoneInstance(THIS, uint16 instance_id)");
{
Client *THIS;
uint16 instance_id = (uint16) 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.");
if (THIS->IsClient()) {
THIS->MoveZoneInstance(instance_id);
} else {
if (THIS->IsMerc()) {
LogDebug("[CLIENT] Perl(XS_Client_MoveZoneInstance) attempted to process a type Merc reference");
}
#ifdef BOTS
else if (THIS->IsBot()) {
LogDebug("[CLIENT] Perl(XS_Client_MoveZoneInstance) attempted to process a type Bot reference");
}
#endif
else if (THIS->IsNPC()) {
LogDebug("[CLIENT] Perl(XS_Client_MoveZoneInstance) attempted to process a type NPC reference");
}
else {
LogDebug("[CLIENT] Perl(XS_Client_MoveZoneInstance) attempted to process an Unknown type reference");
}
Perl_croak(aTHX_ "THIS is not of type Client");
}
}
XSRETURN_EMPTY;
}
XS(XS_Client_MoveZoneInstanceGroup); /* prototype to pass -Wmissing-prototypes */
XS(XS_Client_MoveZoneInstanceGroup) {
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage: Client::MoveZoneInstanceGroup(THIS, uint16 instance_id)");
{
Client *THIS;
uint16 instance_id = (uint16) 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.");
if (THIS->IsClient()) {
THIS->MoveZoneInstanceGroup(instance_id);
} else {
if (THIS->IsMerc()) {
LogDebug("[CLIENT] Perl(XS_Client_MoveZoneInstanceGroup) attempted to process a type Merc reference");
}
#ifdef BOTS
else if (THIS->IsBot()) {
LogDebug("[CLIENT] Perl(XS_Client_MoveZoneInstanceGroup) attempted to process a type Bot reference");
}
#endif
else if (THIS->IsNPC()) {
LogDebug("[CLIENT] Perl(XS_Client_MoveZoneInstanceGroup) attempted to process a type NPC reference");
}
else {
LogDebug("[CLIENT] Perl(XS_Client_MoveZoneInstanceGroup) attempted to process an Unknown type reference");
}
Perl_croak(aTHX_ "THIS is not of type Client");
}
}
XSRETURN_EMPTY;
}
XS(XS_Client_MoveZoneInstanceRaid); /* prototype to pass -Wmissing-prototypes */
XS(XS_Client_MoveZoneInstanceRaid) {
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage: Client::MoveZoneInstanceRaid(THIS, uint16 instance_id)");
{
Client *THIS;
uint16 instance_id = (uint16) 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.");
if (THIS->IsClient()) {
THIS->MoveZoneInstanceRaid(instance_id);
} else {
if (THIS->IsMerc()) {
LogDebug("[CLIENT] Perl(XS_Client_MoveZoneInstanceRaid) attempted to process a type Merc reference");
}
#ifdef BOTS
else if (THIS->IsBot()) {
LogDebug("[CLIENT] Perl(XS_Client_MoveZoneInstanceRaid) attempted to process a type Bot reference");
}
#endif
else if (THIS->IsNPC()) {
LogDebug("[CLIENT] Perl(XS_Client_MoveZoneInstanceRaid) attempted to process a type NPC reference");
}
else {
LogDebug("[CLIENT] Perl(XS_Client_MoveZoneInstanceRaid) attempted to process an Unknown type reference");
}
Perl_croak(aTHX_ "THIS is not of type Client");
}
}
XSRETURN_EMPTY;
}
XS(XS_Client_ChangeLastName); /* prototype to pass -Wmissing-prototypes */
XS(XS_Client_ChangeLastName) {
dXSARGS;
@@ -6744,6 +6870,9 @@ XS(boot_Client) {
newXSproto(strcpy(buf, "MoveZone"), XS_Client_MoveZone, file, "$$");
newXSproto(strcpy(buf, "MoveZoneGroup"), XS_Client_MoveZoneGroup, file, "$$");
newXSproto(strcpy(buf, "MoveZoneRaid"), XS_Client_MoveZoneRaid, file, "$$");
newXSproto(strcpy(buf, "MoveZoneInstance"), XS_Client_MoveZoneInstance, file, "$$");
newXSproto(strcpy(buf, "MoveZoneInstanceGroup"), XS_Client_MoveZoneInstanceGroup, file, "$$");
newXSproto(strcpy(buf, "MoveZoneInstanceRaid"), XS_Client_MoveZoneInstanceRaid, file, "$$");
newXSproto(strcpy(buf, "NPCSpawn"), XS_Client_NPCSpawn, file, "$$$;$");
newXSproto(strcpy(buf, "NukeItem"), XS_Client_NukeItem, file, "$$;$");
newXSproto(strcpy(buf, "OpenLFGuildWindow"), XS_Client_OpenLFGuildWindow, file, "$");