[Deprecation] Remove eqemu_server.pl script and ties to server (#4049)

This commit is contained in:
Chris Miles 2024-02-10 03:22:18 -06:00 committed by GitHub
parent 14d4a2610f
commit b280f50c99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 0 additions and 1792 deletions

File diff suppressed because it is too large Load Diff

View File

@ -142,8 +142,6 @@ int main(int argc, char **argv)
return 0;
}
WorldBoot::CheckForXMLConfigUpgrade();
Config = WorldConfig::get();
LogInfo("CURRENT_VERSION [{}]", CURRENT_VERSION);

View File

@ -175,66 +175,6 @@ int get_file_size(const std::string &filename) // path to file
return size;
}
void WorldBoot::CheckForServerScript(bool force_download)
{
const std::string file = fmt::format("{}/eqemu_server.pl", path.GetServerPath());
std::ifstream f(file);
/* Fetch EQEmu Server script */
if (!f || get_file_size(file) < 100 || force_download) {
if (force_download) {
std::remove(fmt::format("{}/eqemu_server.pl", path.GetServerPath()).c_str());
} /* Delete local before fetch */
std::cout << "Pulling down EQEmu Server Maintenance Script (eqemu_server.pl)..." << std::endl;
// http get request
uri u("https://raw.githubusercontent.com/EQEmu/Server/master/utils/scripts/eqemu_server.pl");
httplib::Client r(
fmt::format(
"{}://{}",
u.get_scheme(),
u.get_host()
).c_str()
);
r.set_connection_timeout(1, 0);
r.set_read_timeout(1, 0);
r.set_write_timeout(1, 0);
if (auto res = r.Get(u.get_path())) {
if (res->status == 200) {
// write file
std::string script = fmt::format("{}/eqemu_server.pl", path.GetServerPath());
std::ofstream out(script);
out << res->body;
out.close();
#ifdef _WIN32
#else
system(fmt::format("chmod 755 {}", script).c_str());
system(fmt::format("chmod +x {}", script).c_str());
#endif
}
}
}
}
void WorldBoot::CheckForXMLConfigUpgrade()
{
if (!std::ifstream("eqemu_config.json") && std::ifstream("eqemu_config.xml")) {
CheckForServerScript(true);
std::string command = fmt::format("perl {}/eqemu_server.pl convert_xml", path.GetServerPath());
if (system(command.c_str())) {}
}
else {
CheckForServerScript();
}
}
extern LoginServerList loginserverlist;
void WorldBoot::RegisterLoginservers()

View File

@ -13,8 +13,6 @@ public:
static bool HandleCommandInput(int argc, char **argv);
static bool LoadServerConfig();
static bool LoadDatabaseConnections();
static void CheckForServerScript(bool force_download = false);
static void CheckForXMLConfigUpgrade();
static void RegisterLoginservers();
static bool DatabaseLoadRoutines(int argc, char **argv);
static void CheckForPossibleConfigurationIssues();