1
This commit is contained in:
parent
0a50e4ae91
commit
45b58339cb
@ -334,6 +334,16 @@ std::shared_ptr<Room> RoomMgr::GetJoinableRoom(const cs::CMJoin& msg,
|
|||||||
nullptr);
|
nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<Room> RoomMgr::GetJoinableRoom(std::shared_ptr<CustomBattle> custom_battle,
|
||||||
|
const RoomType_e self_room_type,
|
||||||
|
int game_times,
|
||||||
|
int creator_register_time,
|
||||||
|
int proto_version,
|
||||||
|
int channel)
|
||||||
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
std::shared_ptr<Room> RoomMgr::GetRoomByUuid(const std::string& room_uuid)
|
std::shared_ptr<Room> RoomMgr::GetRoomByUuid(const std::string& room_uuid)
|
||||||
{
|
{
|
||||||
auto itr = room_hash_.find(room_uuid);
|
auto itr = room_hash_.find(room_uuid);
|
||||||
@ -1015,29 +1025,33 @@ void RoomMgr::_CMJoinCustomBattle(f8::MsgHdr* hdr, const cs::CMJoin& msg, int cu
|
|||||||
int proto_version = msg.proto_version();
|
int proto_version = msg.proto_version();
|
||||||
int channel = f8::ExtractChannelIdFromAccountId(msg.account_id());
|
int channel = f8::ExtractChannelIdFromAccountId(msg.account_id());
|
||||||
std::shared_ptr<Room> room = nullptr;
|
std::shared_ptr<Room> room = nullptr;
|
||||||
if (p->IsPvp()) {
|
if (p->IsNormalMode()) {
|
||||||
room = RoomMgr::Instance()->CreateRoom
|
|
||||||
(*join_msg,
|
|
||||||
self_room_type,
|
|
||||||
game_times,
|
|
||||||
register_time,
|
|
||||||
join_msg->proto_version(),
|
|
||||||
channel,
|
|
||||||
msg.mapid(),
|
|
||||||
p);
|
|
||||||
} else {
|
} else {
|
||||||
room = RoomMgr::Instance()->CreateRoom
|
if (p->IsPvp()) {
|
||||||
(*join_msg,
|
room = RoomMgr::Instance()->CreateRoom
|
||||||
self_room_type,
|
(*join_msg,
|
||||||
game_times,
|
self_room_type,
|
||||||
register_time,
|
game_times,
|
||||||
join_msg->proto_version(),
|
register_time,
|
||||||
channel,
|
join_msg->proto_version(),
|
||||||
msg.mapid(),
|
channel,
|
||||||
nullptr);
|
msg.mapid(),
|
||||||
|
p);
|
||||||
|
} else {
|
||||||
|
room = RoomMgr::Instance()->CreateRoom
|
||||||
|
(*join_msg,
|
||||||
|
self_room_type,
|
||||||
|
game_times,
|
||||||
|
register_time,
|
||||||
|
join_msg->proto_version(),
|
||||||
|
channel,
|
||||||
|
msg.mapid(),
|
||||||
|
nullptr);
|
||||||
|
}
|
||||||
|
p->SetRoom(room.get());
|
||||||
|
room->InitWithCustomBattle(ip_saddr, socket_handle, join_msg, p);
|
||||||
}
|
}
|
||||||
p->SetRoom(room.get());
|
|
||||||
room->InitWithCustomBattle(ip_saddr, socket_handle, join_msg, p);
|
|
||||||
};
|
};
|
||||||
SendGetCustomBattleData(join_msg, cb, custom_room_type);
|
SendGetCustomBattleData(join_msg, cb, custom_room_type);
|
||||||
}
|
}
|
||||||
|
@ -96,6 +96,12 @@ class RoomMgr : public a8::Singleton<RoomMgr>
|
|||||||
int creator_register_time,
|
int creator_register_time,
|
||||||
int proto_version,
|
int proto_version,
|
||||||
int channel);
|
int channel);
|
||||||
|
std::shared_ptr<Room> GetJoinableRoom(std::shared_ptr<CustomBattle> custom_battle,
|
||||||
|
const RoomType_e self_room_type,
|
||||||
|
int game_times,
|
||||||
|
int creator_register_time,
|
||||||
|
int proto_version,
|
||||||
|
int channel);
|
||||||
void ReportServerState(int instance_id, const std::string& host, int port);
|
void ReportServerState(int instance_id, const std::string& host, int port);
|
||||||
void FreeOverRoom(const std::string& room_uuid);
|
void FreeOverRoom(const std::string& room_uuid);
|
||||||
bool IsLimitJoin();
|
bool IsLimitJoin();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user