This commit is contained in:
aozhiwei 2022-03-21 20:15:17 +08:00
parent f55a658d77
commit 0f27c9f860
2 changed files with 10 additions and 3 deletions

View File

@ -25,11 +25,11 @@ class HandlerMgr : public a8::Singleton<HandlerMgr>
void ProcGMMsg(unsigned long saddr, int sockhandle,
const std::string& url, const std::string& quyerstr);
private:
void RegisterNetMsgHandlers();
void RegisterGMMsgHandler(const std::string& msgname,
void (*)(f8::JsonHttpRequest*));
private:
void RegisterNetMsgHandlers();
std::map<std::string, void (*)(f8::JsonHttpRequest*)> gmhandlers_;
};

View File

@ -6,6 +6,7 @@
#include "httpproxy.h"
#include "app.h"
#include "jsondatamgr.h"
#include "handlermgr.h"
#include "framework/cpp/httpclientpool.h"
@ -19,9 +20,15 @@ struct HttpProxyRequest
a8::XObject url_params;
};
static void _ProxyCallback(f8::JsonHttpRequest* request)
{
}
void HttpProxy::Init()
{
request_prefix_ = "game2006_" + a8::XValue(a8::GetMilliSecond()).GetString() + "_";
HandlerMgr::Instance()->RegisterGMMsgHandler("Proxy@callback", _ProxyCallback);
}
void HttpProxy::UnInit()