diff --git a/server/gameserver/custom_battle.cc b/server/gameserver/custom_battle.cc index ac24187c..20d941c8 100644 --- a/server/gameserver/custom_battle.cc +++ b/server/gameserver/custom_battle.cc @@ -67,6 +67,7 @@ void CustomBattle::ParseResult(a8::XObject& obj) auto team = GetTeamByTeamUuid(team_uuid); if (!team) { team = std::make_shared(); + team->custom_battle_ = this; team->team_uuid_ = team_uuid; team->is_view_ = false; uuid_hash_[team->team_uuid_] = team; diff --git a/server/gameserver/custom_member.cc b/server/gameserver/custom_member.cc index 8a7bb34f..827b6148 100644 --- a/server/gameserver/custom_member.cc +++ b/server/gameserver/custom_member.cc @@ -22,5 +22,10 @@ bool CustomMember::IsView() void CustomMember::_CMBattlePreSetReady(f8::MsgHdr* hdr, const cs::CMBattlePreSetReady& msg) { - + is_ready_ = true; +} + +bool CustomMember::IsAndroid() +{ + return false; } diff --git a/server/gameserver/custom_member.h b/server/gameserver/custom_member.h index 31f20a62..a91730b2 100644 --- a/server/gameserver/custom_member.h +++ b/server/gameserver/custom_member.h @@ -31,6 +31,7 @@ class CustomMember int GetSex() { return sex_; } std::shared_ptr& GetNetData() { return battle_context_; }; void _CMBattlePreSetReady(f8::MsgHdr* hdr, const cs::CMBattlePreSetReady& msg); + bool IsAndroid(); private: std::shared_ptr join_msg_; @@ -45,6 +46,7 @@ private: std::string avatar_url_; int head_frame_ = 0; int sex_ = 0; + int is_ready_ = 0; std::shared_ptr battle_context_; friend class CustomBattle; }; diff --git a/server/gameserver/custom_team.h b/server/gameserver/custom_team.h index 4393a02e..5b9f227f 100644 --- a/server/gameserver/custom_team.h +++ b/server/gameserver/custom_team.h @@ -1,6 +1,7 @@ #pragma once class CustomMember; +class CustomBattle; class CustomTeam { public: @@ -11,8 +12,10 @@ class CustomTeam void TraverseMember(std::function)> cb); int GetMemberNum(); int GetAverageHeroLv(); + CustomBattle* GetCustomBattle() { return custom_battle_; } private: + CustomBattle* custom_battle_ = nullptr; std::string team_uuid_; bool is_view_ = false; std::map> member_hash_;