1
This commit is contained in:
parent
845c847496
commit
72ae5463c3
@ -25,6 +25,7 @@
|
|||||||
#include "entityfactory.h"
|
#include "entityfactory.h"
|
||||||
#include "perfmonitor.h"
|
#include "perfmonitor.h"
|
||||||
#include "killmgr.h"
|
#include "killmgr.h"
|
||||||
|
#include "httpproxy.h"
|
||||||
|
|
||||||
#include "ss_msgid.pb.h"
|
#include "ss_msgid.pb.h"
|
||||||
#include "ss_proto.pb.h"
|
#include "ss_proto.pb.h"
|
||||||
@ -211,6 +212,7 @@ bool App::Init(int argc, char* argv[])
|
|||||||
MapMgr::Instance()->Init();
|
MapMgr::Instance()->Init();
|
||||||
PlayerMgr::Instance()->Init();
|
PlayerMgr::Instance()->Init();
|
||||||
GGListener::Instance()->Init();
|
GGListener::Instance()->Init();
|
||||||
|
HttpProxy::Instance()->Init();
|
||||||
|
|
||||||
a8::UdpLog::Instance()->Info("gameserver starting instance_id:%d pid:%d debug_mode:%d channel:%d",
|
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()
|
void App::UnInit()
|
||||||
{
|
{
|
||||||
|
HttpProxy::Instance()->UnInit();
|
||||||
GGListener::Instance()->UnInit();
|
GGListener::Instance()->UnInit();
|
||||||
PlayerMgr::Instance()->UnInit();
|
PlayerMgr::Instance()->UnInit();
|
||||||
MapMgr::Instance()->UnInit();
|
MapMgr::Instance()->UnInit();
|
||||||
|
23
server/gameserver/httpproxy.cc
Normal file
23
server/gameserver/httpproxy.cc
Normal file
@ -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
|
||||||
|
)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
27
server/gameserver/httpproxy.h
Normal file
27
server/gameserver/httpproxy.h
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "framework/cpp/httpclientpool.h"
|
||||||
|
|
||||||
|
class HttpProxy : public a8::Singleton<HttpProxy>
|
||||||
|
{
|
||||||
|
|
||||||
|
private:
|
||||||
|
HttpProxy() {};
|
||||||
|
friend class a8::Singleton<HttpProxy>;
|
||||||
|
|
||||||
|
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<std::string, a8::XParams> get_hash_;
|
||||||
|
|
||||||
|
};
|
@ -24,6 +24,12 @@
|
|||||||
const int ROOM_NUM_UP_LIMIT = 1000;
|
const int ROOM_NUM_UP_LIMIT = 1000;
|
||||||
const int HUM_NUM_DOWN_LIMIT = 2500;
|
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)
|
static RoomType_e GetHumanRoomType(const cs::CMJoin& msg, int& game_times)
|
||||||
{
|
{
|
||||||
#if 1
|
#if 1
|
||||||
@ -147,6 +153,7 @@ void RoomMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg)
|
|||||||
MatchMgr::Instance()->_CMJoin(hdr, msg);
|
MatchMgr::Instance()->_CMJoin(hdr, msg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int game_times = 0;
|
int game_times = 0;
|
||||||
RoomType_e self_room_type = GetHumanRoomType(msg, game_times);
|
RoomType_e self_room_type = GetHumanRoomType(msg, game_times);
|
||||||
if (self_room_type < RT_OldBrid1) {
|
if (self_room_type < RT_OldBrid1) {
|
||||||
|
@ -14,6 +14,7 @@ namespace MetaData
|
|||||||
struct MapTplThing;
|
struct MapTplThing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct JoinRequest;
|
||||||
class GridService;
|
class GridService;
|
||||||
class MapService;
|
class MapService;
|
||||||
class MapInstance;
|
class MapInstance;
|
||||||
@ -109,4 +110,5 @@ class RoomMgr : public a8::Singleton<RoomMgr>
|
|||||||
a8::TimerAttacher reportstate_timer_attacher_;
|
a8::TimerAttacher reportstate_timer_attacher_;
|
||||||
std::map<std::string, int> gm_hash_;
|
std::map<std::string, int> gm_hash_;
|
||||||
std::map<std::string, std::map<std::string, long long>> team_room_hash_;
|
std::map<std::string, std::map<std::string, long long>> team_room_hash_;
|
||||||
|
std::map<std::string, JoinRequest*> join_request_hash_;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user