This commit is contained in:
aozhiwei 2019-03-26 11:11:15 +08:00
parent 0b91fa9442
commit 13d3e87cd0
2 changed files with 8 additions and 8 deletions

View File

@ -5,18 +5,18 @@
void JsonDataMgr::Init() void JsonDataMgr::Init()
{ {
std::string wsproxyserver_cluster_json_file; std::string payserverserver_cluster_json_file;
std::string targetserver_cluster_json_file; std::string targetserver_cluster_json_file;
if (f8::IsOnlineEnv()) { if (f8::IsOnlineEnv()) {
wsproxyserver_cluster_json_file = a8::Format("../config/game%d.wsproxy.cluster.json", {GAME_ID}); payserverserver_cluster_json_file = a8::Format("../config/game%d.payserver.cluster.json", {GAME_ID});
targetserver_cluster_json_file = a8::Format("../config/game%d.gameserver.cluster.json", {GAME_ID}); targetserver_cluster_json_file = a8::Format("../config/game%d.gameserver.cluster.json", {GAME_ID});
} else { } else {
wsproxyserver_cluster_json_file = a8::Format("/var/data/conf_test/game%d/wsproxy/game%d.wsproxy.cluster.json", payserverserver_cluster_json_file = a8::Format("/var/data/conf_test/game%d/payserver/game%d.payserver.cluster.json",
{GAME_ID, GAME_ID}); {GAME_ID, GAME_ID});
targetserver_cluster_json_file = a8::Format("/var/data/conf_test/game%d/wsproxy/game%d.gameserver.cluster.json", targetserver_cluster_json_file = a8::Format("/var/data/conf_test/game%d/payserver/game%d.gameserver.cluster.json",
{GAME_ID, GAME_ID}); {GAME_ID, GAME_ID});
} }
wsproxyserver_cluster_json_.ReadFromFile(wsproxyserver_cluster_json_file); payserverserver_cluster_json_.ReadFromFile(payserverserver_cluster_json_file);
targetserver_cluster_json_.ReadFromFile(targetserver_cluster_json_file); targetserver_cluster_json_.ReadFromFile(targetserver_cluster_json_file);
} }
@ -26,10 +26,10 @@ void JsonDataMgr::UnInit()
std::shared_ptr<a8::XObject> JsonDataMgr::GetConf() std::shared_ptr<a8::XObject> JsonDataMgr::GetConf()
{ {
if (App::Instance()->instance_id < 1 || App::Instance()->instance_id > wsproxyserver_cluster_json_.Size()) { if (App::Instance()->instance_id < 1 || App::Instance()->instance_id > payserverserver_cluster_json_.Size()) {
abort(); abort();
} }
return wsproxyserver_cluster_json_[App::Instance()->instance_id - 1]; return payserverserver_cluster_json_[App::Instance()->instance_id - 1];
} }
std::shared_ptr<a8::XObject> JsonDataMgr::GetTargetServerClusterConf() std::shared_ptr<a8::XObject> JsonDataMgr::GetTargetServerClusterConf()

View File

@ -14,7 +14,7 @@ class JsonDataMgr : public a8::Singleton<JsonDataMgr>
std::shared_ptr<a8::XObject> GetTargetServerClusterConf(); std::shared_ptr<a8::XObject> GetTargetServerClusterConf();
private: private:
a8::XObject wsproxyserver_cluster_json_; a8::XObject payserverserver_cluster_json_;
a8::XObject targetserver_cluster_json_; a8::XObject targetserver_cluster_json_;
}; };