diff --git a/server/gameserver/handlermgr.h b/server/gameserver/handlermgr.h index 2bf21b87..e6cb7ec6 100644 --- a/server/gameserver/handlermgr.h +++ b/server/gameserver/handlermgr.h @@ -25,11 +25,11 @@ class HandlerMgr : public a8::Singleton 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 gmhandlers_; }; diff --git a/server/gameserver/httpproxy.cc b/server/gameserver/httpproxy.cc index 2c8cde82..61634e5d 100644 --- a/server/gameserver/httpproxy.cc +++ b/server/gameserver/httpproxy.cc @@ -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()