1
This commit is contained in:
parent
128796e486
commit
816b1aedf2
@ -8,31 +8,37 @@
|
||||
#include "jsondatamgr.h"
|
||||
#include "app.h"
|
||||
|
||||
static const char* WORK_PATH = "../config";
|
||||
|
||||
void JsonDataMgr::Init()
|
||||
{
|
||||
if (!f8::IsOnlineEnv()) {
|
||||
if (f8::IsTestEnv()) {
|
||||
work_path_ = a8::Format("../%d_test_config", {GAME_ID});
|
||||
} else {
|
||||
work_path_ = a8::Format("../%d_dev_config", {GAME_ID});
|
||||
}
|
||||
}
|
||||
|
||||
std::string wsproxy_cluster_json_file;
|
||||
std::string master_cluster_json_file;
|
||||
std::string kcp_conf_json_file;
|
||||
wsproxy_cluster_json_file = a8::Format
|
||||
("%s/zone%d/node%d/wsproxy.cluster.json",
|
||||
{
|
||||
WORK_PATH,
|
||||
work_path_,
|
||||
f8::App::Instance()->GetZoneId(),
|
||||
f8::App::Instance()->GetNodeId()
|
||||
});
|
||||
master_cluster_json_file = a8::Format
|
||||
("%s/zone%d/node%d/masterserver.cluster.json",
|
||||
{
|
||||
WORK_PATH,
|
||||
work_path_,
|
||||
f8::App::Instance()->GetZoneId(),
|
||||
f8::App::Instance()->GetNodeId(),
|
||||
});
|
||||
kcp_conf_json_file = a8::Format
|
||||
("%s/zone%d/node%d/kcp_conf.json",
|
||||
{
|
||||
WORK_PATH,
|
||||
work_path_,
|
||||
f8::App::Instance()->GetZoneId(),
|
||||
f8::App::Instance()->GetNodeId(),
|
||||
});
|
||||
|
@ -36,6 +36,7 @@ class JsonDataMgr : public a8::Singleton<JsonDataMgr>
|
||||
void SetKcpSwitch(int is_open);
|
||||
|
||||
private:
|
||||
std::string work_path_ = "../config";
|
||||
a8::XObject wsproxy_cluster_json_;
|
||||
a8::XObject master_cluster_json_;
|
||||
a8::XObject kcp_conf_json_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user