mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-06 23:15:18 +00:00
split rpcs3 and hle libraries
merge rpcs3 utilities
This commit is contained in:
parent
b33e2662b6
commit
62ad27d1e2
1233 changed files with 7004 additions and 3819 deletions
66
rpcs3/Emu/IPC_config.cpp
Normal file
66
rpcs3/Emu/IPC_config.cpp
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
#include "stdafx.h"
|
||||
#include "IPC_config.h"
|
||||
|
||||
cfg_ipc g_cfg_ipc;
|
||||
|
||||
LOG_CHANNEL(IPC);
|
||||
|
||||
void cfg_ipc::load()
|
||||
{
|
||||
const std::string path = cfg_ipc::get_path();
|
||||
|
||||
fs::file cfg_file(path, fs::read);
|
||||
if (cfg_file)
|
||||
{
|
||||
IPC.notice("Loading IPC config. Path: %s", path);
|
||||
from_string(cfg_file.to_string());
|
||||
}
|
||||
else
|
||||
{
|
||||
IPC.notice("IPC config missing. Using default settings. Path: %s", path);
|
||||
from_default();
|
||||
}
|
||||
}
|
||||
|
||||
void cfg_ipc::save() const
|
||||
{
|
||||
#ifdef _WIN32
|
||||
const std::string path_to_cfg = fs::get_config_dir(true);
|
||||
if (!fs::create_path(path_to_cfg))
|
||||
{
|
||||
IPC.error("Could not create path: %s", path_to_cfg);
|
||||
}
|
||||
#endif
|
||||
|
||||
const std::string path = cfg_ipc::get_path();
|
||||
|
||||
if (!cfg::node::save(path))
|
||||
{
|
||||
IPC.error("Could not save config: %s (error=%s)", path, fs::g_tls_error);
|
||||
}
|
||||
}
|
||||
|
||||
std::string cfg_ipc::get_path()
|
||||
{
|
||||
return fs::get_config_dir(true) + "ipc.yml";
|
||||
}
|
||||
|
||||
bool cfg_ipc::get_server_enabled() const
|
||||
{
|
||||
return ipc_server_enabled.get();
|
||||
}
|
||||
|
||||
int cfg_ipc::get_port() const
|
||||
{
|
||||
return ipc_port;
|
||||
}
|
||||
|
||||
void cfg_ipc::set_server_enabled(const bool enabled)
|
||||
{
|
||||
this->ipc_server_enabled.set(enabled);
|
||||
}
|
||||
|
||||
void cfg_ipc::set_port(const int port)
|
||||
{
|
||||
this->ipc_port.set(port);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue