1
This commit is contained in:
parent
755fd5dcd0
commit
a1a58f1dee
@ -19,6 +19,7 @@
|
|||||||
#include "handlermgr.h"
|
#include "handlermgr.h"
|
||||||
#include "httpproxy.h"
|
#include "httpproxy.h"
|
||||||
#include "playermgr.h"
|
#include "playermgr.h"
|
||||||
|
#include "comgr.h"
|
||||||
|
|
||||||
#include "ss_msgid.pb.h"
|
#include "ss_msgid.pb.h"
|
||||||
#include "ss_proto.pb.h"
|
#include "ss_proto.pb.h"
|
||||||
@ -89,6 +90,7 @@ bool App::Init(int argc, char* argv[])
|
|||||||
HandlerMgr::Instance()->Init();
|
HandlerMgr::Instance()->Init();
|
||||||
f8::Timer::Instance()->Init();
|
f8::Timer::Instance()->Init();
|
||||||
f8::TGLog::Instance()->Init(a8::Format(PROJ_NAME_FMT, {GAME_ID}), false, 0);
|
f8::TGLog::Instance()->Init(a8::Format(PROJ_NAME_FMT, {GAME_ID}), false, 0);
|
||||||
|
CoMgr::Instance()->Init();
|
||||||
f8::HttpClientPool::Instance()->Init(MAX_ALL_HTTP_NUM, MAX_SYS_HTTP_NUM, MAX_USER_HTTP_NUM);
|
f8::HttpClientPool::Instance()->Init(MAX_ALL_HTTP_NUM, MAX_SYS_HTTP_NUM, MAX_USER_HTTP_NUM);
|
||||||
f8::BtMgr::Instance()->Init("exported");
|
f8::BtMgr::Instance()->Init("exported");
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@ -132,6 +134,7 @@ void App::UnInit()
|
|||||||
f8::BtMgr::Instance()->UnInit();
|
f8::BtMgr::Instance()->UnInit();
|
||||||
f8::HttpClientPool::Instance()->UnInit();
|
f8::HttpClientPool::Instance()->UnInit();
|
||||||
HandlerMgr::Instance()->UnInit();
|
HandlerMgr::Instance()->UnInit();
|
||||||
|
CoMgr::Instance()->UnInit();
|
||||||
f8::MsgQueue::Instance()->UnInit();
|
f8::MsgQueue::Instance()->UnInit();
|
||||||
f8::Timer::Instance()->UnInit();
|
f8::Timer::Instance()->UnInit();
|
||||||
f8::TGLog::Instance()->UnInit();
|
f8::TGLog::Instance()->UnInit();
|
||||||
@ -203,6 +206,7 @@ void App::QuickExecute(int delta_time)
|
|||||||
|
|
||||||
void App::SlowerExecute(int delta_time)
|
void App::SlowerExecute(int delta_time)
|
||||||
{
|
{
|
||||||
|
CoMgr::Instance()->Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::NotifyLoopCond()
|
void App::NotifyLoopCond()
|
||||||
|
@ -20,3 +20,8 @@ void CoMgr::Update()
|
|||||||
co->Exec();
|
co->Exec();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::weak_ptr<Coroutine> CoMgr::CreateCoroutine(std::function<void(Coroutine*)> cb)
|
||||||
|
{
|
||||||
|
return std::make_shared<Coroutine>(cb);
|
||||||
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include <a8/singleton.h>
|
#include <a8/singleton.h>
|
||||||
|
|
||||||
|
class Coroutine;
|
||||||
class CoMgr : public a8::Singleton<CoMgr>
|
class CoMgr : public a8::Singleton<CoMgr>
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -15,6 +16,8 @@ class CoMgr : public a8::Singleton<CoMgr>
|
|||||||
void UnInit();
|
void UnInit();
|
||||||
void Update();
|
void Update();
|
||||||
|
|
||||||
|
std::weak_ptr<Coroutine> CreateCoroutine(std::function<void(Coroutine*)> cb);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
list_head co_list_;
|
list_head co_list_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user