1
This commit is contained in:
parent
0b91fa9442
commit
13d3e87cd0
@ -5,18 +5,18 @@
|
||||
|
||||
void JsonDataMgr::Init()
|
||||
{
|
||||
std::string wsproxyserver_cluster_json_file;
|
||||
std::string payserverserver_cluster_json_file;
|
||||
std::string targetserver_cluster_json_file;
|
||||
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});
|
||||
} 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});
|
||||
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});
|
||||
}
|
||||
wsproxyserver_cluster_json_.ReadFromFile(wsproxyserver_cluster_json_file);
|
||||
payserverserver_cluster_json_.ReadFromFile(payserverserver_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()
|
||||
{
|
||||
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();
|
||||
}
|
||||
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()
|
||||
|
@ -14,7 +14,7 @@ class JsonDataMgr : public a8::Singleton<JsonDataMgr>
|
||||
std::shared_ptr<a8::XObject> GetTargetServerClusterConf();
|
||||
|
||||
private:
|
||||
a8::XObject wsproxyserver_cluster_json_;
|
||||
a8::XObject payserverserver_cluster_json_;
|
||||
a8::XObject targetserver_cluster_json_;
|
||||
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user