51 lines
1.1 KiB
C++
51 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <a8/singleton.h>
|
|
|
|
#include <f8/app.h>
|
|
|
|
struct MsgNode;
|
|
class App : public a8::Singleton<App>, public f8::UserApp
|
|
{
|
|
private:
|
|
App() {};
|
|
friend class a8::Singleton<App>;
|
|
|
|
public:
|
|
|
|
virtual const std::string GetPkgName() override;
|
|
virtual void Init() override;
|
|
virtual void UnInit() override;
|
|
virtual void Update() override;
|
|
virtual bool HasTask() override;
|
|
|
|
void AddSocketMsg(SocketFrom_e sockfrom,
|
|
int sockhandle,
|
|
long ip_saddr,
|
|
unsigned short msgid,
|
|
unsigned int seqid,
|
|
const char *msgbody,
|
|
int bodylen);
|
|
|
|
private:
|
|
void QuickExecute();
|
|
void SlowerExecute();
|
|
|
|
void DispatchMsg();
|
|
|
|
void ProcessGameGateMsg(f8::MsgHdr& hdr);
|
|
|
|
public:
|
|
PerfMonitor perf;
|
|
|
|
private:
|
|
|
|
std::shared_ptr<std::mutex> msg_mutex_;
|
|
MsgNode* top_node_ = nullptr;
|
|
MsgNode* bot_node_ = nullptr;
|
|
MsgNode* work_node_ = nullptr;
|
|
|
|
int msgnode_size_ = 0 ;
|
|
int working_msgnode_size_ = 0;
|
|
};
|