[Cleanup] Delete embxs.cpp/embxs.h (#3284)

* [Cleanup] Delete embxs.cpp/embxs.h

# Notes
- These files and the one method in them are unused.

* Update embperl.cpp
This commit is contained in:
Alex King 2023-04-14 19:40:51 -04:00 committed by GitHub
parent 933d856b5b
commit a7e95d7818
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 41 additions and 107 deletions

View File

@ -32,7 +32,6 @@ SET(zone_sources
embparser.cpp
embparser_api.cpp
embperl.cpp
embxs.cpp
encounter.cpp
entity.cpp
exp.cpp
@ -77,7 +76,6 @@ SET(zone_sources
lua_spell.cpp
lua_stat_bonuses.cpp
embperl.cpp
embxs.cpp
entity.cpp
exp.cpp
fearpath.cpp
@ -186,7 +184,6 @@ SET(zone_headers
dynamic_zone.h
embparser.h
embperl.h
embxs.h
encounter.h
entity.h
errmsg.h

View File

@ -27,7 +27,6 @@
#include "dialogue_window.h"
#include "embperl.h"
#include "embxs.h"
#include "entity.h"
#include "expedition.h"
#include "queryserv.h"
@ -4513,7 +4512,6 @@ void perl_register_quest()
package.add("getfactionname", &Perl__getfactionname);
package.add("getinventoryslotid", &Perl__getinventoryslotid);
package.add("getitemname", &Perl__getitemname);
package.add("getItemName", &Perl__qc_getItemName);
package.add("getitemstat", &Perl__getitemstat);
package.add("getlanguagename", &Perl__getlanguagename);
package.add("getldonthemename", &Perl__getldonthemename);

View File

@ -322,6 +322,47 @@ bool Embperl::VarExists(const char *package, const char *var) {
return(hv_exists(stash, var, len));
}
#ifdef EMBPERL_IO_CAPTURE
XS(XS_EQEmuIO_PRINT); /* prototype to pass -Wmissing-prototypes */
XS(XS_EQEmuIO_PRINT)
{
dXSARGS;
if (items < 2) {
return;
}
for (int r = 1; r < items; r++) {
char *str = SvPV_nolen(ST(r));
char *cur = str;
/* Strip newlines from log message 'str' */
*std::remove(str, str + strlen(str), '\n') = '\0';
std::string log_string = str;
if (
log_string.find("did not return a true") != std::string::npos ||
log_string.find("is experimental") != std::string::npos
) {
return;
}
for (int i = 0; *cur != '\0'; i++, cur++) {
if (*cur == '\n') {
LogQuests("{}", str);
}
}
if (!log_string.empty()) {
LogQuests("{}", log_string);
}
}
XSRETURN_EMPTY;
}
#endif //EMBPERL_IO_CAPTURE
#endif //EMBPERL

View File

@ -1,95 +0,0 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.org)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef EMBPERL
#include "../common/global_define.h"
#include "../common/eqemu_logsys.h"
#include "embxs.h"
#include "embperl.h"
#include "masterentity.h"
#include "command.h"
const char *getItemName(unsigned itemid)
{
const EQ::ItemData* item = nullptr;
item = database.GetItem(itemid);
if (item)
return item->Name;
else
return nullptr;
}
const char* Perl__qc_getItemName(unsigned itemid)
{
return getItemName(itemid); // possible nullptr return
}
#ifdef EMBPERL_IO_CAPTURE
XS(XS_EQEmuIO_PRINT); /* prototype to pass -Wmissing-prototypes */
XS(XS_EQEmuIO_PRINT)
{
dXSARGS;
if (items < 2)
return;
// Perl_croak(aTHX_ "Usage: EQEmuIO::PRINT(@strings)");
int r;
for (r = 1; r < items; r++) {
char *str = SvPV_nolen(ST(r));
char *cur = str;
/* Strip newlines from log message 'str' */
*std::remove(str, str + strlen(str), '\n') = '\0';
std::string log_string = str;
if (log_string.find("did not return a true") != std::string::npos) {
return;
}
if (log_string.find("is experimental") != std::string::npos) {
return;
}
int i;
int pos = 0;
int len = 0;
for (i = 0; *cur != '\0'; i++, cur++) {
if (*cur == '\n') {
LogQuests("{}", str);
len = 0;
pos = i + 1;
}
else {
len++;
}
}
if (!log_string.empty()) {
LogQuests("{}", log_string);
}
}
XSRETURN_EMPTY;
}
#endif //EMBPERL_IO_CAPTURE
#endif // EMBPERL

View File

@ -1,7 +0,0 @@
#ifndef EMBXS_H
#define EMBXS_H
const char *getItemName(unsigned itemid);
const char* Perl__qc_getItemName(unsigned itemid);
#endif // EMBXS_H