添加创建房间日志
This commit is contained in:
parent
2e30f0dab5
commit
2112d6aa7c
@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
#include "framework/cpp/httpclientpool.h"
|
#include "framework/cpp/httpclientpool.h"
|
||||||
|
|
||||||
|
const int ROOM_NUM_LIMIT = 20;
|
||||||
|
|
||||||
void RoomMgr::Init()
|
void RoomMgr::Init()
|
||||||
{
|
{
|
||||||
if (!App::Instance()->HasFlag(8)) {
|
if (!App::Instance()->HasFlag(8)) {
|
||||||
@ -48,6 +50,9 @@ void RoomMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg)
|
|||||||
if (!hum_meta) {
|
if (!hum_meta) {
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
if (RoomNum() >= ROOM_NUM_LIMIT) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Room* room = GetJoinableRoom(msg.account_id());
|
Room* room = GetJoinableRoom(msg.account_id());
|
||||||
if (!room) {
|
if (!room) {
|
||||||
room = new Room();
|
room = new Room();
|
||||||
@ -59,6 +64,16 @@ void RoomMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg)
|
|||||||
room->Init();
|
room->Init();
|
||||||
inactive_room_hash_[room->room_uuid] = room;
|
inactive_room_hash_[room->room_uuid] = room;
|
||||||
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);
|
Player* hum = PlayerMgr::Instance()->CreatePlayerByCMJoin(hdr.ip_saddr, hdr.socket_handle, msg);
|
||||||
hum->meta = hum_meta;
|
hum->meta = hum_meta;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user