[File Paths] Implement Path Manager (#2440)

* Push up branch for testing

* Path manager

* Tweaks

* Changes

* More path work

* Update paths for eqemu_server.pl

* More path work

* Import and export client files

* Path remove

* More path work

* Update eqemu_config.h

* Fix tests

* Tests disable temp

* Update eqemu_config.h

* Update .drone.yml

* Hook tests back up

* Update main.cpp

* Platform tests

* Fix include

* Use std::filesystem on windows

* Fix IPCMutex name on windows

* std::filesystem changes

* Update path_manager.cpp

* Explicit string cast

* Explicit string cast

* Update path_manager.cpp

* Windows fixes

* Mapped files

* Relative fixes

* Use relative paths off of cwd

* Update Debian image to Debian 11 (updates GCC)

Co-authored-by: hg <4683435+hgtw@users.noreply.github.com>
This commit is contained in:
Chris Miles
2022-09-28 04:08:59 -05:00
committed by GitHub
parent 19791195e5
commit f8e7576ae7
53 changed files with 641 additions and 502 deletions
+6 -2
View File
@@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "clientlist.h"
#include "database.h"
#include "chatchannel.h"
#include "../common/path_manager.h"
#include <list>
#include <vector>
@@ -478,8 +479,11 @@ Clientlist::Clientlist(int ChatPort) {
const ucsconfig *Config = ucsconfig::get();
LogInfo("Loading [{}]", Config->MailOpCodesFile.c_str());
if (!ChatOpMgr->LoadOpcodes(Config->MailOpCodesFile.c_str()))
std::string opcodes_file = fmt::format("{}/{}", path.GetServerPath(), Config->MailOpCodesFile);
LogInfo("Loading [{}]", opcodes_file);
if (!ChatOpMgr->LoadOpcodes(opcodes_file.c_str()))
exit(1);
chatsf->OnNewConnection([this](std::shared_ptr<EQ::Net::EQStream> stream) {
+5
View File
@@ -38,6 +38,7 @@
#include "../common/net/tcp_server.h"
#include "../common/net/servertalk_client_connection.h"
#include "../common/discord_manager.h"
#include "../common/path_manager.h"
ChatChannelList *ChannelList;
Clientlist *g_Clientlist;
@@ -45,6 +46,7 @@ EQEmuLogSys LogSys;
Database database;
WorldServer *worldserver = nullptr;
DiscordManager discord_manager;
PathManager path;
const ucsconfig *Config;
@@ -101,6 +103,8 @@ int main() {
LogSys.LoadLogSettingsDefaults();
set_exception_handler();
path.LoadPaths();
// Check every minute for unused channels we can delete
//
Timer ChannelListProcessTimer(60000);
@@ -132,6 +136,7 @@ int main() {
}
LogSys.SetDatabase(&database)
->SetLogPath(path.GetLogPath())
->LoadLogDatabaseSettings()
->StartFileLogs();
+2 -2
View File
@@ -40,13 +40,13 @@ public:
}
// Load the config
static bool LoadConfig() {
static bool LoadConfig(const std::string& path = "") {
if (_chat_config != nullptr)
delete _chat_config;
_chat_config=new ucsconfig;
_config=_chat_config;
return _config->parseFile();
return _config->parseFile(path);
}
};