mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 15:58:36 +00:00
[Deprecation] Remove eqemu_server.pl script and ties to server (#4049)
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user