1
This commit is contained in:
parent
3823588f9a
commit
48e506aa91
@ -6,7 +6,7 @@ class CustomMember
|
||||
public:
|
||||
|
||||
const std::string& GetAccountId() { return account_id_; }
|
||||
std::shared_ptr<BattleDataContext>& GetBattleContext() { return battle_context_; };
|
||||
std::shared_ptr<BattleDataContext>& GetNetData() { return battle_context_; };
|
||||
|
||||
private:
|
||||
std::string account_id_;
|
||||
|
@ -19,6 +19,8 @@
|
||||
#include "mapmgr.h"
|
||||
#include "debugcmd.h"
|
||||
#include "custom_battle.h"
|
||||
#include "custom_team.h"
|
||||
#include "custom_member.h"
|
||||
|
||||
#include "mt/Param.h"
|
||||
#include "mt/Text.h"
|
||||
@ -864,6 +866,16 @@ void RoomMgr::_CMJoinCustomBattle(f8::MsgHdr& hdr, const cs::CMJoin& msg)
|
||||
RoomMgr::Instance()->JoinErrorHandle(*join_msg, 2, socket_handle);
|
||||
return;
|
||||
}
|
||||
auto team = p->GetTeamByAccountId(msg.account_id());
|
||||
if (!team) {
|
||||
RoomMgr::Instance()->JoinErrorHandle(*join_msg, 2, socket_handle);
|
||||
return;
|
||||
}
|
||||
auto member = team->GetMember(msg.account_id());
|
||||
if (!member) {
|
||||
RoomMgr::Instance()->JoinErrorHandle(*join_msg, 2, socket_handle);
|
||||
return;
|
||||
}
|
||||
if (!p->CanAdd(join_msg->account_id(), join_msg->session_id())) {
|
||||
RoomMgr::Instance()->JoinErrorHandle(*join_msg, 2, socket_handle);
|
||||
return;
|
||||
@ -884,13 +896,9 @@ void RoomMgr::_CMJoinCustomBattle(f8::MsgHdr& hdr, const cs::CMJoin& msg)
|
||||
#if 0
|
||||
hum->hero_uniid = a8::XValue(msg.hero_uniid());
|
||||
#endif
|
||||
#if 0
|
||||
hum->battle_uuid = results.at(0)->battle_uuid;
|
||||
#endif
|
||||
#if 0
|
||||
hum->is_valid_battle = results.at(0)->is_valid_battle;
|
||||
hum->payload = results.at(0)->payload;
|
||||
#endif
|
||||
hum->battle_uuid = member->GetNetData()->battle_uuid;
|
||||
hum->is_valid_battle = member->GetNetData()->is_valid_battle;
|
||||
hum->payload = member->GetNetData()->payload;
|
||||
PlayerMgr::Instance()->
|
||||
CreatePlayerByCMJoin(hum,
|
||||
0, //ip_saddr,
|
||||
@ -902,9 +910,7 @@ void RoomMgr::_CMJoinCustomBattle(f8::MsgHdr& hdr, const cs::CMJoin& msg)
|
||||
hum->meta = mt::Param::s().human_meta;
|
||||
}
|
||||
hum->room = p->GetRoom();
|
||||
#if 0
|
||||
hum->SetBattleContext(results.at(0));
|
||||
#endif
|
||||
hum->SetBattleContext(member->GetNetData());
|
||||
hum->GetBattleContext()->Init(hum);
|
||||
{
|
||||
long long hero_uniid = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user