diff --git a/server/gameserver/app.cc b/server/gameserver/app.cc index 4ca1d481..57a97e63 100644 --- a/server/gameserver/app.cc +++ b/server/gameserver/app.cc @@ -25,6 +25,7 @@ #include "entityfactory.h" #include "perfmonitor.h" #include "killmgr.h" +#include "httpproxy.h" #include "ss_msgid.pb.h" #include "ss_proto.pb.h" @@ -211,6 +212,7 @@ bool App::Init(int argc, char* argv[]) MapMgr::Instance()->Init(); PlayerMgr::Instance()->Init(); GGListener::Instance()->Init(); + HttpProxy::Instance()->Init(); a8::UdpLog::Instance()->Info("gameserver starting instance_id:%d pid:%d debug_mode:%d channel:%d", { @@ -243,6 +245,7 @@ bool App::Init(int argc, char* argv[]) void App::UnInit() { + HttpProxy::Instance()->UnInit(); GGListener::Instance()->UnInit(); PlayerMgr::Instance()->UnInit(); MapMgr::Instance()->UnInit(); diff --git a/server/gameserver/httpproxy.cc b/server/gameserver/httpproxy.cc new file mode 100644 index 00000000..6da83e60 --- /dev/null +++ b/server/gameserver/httpproxy.cc @@ -0,0 +1,23 @@ +#include "precompile.h" + +#include "httpproxy.h" + +void HttpProxy::Init() +{ + +} + +void HttpProxy::UnInit() +{ + +} + +void HttpProxy::HttpGet(a8::XParams param, + f8::AsyncHttpOnOkFunc on_ok, + f8::AsyncHttpOnErrorFunc on_error, + const char* url, + a8::XObject url_params + ) +{ + +} diff --git a/server/gameserver/httpproxy.h b/server/gameserver/httpproxy.h new file mode 100644 index 00000000..6158aebf --- /dev/null +++ b/server/gameserver/httpproxy.h @@ -0,0 +1,27 @@ +#pragma once + +#include "framework/cpp/httpclientpool.h" + +class HttpProxy : public a8::Singleton +{ + + private: + HttpProxy() {}; + friend class a8::Singleton; + + public: + + void Init(); + void UnInit(); + + void HttpGet(a8::XParams param, + f8::AsyncHttpOnOkFunc on_ok, + f8::AsyncHttpOnErrorFunc on_error, + const char* url, + a8::XObject url_params + ); + + private: + std::map get_hash_; + +}; diff --git a/server/gameserver/roommgr.cc b/server/gameserver/roommgr.cc index e1827aa4..8f2aae2e 100644 --- a/server/gameserver/roommgr.cc +++ b/server/gameserver/roommgr.cc @@ -24,6 +24,12 @@ const int ROOM_NUM_UP_LIMIT = 1000; const int HUM_NUM_DOWN_LIMIT = 2500; +struct JoinRequest +{ + int socket_handle = 0; + cs::CMJoin msg; +}; + static RoomType_e GetHumanRoomType(const cs::CMJoin& msg, int& game_times) { #if 1 @@ -147,6 +153,7 @@ void RoomMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg) MatchMgr::Instance()->_CMJoin(hdr, msg); return; } + int game_times = 0; RoomType_e self_room_type = GetHumanRoomType(msg, game_times); if (self_room_type < RT_OldBrid1) { diff --git a/server/gameserver/roommgr.h b/server/gameserver/roommgr.h index 8680ca15..80a6ddfe 100644 --- a/server/gameserver/roommgr.h +++ b/server/gameserver/roommgr.h @@ -14,6 +14,7 @@ namespace MetaData struct MapTplThing; } +struct JoinRequest; class GridService; class MapService; class MapInstance; @@ -109,4 +110,5 @@ class RoomMgr : public a8::Singleton a8::TimerAttacher reportstate_timer_attacher_; std::map gm_hash_; std::map> team_room_hash_; + std::map join_request_hash_; };