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