添加创建房间日志

This commit is contained in:
aozhiwei 2019-08-31 15:22:44 +08:00
parent 2e30f0dab5
commit 2112d6aa7c

View File

@ -16,6 +16,8 @@
#include "framework/cpp/httpclientpool.h"
const int ROOM_NUM_LIMIT = 20;
void RoomMgr::Init()
{
if (!App::Instance()->HasFlag(8)) {
@ -48,6 +50,9 @@ void RoomMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg)
if (!hum_meta) {
abort();
}
if (RoomNum() >= ROOM_NUM_LIMIT) {
return;
}
Room* room = GetJoinableRoom(msg.account_id());
if (!room) {
room = new Room();
@ -59,6 +64,16 @@ void RoomMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg)
room->Init();
inactive_room_hash_[room->room_uuid] = room;
room_hash_[room->room_uuid] = room;
a8::UdpLog::Instance()->Info("createroom:%d masterid:%s max_mainloop_rundelay:%d "
"room_num:%d player_num:%d online_num:%d",
{
room->room_uuid,
msg.account_id(),
App::Instance()->perf.max_run_delay_time,
RoomMgr::Instance()->RoomNum(),
App::Instance()->perf.entity_num[ET_Player],
PlayerMgr::Instance()->OnlineNum(),
});
}
Player* hum = PlayerMgr::Instance()->CreatePlayerByCMJoin(hdr.ip_saddr, hdr.socket_handle, msg);
hum->meta = hum_meta;