1
This commit is contained in:
parent
cdc56bcf37
commit
2a9b4bab79
@ -5,7 +5,7 @@
|
|||||||
#include "cs_proto.pb.h"
|
#include "cs_proto.pb.h"
|
||||||
#include "matchpool.h"
|
#include "matchpool.h"
|
||||||
#include "GGListener.h"
|
#include "GGListener.h"
|
||||||
#include "matchteam.h"
|
#include "matchteamnew.h"
|
||||||
|
|
||||||
void MatchPool::Init()
|
void MatchPool::Init()
|
||||||
{
|
{
|
||||||
@ -20,13 +20,13 @@ void MatchPool::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
MatchTeam* MatchPool::GetTeam(const std::string& team_uuid)
|
MatchTeamNew* MatchPool::GetTeam(const std::string& team_uuid)
|
||||||
{
|
{
|
||||||
auto itr = team_hash_.find(team_uuid);
|
auto itr = team_hash_.find(team_uuid);
|
||||||
return itr != team_hash_.end() ? itr->second : nullptr;
|
return itr != team_hash_.end() ? itr->second : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MatchPool::TraverseTeam(std::function<void (MatchTeam*, bool&)> func)
|
void MatchPool::TraverseTeam(std::function<void (MatchTeamNew*, bool&)> func)
|
||||||
{
|
{
|
||||||
if (!func) {
|
if (!func) {
|
||||||
return;
|
return;
|
||||||
@ -42,7 +42,7 @@ void MatchPool::TraverseTeam(std::function<void (MatchTeam*, bool&)> func)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::tuple<std::string, MatchTeam*>* MatchPool::GetMatchInfo(int socket_handle)
|
std::tuple<std::string, MatchTeamNew*>* MatchPool::GetMatchInfo(int socket_handle)
|
||||||
{
|
{
|
||||||
auto itr = socket_hash_.find(socket_handle);
|
auto itr = socket_hash_.find(socket_handle);
|
||||||
return itr != socket_hash_.end() ? &itr->second : nullptr;
|
return itr != socket_hash_.end() ? &itr->second : nullptr;
|
||||||
|
@ -5,7 +5,7 @@ namespace cs
|
|||||||
class CMJoin;
|
class CMJoin;
|
||||||
}
|
}
|
||||||
|
|
||||||
class MatchTeam;
|
class MatchTeamNew;
|
||||||
class MatchPool : public a8::Singleton<MatchPool>
|
class MatchPool : public a8::Singleton<MatchPool>
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
@ -20,20 +20,20 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void TraverseTeam(std::function<void (MatchTeam*, bool&)> func);
|
void TraverseTeam(std::function<void (MatchTeamNew*, bool&)> func);
|
||||||
|
|
||||||
bool NeedMatch(const cs::CMJoin& msg);
|
bool NeedMatch(const cs::CMJoin& msg);
|
||||||
MatchTeam* GetTeam(const std::string& team_uuid);
|
MatchTeamNew* GetTeam(const std::string& team_uuid);
|
||||||
std::tuple<std::string, MatchTeam*>* GetMatchInfo(int socket_handle);
|
std::tuple<std::string, MatchTeamNew*>* GetMatchInfo(int socket_handle);
|
||||||
void RemoveTeam(const std::string& team_uuid);
|
void RemoveTeam(const std::string& team_uuid);
|
||||||
void RemoveSocket(int socket_handle);
|
void RemoveSocket(int socket_handle);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
a8::TimerAttacher timer_attacher_;
|
a8::TimerAttacher timer_attacher_;
|
||||||
std::map<std::string, MatchTeam*> team_hash_;
|
std::map<std::string, MatchTeamNew*> team_hash_;
|
||||||
std::map<int, std::tuple<std::string, MatchTeam*>> socket_hash_;
|
std::map<int, std::tuple<std::string, MatchTeamNew*>> socket_hash_;
|
||||||
|
|
||||||
std::vector<MatchTeam*> matching_list_;
|
std::vector<MatchTeamNew*> matching_list_;
|
||||||
std::vector<MatchTeam*> matchok_list_;
|
std::vector<MatchTeamNew*> matchok_list_;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
3
server/gameserver/matchteamnew.cc
Normal file
3
server/gameserver/matchteamnew.cc
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#include "precompile.h"
|
||||||
|
|
||||||
|
#include "matchteamnew.h"
|
12
server/gameserver/matchteamnew.h
Normal file
12
server/gameserver/matchteamnew.h
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "cs_proto.pb.h"
|
||||||
|
|
||||||
|
#include "battledatacontext.h"
|
||||||
|
|
||||||
|
#include "matchteam.h"
|
||||||
|
|
||||||
|
class MatchTeamNew
|
||||||
|
{
|
||||||
|
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user