1
This commit is contained in:
parent
95c468ce14
commit
752d87d136
@ -499,8 +499,13 @@ void App::ProcessGameGateMsg(f8::MsgHdr& hdr)
|
||||
case HID_RoomMgr:
|
||||
ProcessNetMsg(handler, RoomMgr::Instance(), hdr);
|
||||
break;
|
||||
case HID_MatchMgr:
|
||||
ProcessNetMsg(handler, MatchMgr::Instance(), hdr);
|
||||
case HID_MatchTeam:
|
||||
{
|
||||
auto match_info = MatchMgr::Instance()->GetMatchInfo(hdr.socket_handle);
|
||||
if (match_info) {
|
||||
ProcessNetMsg(handler, std::get<1>(*match_info), hdr);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case HID_PlayerMgr:
|
||||
ProcessNetMsg(handler, PlayerMgr::Instance(), hdr);
|
||||
|
@ -25,6 +25,7 @@ enum NetHandler_e
|
||||
HID_Room,
|
||||
HID_RoomMgr,
|
||||
HID_MatchMgr,
|
||||
HID_MatchTeam,
|
||||
HID_GGListener,
|
||||
};
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "jsondatamgr.h"
|
||||
#include "perfmonitor.h"
|
||||
#include "matchmgr.h"
|
||||
#include "matchteam.h"
|
||||
|
||||
static void _GMOpsSelfChecking(f8::JsonHttpRequest* request)
|
||||
{
|
||||
@ -87,10 +88,12 @@ void HandlerMgr::RegisterNetMsgHandlers()
|
||||
RegisterNetMsgHandler(&ggmsghandler, &RoomMgr::_CMJoin);
|
||||
RegisterNetMsgHandler(&ggmsghandler, &RoomMgr::_CMReconnect);
|
||||
|
||||
RegisterNetMsgHandler(&ggmsghandler, &MatchMgr::_CMMatchCancel);
|
||||
RegisterNetMsgHandler(&ggmsghandler, &MatchMgr::_CMMatchChoose);
|
||||
RegisterNetMsgHandler(&ggmsghandler, &MatchMgr::_CMMatchStartGame);
|
||||
RegisterNetMsgHandler(&ggmsghandler, &MatchMgr::_CMMatchCancelStartGame);
|
||||
RegisterNetMsgHandler(&ggmsghandler, &MatchTeam::_CMMatchCancel);
|
||||
RegisterNetMsgHandler(&ggmsghandler, &MatchTeam::_CMMatchChoose);
|
||||
RegisterNetMsgHandler(&ggmsghandler, &MatchTeam::_CMMatchStartGame);
|
||||
RegisterNetMsgHandler(&ggmsghandler, &MatchTeam::_CMMatchCancelStartGame);
|
||||
RegisterNetMsgHandler(&ggmsghandler, &MatchTeam::_CMMatchSendMsg);
|
||||
RegisterNetMsgHandler(&ggmsghandler, &MatchTeam::_CMMatchBroadcastMsg);
|
||||
|
||||
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMMove);
|
||||
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMImmediateMsg);
|
||||
|
@ -66,54 +66,6 @@ void MatchMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg)
|
||||
}
|
||||
}
|
||||
|
||||
void MatchMgr::_CMMatchCancel(f8::MsgHdr& hdr, const cs::CMMatchCancel& msg)
|
||||
{
|
||||
auto match_info = GetMatchInfo(hdr.socket_handle);
|
||||
if (match_info) {
|
||||
std::get<1>(*match_info)->_CMMatchCancel(hdr, msg);
|
||||
}
|
||||
}
|
||||
|
||||
void MatchMgr::_CMMatchChoose(f8::MsgHdr& hdr, const cs::CMMatchChoose& msg)
|
||||
{
|
||||
auto match_info = GetMatchInfo(hdr.socket_handle);
|
||||
if (match_info) {
|
||||
std::get<1>(*match_info)->_CMMatchChoose(hdr, msg);
|
||||
}
|
||||
}
|
||||
|
||||
void MatchMgr::_CMMatchStartGame(f8::MsgHdr& hdr, const cs::CMMatchStartGame& msg)
|
||||
{
|
||||
auto match_info = GetMatchInfo(hdr.socket_handle);
|
||||
if (match_info) {
|
||||
std::get<1>(*match_info)->_CMMatchStartGame(hdr, msg);
|
||||
}
|
||||
}
|
||||
|
||||
void MatchMgr::_CMMatchCancelStartGame(f8::MsgHdr& hdr, const cs::CMMatchCancelStartGame& msg)
|
||||
{
|
||||
auto match_info = GetMatchInfo(hdr.socket_handle);
|
||||
if (match_info) {
|
||||
std::get<1>(*match_info)->_CMMatchCancelStartGame(hdr, msg);
|
||||
}
|
||||
}
|
||||
|
||||
void MatchMgr::_CMMatchSendMsg(f8::MsgHdr& hdr, const cs::CMMatchSendMsg& msg)
|
||||
{
|
||||
auto match_info = GetMatchInfo(hdr.socket_handle);
|
||||
if (match_info) {
|
||||
std::get<1>(*match_info)->_CMMatchSendMsg(hdr, msg);
|
||||
}
|
||||
}
|
||||
|
||||
void MatchMgr::_CMMatchBroadcastMsg(f8::MsgHdr& hdr, const cs::CMMatchBroadcastMsg& msg)
|
||||
{
|
||||
auto match_info = GetMatchInfo(hdr.socket_handle);
|
||||
if (match_info) {
|
||||
std::get<1>(*match_info)->_CMMatchBroadcastMsg(hdr, msg);
|
||||
}
|
||||
}
|
||||
|
||||
bool MatchMgr::NeedMatch(const cs::CMJoin& msg)
|
||||
{
|
||||
bool need = !msg.team_uuid().empty() &&
|
||||
|
@ -15,9 +15,6 @@ namespace cs
|
||||
class MatchTeam;
|
||||
class MatchMgr : public a8::Singleton<MatchMgr>
|
||||
{
|
||||
public:
|
||||
enum { HID = HID_MatchMgr };
|
||||
|
||||
private:
|
||||
MatchMgr() {};
|
||||
friend class a8::Singleton<MatchMgr>;
|
||||
@ -29,12 +26,6 @@ public:
|
||||
void UnInit();
|
||||
|
||||
void _CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg);
|
||||
void _CMMatchCancel(f8::MsgHdr& hdr, const cs::CMMatchCancel& msg);
|
||||
void _CMMatchChoose(f8::MsgHdr& hdr, const cs::CMMatchChoose& msg);
|
||||
void _CMMatchStartGame(f8::MsgHdr& hdr, const cs::CMMatchStartGame& msg);
|
||||
void _CMMatchCancelStartGame(f8::MsgHdr& hdr, const cs::CMMatchCancelStartGame& msg);
|
||||
void _CMMatchSendMsg(f8::MsgHdr& hdr, const cs::CMMatchSendMsg& msg);
|
||||
void _CMMatchBroadcastMsg(f8::MsgHdr& hdr, const cs::CMMatchBroadcastMsg& msg);
|
||||
void TraverseTeam(std::function<void (MatchTeam*, bool&)> func);
|
||||
|
||||
bool NeedMatch(const cs::CMJoin& msg);
|
||||
|
@ -52,6 +52,9 @@ struct RawTeamMember
|
||||
|
||||
class MatchTeam
|
||||
{
|
||||
public:
|
||||
enum { HID = HID_MatchTeam };
|
||||
|
||||
public:
|
||||
a8::TimerAttacher timer_attacher;
|
||||
~MatchTeam();
|
||||
|
Loading…
x
Reference in New Issue
Block a user