1
This commit is contained in:
parent
30a40e2149
commit
099ae65ac8
@ -36,6 +36,7 @@
|
||||
#include "framework/cpp/msgqueue.h"
|
||||
#include "framework/cpp/tglog.h"
|
||||
#include "framework/cpp/netmsghandler.h"
|
||||
#include "framework/cpp/httpclientpool.h"
|
||||
|
||||
struct MsgNode
|
||||
{
|
||||
@ -93,6 +94,7 @@ bool App::Init(int argc, char* argv[])
|
||||
PerfMonitor::Instance()->Init();
|
||||
f8::MsgQueue::Instance()->Init();
|
||||
f8::TGLog::Instance()->Init(a8::Format(PROJ_NAME_FMT, {GAME_ID}), true);
|
||||
f8::HttpClientPool::Instance()->Init(MAX_ALL_HTTP_NUM, MAX_SYS_HTTP_NUM, MAX_USER_HTTP_NUM);
|
||||
GameLog::Instance()->Init();
|
||||
a8::IoLoop::Instance()->Init(1);
|
||||
JsonDataMgr::Instance()->Init();
|
||||
@ -154,6 +156,7 @@ void App::UnInit()
|
||||
IMConnMgr::Instance()->UnInit();
|
||||
MSConnMgr::Instance()->UnInit();
|
||||
JsonDataMgr::Instance()->UnInit();
|
||||
f8::HttpClientPool::Instance()->UnInit();
|
||||
a8::IoLoop::Instance()->UnInit();
|
||||
GameLog::Instance()->UnInit();
|
||||
f8::TGLog::Instance()->UnInit();
|
||||
|
@ -73,3 +73,7 @@ const int DAILY_APPLY_FRIEND_TIMES = 100;
|
||||
const int SYS_RESET_TIME = 2*60; //每日两点重置
|
||||
|
||||
const int SERVER_INTERNAL_ERROR = 100;
|
||||
|
||||
const int MAX_SYS_HTTP_NUM = 2;
|
||||
const int MAX_USER_HTTP_NUM = 8;
|
||||
const int MAX_ALL_HTTP_NUM = MAX_SYS_HTTP_NUM + MAX_USER_HTTP_NUM;
|
||||
|
@ -11,6 +11,8 @@
|
||||
#include "asynctaskmgr.h"
|
||||
#include "dbengine.h"
|
||||
|
||||
#include "framework/cpp/httpclientpool.h"
|
||||
|
||||
class AsyncGuildTask
|
||||
{
|
||||
public:
|
||||
|
@ -73,3 +73,12 @@ std::shared_ptr<a8::XObject> JsonDataMgr::GetMysqlClusterConf()
|
||||
{
|
||||
return std::make_shared<a8::XObject>(mysql_cluster_json_);
|
||||
}
|
||||
|
||||
bool JsonDataMgr::GetRankServerConf(std::string& ip, int& port)
|
||||
{
|
||||
std::shared_ptr<a8::XObject> rankserver_cluster_conf = GetMasterServerClusterConf();
|
||||
std::shared_ptr<a8::XObject> conf = rankserver_cluster_conf->At(0);
|
||||
ip = conf->At("rankserver_ip")->AsXValue().GetString();
|
||||
port = conf->At("rankserver_ip")->AsXValue();
|
||||
return true;
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ class JsonDataMgr : public a8::Singleton<JsonDataMgr>
|
||||
std::shared_ptr<a8::XObject> GetMasterServerClusterConf();
|
||||
std::shared_ptr<a8::XObject> GetRankServerClusterConf();
|
||||
std::shared_ptr<a8::XObject> GetMysqlClusterConf();
|
||||
bool GetRankServerConf(std::string& ip, int& port);
|
||||
|
||||
private:
|
||||
std::string work_path_ = "../config";
|
||||
|
Loading…
x
Reference in New Issue
Block a user