添加游戏模式选择
This commit is contained in:
parent
0eb19b3a2c
commit
e6ba781b30
@ -13,9 +13,9 @@ public:
|
|||||||
void UnInit();
|
void UnInit();
|
||||||
|
|
||||||
void AttachRoom(Room* room, RoomInitInfo& init_info);
|
void AttachRoom(Room* room, RoomInitInfo& init_info);
|
||||||
|
MapInstance* GetMapInstance(int map_id);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MapInstance* GetMapInstance(int map_id);
|
|
||||||
MapInstance* RandMapInstance(int map_mode);
|
MapInstance* RandMapInstance(int map_mode);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
#include "typeconvert.h"
|
#include "typeconvert.h"
|
||||||
#include "entityfactory.h"
|
#include "entityfactory.h"
|
||||||
#include "perfmonitor.h"
|
#include "perfmonitor.h"
|
||||||
|
#include "mapinstance.h"
|
||||||
|
#include "mapmgr.h"
|
||||||
|
|
||||||
#include "framework/cpp/utils.h"
|
#include "framework/cpp/utils.h"
|
||||||
|
|
||||||
@ -742,7 +744,8 @@ bool Room::CanJoin(const std::string& accountid,
|
|||||||
RoomType_e self_room_type,
|
RoomType_e self_room_type,
|
||||||
RoomMode_e self_room_mode,
|
RoomMode_e self_room_mode,
|
||||||
int self_proto_version,
|
int self_proto_version,
|
||||||
int self_channel)
|
int self_channel,
|
||||||
|
int init_map_id)
|
||||||
{
|
{
|
||||||
if (self_room_mode < kChiJiMode) {
|
if (self_room_mode < kChiJiMode) {
|
||||||
self_room_mode = kChiJiMode;
|
self_room_mode = kChiJiMode;
|
||||||
@ -756,6 +759,13 @@ bool Room::CanJoin(const std::string& accountid,
|
|||||||
if (gas_data_.gas_mode != GasInactive) {
|
if (gas_data_.gas_mode != GasInactive) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (init_map_id != 0) {
|
||||||
|
MapInstance* map_instance = MapMgr::Instance()->GetMapInstance(init_map_id);
|
||||||
|
if (map_instance && map_instance->GetMapMeta()->i->map_mode() == room_mode_ &&
|
||||||
|
map_instance->map_id != map_meta_->i->map_id()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (GetPlayerByAccountId(accountid)) {
|
if (GetPlayerByAccountId(accountid)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -113,7 +113,8 @@ public:
|
|||||||
RoomType_e self_roomm_type,
|
RoomType_e self_roomm_type,
|
||||||
RoomMode_e self_room_mode,
|
RoomMode_e self_room_mode,
|
||||||
int self_proto_version,
|
int self_proto_version,
|
||||||
int self_channel);
|
int self_channel,
|
||||||
|
int init_map_id);
|
||||||
void OnPlayerOffline(Player* hum);
|
void OnPlayerOffline(Player* hum);
|
||||||
Entity* FindFirstCollisonEntity(const a8::Vec2& aabb_pos, AabbCollider& aabb_box);
|
Entity* FindFirstCollisonEntity(const a8::Vec2& aabb_pos, AabbCollider& aabb_box);
|
||||||
void FindLocationWithAabb(Entity* target, const a8::Vec2& aabb_pos, AabbCollider* aabb_box,
|
void FindLocationWithAabb(Entity* target, const a8::Vec2& aabb_pos, AabbCollider* aabb_box,
|
||||||
|
@ -249,7 +249,8 @@ Room* RoomMgr::GetJoinableRoom(const cs::CMJoin& msg,
|
|||||||
self_room_type,
|
self_room_type,
|
||||||
(RoomMode_e)msg.room_mode(),
|
(RoomMode_e)msg.room_mode(),
|
||||||
proto_version,
|
proto_version,
|
||||||
channel)) {
|
channel,
|
||||||
|
msg.mapid())) {
|
||||||
if (!msg.team_uuid().empty() && room->HaveMyTeam(msg.team_uuid())) {
|
if (!msg.team_uuid().empty() && room->HaveMyTeam(msg.team_uuid())) {
|
||||||
return room;
|
return room;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user