mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 10:31:29 +00:00
[Deprecation] Remove eqemu_server.pl script and ties to server (#4049)
This commit is contained in:
parent
14d4a2610f
commit
b280f50c99
File diff suppressed because it is too large
Load Diff
@ -142,8 +142,6 @@ int main(int argc, char **argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
WorldBoot::CheckForXMLConfigUpgrade();
|
||||
|
||||
Config = WorldConfig::get();
|
||||
|
||||
LogInfo("CURRENT_VERSION [{}]", CURRENT_VERSION);
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user