1
This commit is contained in:
parent
14fd195ef8
commit
0d3cd07a12
@ -274,3 +274,8 @@ std::shared_ptr<CustomTeam> CustomBattle::GetTeamByIdx(int idx)
|
|||||||
}
|
}
|
||||||
return team_list_.at(idx);
|
return team_list_.at(idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CustomBattle::OnEnter(std::shared_ptr<cs::CMJoin> join_msg, long ip_saddr, int socket_handle)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -43,6 +43,7 @@ class CustomBattle
|
|||||||
bool IsCustomMode() { return custom_room_type_ == CUSTOM_ROOM_CUSTOM; }
|
bool IsCustomMode() { return custom_room_type_ == CUSTOM_ROOM_CUSTOM; }
|
||||||
bool IsPvp() { return !is_moba_; }
|
bool IsPvp() { return !is_moba_; }
|
||||||
bool IsMoba() { return is_moba_; }
|
bool IsMoba() { return is_moba_; }
|
||||||
|
void OnEnter(std::shared_ptr<cs::CMJoin> join_msg, long ip_saddr, int socket_handle);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -68,4 +69,5 @@ private:
|
|||||||
std::map<std::string, std::shared_ptr<CustomTeam>> account_hash_;
|
std::map<std::string, std::shared_ptr<CustomTeam>> account_hash_;
|
||||||
std::map<std::string, std::shared_ptr<CustomMember>> member_id_hash_;
|
std::map<std::string, std::shared_ptr<CustomMember>> member_id_hash_;
|
||||||
std::map<std::string, std::shared_ptr<CustomMember>> ob_id_hash_;
|
std::map<std::string, std::shared_ptr<CustomMember>> ob_id_hash_;
|
||||||
|
std::map<int, std::shared_ptr<CustomMember>> socket_hash_;
|
||||||
};
|
};
|
||||||
|
@ -513,6 +513,14 @@ void RoomMgr::_CMJoinCustomBattle(f8::MsgHdr* hdr, const cs::CMJoin& msg, int cu
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const mt::Map* map_meta = mt::Map::GetById(p->GetMapId());
|
||||||
|
if (!map_meta || !map_meta->IsOpen()) {
|
||||||
|
RoomMgr::Instance()->JoinErrorHandle(msg, 3, socket_handle);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#if 1
|
||||||
|
p->OnEnter(join_msg, ip_saddr, socket_handle);
|
||||||
|
#else
|
||||||
if (p->GetRoom()) {
|
if (p->GetRoom()) {
|
||||||
if (p->GetRoom()->GetGasData().GetGasMode() != GasInactive) {
|
if (p->GetRoom()->GetGasData().GetGasMode() != GasInactive) {
|
||||||
return;
|
return;
|
||||||
@ -523,11 +531,6 @@ void RoomMgr::_CMJoinCustomBattle(f8::MsgHdr* hdr, const cs::CMJoin& msg, int cu
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const mt::Map* map_meta = mt::Map::GetById(p->GetMapId());
|
|
||||||
if (!map_meta || !map_meta->IsOpen()) {
|
|
||||||
RoomMgr::Instance()->JoinErrorHandle(msg, 3, socket_handle);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
int game_times = 0;
|
int game_times = 0;
|
||||||
RoomType_e self_room_type = p->GetRoomType();
|
RoomType_e self_room_type = p->GetRoomType();
|
||||||
time_t register_time = f8::ExtractRegisterTimeFromSessionId(msg.session_id());
|
time_t register_time = f8::ExtractRegisterTimeFromSessionId(msg.session_id());
|
||||||
@ -586,6 +589,7 @@ void RoomMgr::_CMJoinCustomBattle(f8::MsgHdr* hdr, const cs::CMJoin& msg, int cu
|
|||||||
p->SetRoom(room.get());
|
p->SetRoom(room.get());
|
||||||
room->InitWithCustomBattle(ip_saddr, socket_handle, join_msg, p);
|
room->InitWithCustomBattle(ip_saddr, socket_handle, join_msg, p);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
SendGetCustomBattleData(join_msg, cb, custom_room_type);
|
SendGetCustomBattleData(join_msg, cb, custom_room_type);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user