From c88d0f970c26f52867c6fd786e2e5816df5a8323 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 31 Mar 2022 14:28:25 +0800 Subject: [PATCH] 1 --- server/gameserver/human.h | 1 + server/gameserver/room.cc | 1 + server/gameserver/roommgr.cc | 56 +----------------------------------- 3 files changed, 3 insertions(+), 55 deletions(-) diff --git a/server/gameserver/human.h b/server/gameserver/human.h index a3a0916b..443688f9 100644 --- a/server/gameserver/human.h +++ b/server/gameserver/human.h @@ -117,6 +117,7 @@ class Human : public Creature int today_enter_times = 0; int account_registertime = 0; int channel = 0; + std::string hero_uniid; HumanBehavior behavior; MetaData::Player* meta = nullptr; MetaData::Equip* helmet_meta = nullptr; diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index cc7b5258..589511bd 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -3983,6 +3983,7 @@ void Room::AddTeam(class MatchTeam* team) } else { Player* hum = NewPlayer(); hum->proto_version = msg.proto_version(); + hum->hero_uniid = msg.hero_uniid(); #if 1 a8::SetBitFlag(hum->status, CS_ForceTeam); #if 0 diff --git a/server/gameserver/roommgr.cc b/server/gameserver/roommgr.cc index cf832a21..e669a1d1 100644 --- a/server/gameserver/roommgr.cc +++ b/server/gameserver/roommgr.cc @@ -185,6 +185,7 @@ void RoomMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg) } Player* hum = room->NewPlayer(); hum->proto_version = msg.proto_version(); + hum->hero_uniid = msg.hero_uniid(); hum->ProcPreSettlementInfo(msg.pre_settlement_info()); PlayerMgr::Instance()-> CreatePlayerByCMJoin(hum, @@ -716,61 +717,6 @@ void RoomMgr::TeamRoomTimeOut(const std::string& team_uuid) } } -#if 0 -void RoomMgr::OnJoinResponse(JoinRequest* req) -{ - f8::MsgHdr& hdr = req->hdr; - cs::CMJoin& msg = req->msg; - int game_times = 0; - RoomType_e self_room_type = GetHumanRoomType(msg, game_times); - if (self_room_type < RT_OldBrid1) { - self_room_type = RT_OldBrid1; - } - time_t register_time = f8::ExtractRegisterTimeFromSessionId(msg.session_id()); - int proto_version = msg.proto_version(); - int channel = f8::ExtractChannelIdFromAccountId(msg.account_id()); - Room* room = GetJoinableRoom(msg, - self_room_type, - game_times, - register_time, - proto_version, - channel - ); - if (!room) { - JoinErrorHandle(msg, 3, hdr.socket_handle); - return; - } - Player* hum = room->NewPlayer(); - hum->ProcPreSettlementInfo(msg.pre_settlement_info()); - PlayerMgr::Instance()-> - CreatePlayerByCMJoin(hum, - hdr.ip_saddr, - hdr.socket_handle, - msg - ); - hum->meta = MetaMgr::Instance()->GetPlayer(msg.hero_id()); - if (!hum->meta) { - hum->meta = MetaMgr::Instance()->human_meta; - } - hum->room = room; - room->AddPlayer(hum); - hum->ProcPrepareItems(msg.prepare_items()); - hum->ProcPrepareItems2(msg.prepare_items2()); - hum->ProcSkillList(msg.skill_list()); - PlayerMgr::Instance()->IncAccountNum(msg.account_id()); - if (JsonDataMgr::Instance()->channel != 0 && - JsonDataMgr::Instance()->channel != channel) { - a8::UdpLog::Instance()->Warning - ("join room channel not match channel:%d account_id:%s", - { - JsonDataMgr::Instance()->channel, - msg.account_id() - }); - } - OnJoinRoomOk(msg, hum); -} -#endif - void RoomMgr::SendGetBattleData(int mode, std::vector>& join_msgs, std::function<