This commit is contained in:
aozhiwei 2023-09-06 15:03:46 +08:00
parent ecc478c4c2
commit aa2e222a20
3 changed files with 20 additions and 7 deletions

View File

@ -65,6 +65,16 @@ namespace mt
buff_list.push_back(a8::XValue(str).GetInt()); buff_list.push_back(a8::XValue(str).GetInt());
} }
} }
{
std::vector<std::string> strings;
a8::Split(ground_sampling_pos(), strings, ':');
if (strings.size() != 3) {
abort();
}
sampling_pos_ = glm::vec3((float)a8::XValue(strings[0]).GetDouble(),
(float)a8::XValue(strings[1]).GetDouble(),
(float)a8::XValue(strings[2]).GetDouble());
}
if (!IsPveMap()) { if (!IsPveMap()) {
std::vector<std::string> strings; std::vector<std::string> strings;
a8::Split(refresh_robot(), strings, '|'); a8::Split(refresh_robot(), strings, '|');
@ -276,7 +286,7 @@ namespace mt
glm::vec3 Map::GroundSamplingPos() const glm::vec3 Map::GroundSamplingPos() const
{ {
return sampling_pos_;
} }
} }

View File

@ -49,6 +49,8 @@ namespace mt
void Init2(); void Init2();
private: private:
glm::vec3 sampling_pos_;
void LoadWorldObjects(); void LoadWorldObjects();
}; };

View File

@ -108,13 +108,11 @@ void RoomMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg)
MatchMgr::Instance()->_CMJoin(hdr, msg); MatchMgr::Instance()->_CMJoin(hdr, msg);
return; return;
} }
if (msg.proto_version() >= cs::ProtoVersion) {
const mt::Map* map_meta = mt::Map::GetById(msg.mapid()); const mt::Map* map_meta = mt::Map::GetById(msg.mapid());
if (!map_meta || !map_meta->IsOpen()) { if (!map_meta || !map_meta->IsOpen()) {
JoinErrorHandle(msg, 3, hdr.socket_handle); JoinErrorHandle(msg, 3, hdr.socket_handle);
return; return;
} }
}
std::shared_ptr<cs::CMJoin> join_msg = std::make_shared<cs::CMJoin>(); std::shared_ptr<cs::CMJoin> join_msg = std::make_shared<cs::CMJoin>();
*join_msg = msg; *join_msg = msg;
std::vector<std::shared_ptr<cs::CMJoin>> join_msgs{join_msg}; std::vector<std::shared_ptr<cs::CMJoin>> join_msgs{join_msg};
@ -807,6 +805,9 @@ void RoomMgr::SetMatchMode(int mode)
void RoomMgr::AdjustCMJoin(cs::CMJoin* msg) void RoomMgr::AdjustCMJoin(cs::CMJoin* msg)
{ {
msg->set_force_enter_newbie_room(false); msg->set_force_enter_newbie_room(false);
if (msg->proto_version() < cs::ProtoVersion) {
msg->set_mapid(2001);
}
#ifdef DEBUG1 #ifdef DEBUG1
if (DebugCmd::Enable()) { if (DebugCmd::Enable()) {
msg->set_room_mode(kPvpRankMode); msg->set_room_mode(kPvpRankMode);