37 lines
773 B
C++
37 lines
773 B
C++
#pragma once
|
|
|
|
#include <a8/singleton.h>
|
|
|
|
class JsonDataMgr : public a8::Singleton<JsonDataMgr>
|
|
{
|
|
private:
|
|
JsonDataMgr() {};
|
|
friend class a8::Singleton<JsonDataMgr>;
|
|
|
|
public:
|
|
void Init();
|
|
void UnInit();
|
|
|
|
std::shared_ptr<a8::XObject> GetConf();
|
|
std::shared_ptr<a8::XObject> GetMasterServerClusterConf();
|
|
|
|
std::string ip;
|
|
int listen_port = 0;
|
|
int channel = 0;
|
|
std::string server_info;
|
|
|
|
void Reload();
|
|
void GetApiUrl(std::string& url);
|
|
void GetHttpProxyUrl(std::string& url);
|
|
|
|
private:
|
|
std::string api_url_;
|
|
|
|
private:
|
|
std::string work_path_ = "../config";
|
|
a8::XObject setting_json_;
|
|
a8::XObject gameserver_cluster_json_;
|
|
a8::XObject masterserver_cluster_json_;
|
|
a8::XObject httpproxy_cluster_json_;
|
|
};
|