This commit is contained in:
aozhiwei 2023-12-28 14:59:59 +08:00
parent 271f50b441
commit ca9b547686
2 changed files with 29 additions and 4 deletions

View File

@ -3,6 +3,31 @@
class Room; class Room;
class MobaTeam; class MobaTeam;
class MobaMember; class MobaMember;
class Player;
struct BattleDataContext;
class MobaMember
{
public:
void Join(Player* hum);
MobaTeam* GetTeam() { return team_; }
bool IsJoined() { return joined_; }
int GetJoinTime() { return join_time_; }
bool IsView();
const std::string& GetAccountId() { return account_id_; }
const std::string& GetSessionId() { return session_id_; }
std::shared_ptr<BattleDataContext>& GetNetData() { return battle_context_; };
private:
MobaTeam *team_ = nullptr;
bool joined_ = false;
int join_time_ = 0;
std::string account_id_;
std::string session_id_;
std::shared_ptr<BattleDataContext> battle_context_;
friend class MobaBattle;
};
class MobaTeam class MobaTeam
{ {

View File

@ -2289,9 +2289,9 @@ int Room::InitWithMobaBattle(long ip_saddr, int socket_handle, std::shared_ptr<c
#if 0 #if 0
hum->hero_uniid = a8::XValue(msg.hero_uniid()); hum->hero_uniid = a8::XValue(msg.hero_uniid());
#endif #endif
//hum->battle_uuid = member->GetNetData()->battle_uuid; hum->battle_uuid = m->GetNetData()->battle_uuid;
//hum->is_valid_battle = member->GetNetData()->is_valid_battle; hum->is_valid_battle = m->GetNetData()->is_valid_battle;
//hum->payload = member->GetNetData()->payload; hum->payload = m->GetNetData()->payload;
//msg.set_session_id(member->GetSessionId()); //msg.set_session_id(member->GetSessionId());
//msg.set_team_uuid(team->GetTeamUuid()); //msg.set_team_uuid(team->GetTeamUuid());
PlayerMgr::Instance()-> PlayerMgr::Instance()->
@ -2304,7 +2304,7 @@ int Room::InitWithMobaBattle(long ip_saddr, int socket_handle, std::shared_ptr<c
if (!hum->meta) { if (!hum->meta) {
hum->meta = mt::Param::s().human_meta; hum->meta = mt::Param::s().human_meta;
} }
//hum->SetBattleContext(member->GetNetData()); hum->SetBattleContext(m->GetNetData());
hum->GetBattleContext()->Init(hum); hum->GetBattleContext()->Init(hum);
{ {
long long hero_uniid = 0; long long hero_uniid = 0;