diff --git a/server/gameserver/custom_battle.cc b/server/gameserver/custom_battle.cc index ab356c2a..d7391b44 100644 --- a/server/gameserver/custom_battle.cc +++ b/server/gameserver/custom_battle.cc @@ -304,5 +304,5 @@ void CustomBattle::OnEnter(std::shared_ptr join_msg, long ip_saddr, void CustomBattle::OnMemberReady(CustomMember* member) { - + NotifyState(); } diff --git a/server/gameserver/custom_battle.h b/server/gameserver/custom_battle.h index 5e45c424..080aaea4 100644 --- a/server/gameserver/custom_battle.h +++ b/server/gameserver/custom_battle.h @@ -51,9 +51,11 @@ class CustomBattle private: void CalcTeam1AverageHeroLv(); + void NotifyState(); private: bool parse_ok_ = false; + int state_ = 0; Room *room_ = nullptr; int custom_room_type_ = CUSTOM_ROOM_CUSTOM; bool is_moba_ = false; diff --git a/server/gameserver/pbutils.cc b/server/gameserver/pbutils.cc index bdd7356f..1a0d8fd3 100644 --- a/server/gameserver/pbutils.cc +++ b/server/gameserver/pbutils.cc @@ -3031,3 +3031,11 @@ int Creature::Throw(int slot, const glm::vec3& bomb_pos, const glm::vec3& bomb_d } return 0; } + +void CustomBattle::NotifyState() +{ + cs::SMBattlePreInfoUpdate notify_msg; + for (auto& pair : socket_hash_) { + GGListener::Instance()->SendToClient(pair.first, 0, notify_msg); + } +}