From 70f0469b30fd751622a7819f06e7c77df157e1c3 Mon Sep 17 00:00:00 2001 From: azw Date: Fri, 29 Sep 2023 00:39:02 +0000 Subject: [PATCH] 1 --- server/wsproxy/jsondatamgr.cc | 17 +++++------------ server/wsproxy/jsondatamgr.h | 1 - 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/server/wsproxy/jsondatamgr.cc b/server/wsproxy/jsondatamgr.cc index 25b8542..268d22c 100644 --- a/server/wsproxy/jsondatamgr.cc +++ b/server/wsproxy/jsondatamgr.cc @@ -8,24 +8,17 @@ #include "jsondatamgr.h" #include "app.h" +static const char* WORK_PATH = "../config"; + void JsonDataMgr::Init() { - if (!f8::IsOnlineEnv()) { - work_path_ = a8::Format - ("../../../conf_test/game%d/%s", - { - GAME_ID, - f8::IsTestEnv() ? "wsproxy.test" : "wsproxy.dev" - }); - } - 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/game%d.wsproxy.cluster.json", { - work_path_, + WORK_PATH, f8::App::Instance()->GetZoneId(), f8::App::Instance()->GetNodeId(), GAME_ID @@ -33,7 +26,7 @@ void JsonDataMgr::Init() master_cluster_json_file = a8::Format ("%s/zone%d/node%d/game%d.masterserver.cluster.json", { - work_path_, + WORK_PATH, f8::App::Instance()->GetZoneId(), f8::App::Instance()->GetNodeId(), GAME_ID @@ -41,7 +34,7 @@ void JsonDataMgr::Init() kcp_conf_json_file = a8::Format ("%s/zone%d/kcp_conf.json", { - work_path_, + WORK_PATH, f8::App::Instance()->GetZoneId(), }); diff --git a/server/wsproxy/jsondatamgr.h b/server/wsproxy/jsondatamgr.h index a2bc1b6..6986fcb 100644 --- a/server/wsproxy/jsondatamgr.h +++ b/server/wsproxy/jsondatamgr.h @@ -36,7 +36,6 @@ class JsonDataMgr : public a8::Singleton 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_;