This commit is contained in:
aozhiwei 2019-04-28 15:32:45 +08:00
parent 8843d2320a
commit 8e849aff5b
2 changed files with 18 additions and 3 deletions

View File

@ -10,9 +10,14 @@ void JsonDataMgr::Init()
std::string gameserver_cluster_json_file; std::string gameserver_cluster_json_file;
if (!f8::IsOnlineEnv()) { if (!f8::IsOnlineEnv()) {
if (App::Instance()->flags.find(2) != App::Instance()->flags.end()) { if (App::Instance()->flags.find(2) != App::Instance()->flags.end()) {
gameserver_cluster_json_file = a8::Format("/root/pub/conf_test/game%d/gameserver/" gameserver_cluster_json_file = a8::Format("/root/pub/%d/%d/conf_test/game%d/gameserver/"
"game%d.gameserver.cluster.json", "game%d.gameserver.cluster.json",
{GAME_ID, GAME_ID}); {
GAME_ID,
App::Instance()->instance_id,
GAME_ID,
GAME_ID
});
} else { } else {
gameserver_cluster_json_file = a8::Format("/var/data/conf_test/game%d/gameserver/" gameserver_cluster_json_file = a8::Format("/var/data/conf_test/game%d/gameserver/"
"game%d.gameserver.cluster.json", "game%d.gameserver.cluster.json",

View File

@ -6,6 +6,7 @@
#include "framework/cpp/utils.h" #include "framework/cpp/utils.h"
#include "metamgr.h" #include "metamgr.h"
#include "app.h"
class MetaDataLoader class MetaDataLoader
{ {
@ -55,7 +56,16 @@ public:
void Load() void Load()
{ {
if (!f8::IsOnlineEnv()) { if (!f8::IsOnlineEnv()) {
res_path = a8::Format("/var/data/conf_test/game%d/gameserver/res/", {GAME_ID}); if (App::Instance()->flags.find(2) != App::Instance()->flags.end()) {
res_path = a8::Format("/root/pub/%d/%d/conf_test/game%d/gameserver/res/",
{
GAME_ID,
App::Instance()->instance_id,
GAME_ID
});
} else {
res_path = a8::Format("/var/data/conf_test/game%d/gameserver/res/", {GAME_ID});
}
} else { } else {
res_path = "../res/"; res_path = "../res/";
} }