From 25bd285be567990eaebe5619ceaae10122e15eaf Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 23 Dec 2019 02:08:51 -0600 Subject: [PATCH] World entrypoint rename --- world/CMakeLists.txt | 2 +- world/{net.cpp => main.cpp} | 83 ++++++++++++------------------------- world/{net.h => main.h} | 0 3 files changed, 28 insertions(+), 57 deletions(-) rename world/{net.cpp => main.cpp} (87%) rename world/{net.h => main.h} (100%) diff --git a/world/CMakeLists.txt b/world/CMakeLists.txt index e60b3d666..9906b0cfc 100644 --- a/world/CMakeLists.txt +++ b/world/CMakeLists.txt @@ -14,7 +14,7 @@ SET(world_sources lfplist.cpp login_server.cpp login_server_list.cpp - net.cpp + main.cpp queryserv.cpp ucs.cpp web_interface.cpp diff --git a/world/net.cpp b/world/main.cpp similarity index 87% rename from world/net.cpp rename to world/main.cpp index 13f824583..07fb46d67 100644 --- a/world/net.cpp +++ b/world/main.cpp @@ -1,20 +1,23 @@ -/* EQEMu: Everquest Server Emulator -Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org) +/** + * EQEmulator: Everquest Server Emulator + * Copyright (C) 2001-2019 EQEmulator Development Team (https://github.com/EQEmu/Server) + * + * 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 + * + */ -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 -*/ #include "../common/global_define.h" #include @@ -189,6 +192,13 @@ void RegisterLoginservers() } } +/** + * World process entrypoint + * + * @param argc + * @param argv + * @return + */ int main(int argc, char** argv) { RegisterExecutablePlatform(ExePlatformWorld); LogSys.LoadLogSettingsDefaults(); @@ -268,39 +278,7 @@ int main(int argc, char** argv) { */ bool ignore_db = false; if (argc >= 2) { - std::string tmp; - if (strcasecmp(argv[1], "help") == 0 || strcasecmp(argv[1], "?") == 0 || strcasecmp(argv[1], "/?") == 0 || strcasecmp(argv[1], "-?") == 0 || strcasecmp(argv[1], "-h") == 0 || strcasecmp(argv[1], "-help") == 0) { - std::cout << "Worldserver command line commands:" << std::endl; - std::cout << "adduser username password flag - adds a user account" << std::endl; - std::cout << "flag username flag - sets GM flag on the account" << std::endl; - std::cout << "startzone zoneshortname - sets the starting zone" << std::endl; - std::cout << "-holdzones - reboots lost zones" << std::endl; - return 0; - } - else if (strcasecmp(argv[1], "-holdzones") == 0) { - std::cout << "Reboot Zones mode ON" << std::endl; - holdzones = true; - } - else if (strcasecmp(argv[1], "flag") == 0) { - if (argc == 4) { - if (Seperator::IsNumber(argv[3])) { - if (atoi(argv[3]) >= 0 && atoi(argv[3]) <= 255) { - if (database.SetAccountStatus(argv[2], atoi(argv[3]))) { - std::cout << "Account flagged: Username='" << argv[2] << "', status=" << argv[3] << std::endl; - return 0; - } - else { - std::cerr << "database.SetAccountStatus failed." << std::endl; - return 1; - } - } - } - } - std::cout << "Usage: world flag username flag" << std::endl; - std::cout << "flag = 0-200" << std::endl; - return 0; - } - else if (strcasecmp(argv[1], "ignore_db") == 0) { + if (strcasecmp(argv[1], "ignore_db") == 0) { ignore_db = true; } else { @@ -399,13 +377,6 @@ int main(int argc, char** argv) { LogInfo("Loading launcher list"); launcher_list.LoadList(); - std::string tmp; - database.GetVariable("holdzones", tmp); - if (tmp.length() == 1 && tmp[0] == '1') { - holdzones = true; - } - LogInfo("Reboot zone modes [{}]", holdzones ? "ON" : "OFF"); - LogInfo("Deleted [{}] stale player corpses from database", database.DeleteStalePlayerCorpses()); LogInfo("Loading adventures"); diff --git a/world/net.h b/world/main.h similarity index 100% rename from world/net.h rename to world/main.h