1
This commit is contained in:
parent
3902c659ee
commit
fc3dbb3a52
@ -57,8 +57,8 @@ void CustomBattle::ParseResult(a8::XObject& obj)
|
|||||||
parse_ok_ = false;
|
parse_ok_ = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const mt::MapMode* map_mode_meta = mt::MapMode::GetById(map_mode_);
|
map_mode_meta_ = mt::MapMode::GetById(map_mode_);
|
||||||
if (!map_mode_meta || !map_mode_meta->IsOpen()) {
|
if (!map_mode_meta_) {
|
||||||
parse_ok_ = false;
|
parse_ok_ = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -272,7 +272,11 @@ RoomMode_e CustomBattle::GetRoomMode()
|
|||||||
if (IsMoba()) {
|
if (IsMoba()) {
|
||||||
return kMobaMode;
|
return kMobaMode;
|
||||||
} else {
|
} else {
|
||||||
return kPvpMode;
|
if (match_mode_) {
|
||||||
|
return kPvpRankMode;
|
||||||
|
} else {
|
||||||
|
return kPvpMode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -381,14 +385,14 @@ void CustomBattle::GameStart()
|
|||||||
if (IsPvp()) {
|
if (IsPvp()) {
|
||||||
room = RoomMgr::Instance()->CreateRoom
|
room = RoomMgr::Instance()->CreateRoom
|
||||||
(self_room_type,
|
(self_room_type,
|
||||||
GetMapMode(),
|
GetMapModeMeta()->id(),
|
||||||
GetMapId(),
|
GetMapId(),
|
||||||
GetRoomMode(),
|
GetRoomMode(),
|
||||||
nullptr);
|
nullptr);
|
||||||
} else {
|
} else {
|
||||||
room = RoomMgr::Instance()->CreateRoom
|
room = RoomMgr::Instance()->CreateRoom
|
||||||
(self_room_type,
|
(self_room_type,
|
||||||
GetMapMode(),
|
GetMapModeMeta()->id(),
|
||||||
GetMapId(),
|
GetMapId(),
|
||||||
GetRoomMode(),
|
GetRoomMode(),
|
||||||
nullptr);
|
nullptr);
|
||||||
|
@ -26,7 +26,7 @@ class CustomBattle : public std::enable_shared_from_this<CustomBattle>
|
|||||||
int GetZoneId() { return zone_id_; }
|
int GetZoneId() { return zone_id_; }
|
||||||
int GetNodeId() { return zone_id_; }
|
int GetNodeId() { return zone_id_; }
|
||||||
int GetMatchMode() { return match_mode_; }
|
int GetMatchMode() { return match_mode_; }
|
||||||
int GetMapMode() { return map_mode_; }
|
const mt::MapMode* GetMapModeMeta() { return map_mode_meta_; }
|
||||||
int GetMapId() { return map_id_; }
|
int GetMapId() { return map_id_; }
|
||||||
RoomType_e GetRoomType();
|
RoomType_e GetRoomType();
|
||||||
RoomMode_e GetRoomMode();
|
RoomMode_e GetRoomMode();
|
||||||
@ -75,6 +75,7 @@ private:
|
|||||||
int map_id_ = 0;
|
int map_id_ = 0;
|
||||||
int start_time_ = 0;
|
int start_time_ = 0;
|
||||||
int team1_average_hero_lv_ = 0;
|
int team1_average_hero_lv_ = 0;
|
||||||
|
const mt::MapMode* map_mode_meta_ = nullptr;
|
||||||
std::string sign_;
|
std::string sign_;
|
||||||
std::shared_ptr<a8::XObject> raw_data_;
|
std::shared_ptr<a8::XObject> raw_data_;
|
||||||
std::vector<std::shared_ptr<CustomTeam>> team_list_;
|
std::vector<std::shared_ptr<CustomTeam>> team_list_;
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
namespace mt
|
namespace mt
|
||||||
{
|
{
|
||||||
|
const int kPvpRankMode = 501;
|
||||||
|
|
||||||
DECLARE_ID_TABLE(MapMode, mtb::MapMode,
|
DECLARE_ID_TABLE(MapMode, mtb::MapMode,
|
||||||
"mapMode@mapMode.json",
|
"mapMode@mapMode.json",
|
||||||
"id")
|
"id")
|
||||||
|
@ -3783,7 +3783,7 @@ bool Room::CanJoin(std::shared_ptr<CustomBattle> p)
|
|||||||
if (map_meta_->map_id() != p->GetMapId()) {
|
if (map_meta_->map_id() != p->GetMapId()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (GetMapModeMeta()->id() != p->GetMapMode()) {
|
if (GetMapModeMeta() != p->GetMapModeMeta()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -512,13 +512,6 @@ void RoomMgr::_CMJoinCustomBattle(f8::MsgHdr* hdr, const cs::CMJoin& msg, int cu
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
|
||||||
const mt::MapMode* map_mode_meta = mt::MapMode::GetById(p->GetMapMode());
|
|
||||||
if (!map_mode_meta || !map_mode_meta->IsOpen()) {
|
|
||||||
RoomMgr::Instance()->JoinErrorHandle(msg, 3, socket_handle);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
const mt::Map* map_meta = mt::Map::GetById(p->GetMapId());
|
const mt::Map* map_meta = mt::Map::GetById(p->GetMapId());
|
||||||
if (!map_meta || !map_meta->IsOpen()) {
|
if (!map_meta || !map_meta->IsOpen()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user