diff --git a/server/gameserver/app.cc b/server/gameserver/app.cc index e5a4871..5b16789 100755 --- a/server/gameserver/app.cc +++ b/server/gameserver/app.cc @@ -110,64 +110,8 @@ static void SavePerfLog() f8::HttpClientPool::Instance()->max_user_request_delay = 0; } -static void HttpTest() -{ - for (int i = 0; i < 70; ++i) { - a8::Timer::Instance()->AddRepeatTimer(100 + rand() % 1000, - a8::XParams(), - [] (const a8::XParams& param) - { - f8::HttpClientPool::Instance()->HttpGet( - a8::XParams(), - nullptr, - nullptr, - //"http://game2001-test.kingsome.cn/webapp/index.php?c=Ops&a=selfChecking", - "http://192.144.140.87:7101/webapp/index.php?c=Ops&a=selfChecking", - //("http://127.0.0.1:7112/webapp/index.php?c=Ops&a=selfChecking&time=" + a8::XValue(a8::XGetTickCount() + rand()).GetString()).c_str(), - a8::XObject(), - MAX_SYS_HTTP_NUM + (rand() % MAX_USER_HTTP_NUM) - ); - }); - } -} - -static void test() -{ - { - std::map test_hash; - for (int i = 0; i < 10; ++i) { - test_hash[a8::XValue(i).GetString()] = a8::XValue(i).GetString(); - } - std::map test_hash_copy; - - bool combin_ok = false; - do { - combin_ok = false; - int i = 0; - for (auto& pair1 : test_hash) { - for (auto& pair2 : test_hash_copy) { - ++i; - if (i > 3) { - std::string t1 = pair1.first; - std::string t2 = pair2.first; - test_hash.erase(t1); - test_hash.erase(t2); - test_hash_copy.erase(t1); - test_hash_copy.erase(t2); - combin_ok = true; - break; - } - } - } - } while(combin_ok); - } -} - bool App::Init(int argc, char* argv[]) { - #if 0 - test(); - #endif signal(SIGPIPE, SIG_IGN); this->argc = argc; this->argv = argv; @@ -241,9 +185,6 @@ bool App::Init(int argc, char* argv[]) } ); } - if (HasFlag(8)) { - HttpTest(); - } return true; } diff --git a/server/gameserver/constant.h b/server/gameserver/constant.h index eb075d9..f88c0e6 100755 --- a/server/gameserver/constant.h +++ b/server/gameserver/constant.h @@ -68,6 +68,15 @@ enum ActionType_e AT_Rescue = 4 }; +enum RoomType_e +{ + RT_FirstBrid = 0, + RT_NewBrid = 2, + RT_MidBrid = 3, + RT_OldBrid = 4, + RT_Max +}; + enum InventorySlot_e { IS_9MM = 0, diff --git a/server/gameserver/player.cc b/server/gameserver/player.cc index efba3c8..66939cf 100644 --- a/server/gameserver/player.cc +++ b/server/gameserver/player.cc @@ -691,6 +691,9 @@ void Player::LootInteraction(Loot* entity) void Player::HumanInteraction(Human* hum) { + if (downed) { + return; + } if (hum == this) { return; } diff --git a/server/gameserver/room.h b/server/gameserver/room.h index f3d48d1..e0b307b 100644 --- a/server/gameserver/room.h +++ b/server/gameserver/room.h @@ -17,15 +17,6 @@ namespace MetaData struct MapTplThing; } -enum RoomType_e -{ - RT_FirstBrid = 0, - RT_NewBrid = 2, - RT_MidBrid = 3, - RT_OldBrid = 4, - RT_Max -}; - struct timer_list; struct xtimer_list; class Entity; diff --git a/server/gameserver/roommgr.cc b/server/gameserver/roommgr.cc index e6ab49f..cbd2b25 100644 --- a/server/gameserver/roommgr.cc +++ b/server/gameserver/roommgr.cc @@ -103,9 +103,11 @@ void RoomMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg) }); return; } - Room* room = GetJoinableRoom(msg); + RoomType_e self_room_type = GetHumanRoomType(msg); + Room* room = GetJoinableRoom(msg, self_room_type); if (!room) { room = new Room(); + room->room_type = self_room_type; room->room_uuid = App::Instance()->NewUuid(); if (GetRoomByUuid(room->room_uuid)) { abort(); @@ -145,9 +147,8 @@ int RoomMgr::OverRoomNum() return over_room_hash_.size(); } -Room* RoomMgr::GetJoinableRoom(const cs::CMJoin& msg) +Room* RoomMgr::GetJoinableRoom(const cs::CMJoin& msg, const RoomType_e self_room_type) { - RoomType_e self_room_type = GetHumanRoomType(msg); std::vector> group_rooms; for (int i = 0; i < RT_Max; ++i) { group_rooms.push_back(std::vector()); diff --git a/server/gameserver/roommgr.h b/server/gameserver/roommgr.h index 4df83d7..f49b86b 100644 --- a/server/gameserver/roommgr.h +++ b/server/gameserver/roommgr.h @@ -31,7 +31,7 @@ class RoomMgr : public a8::Singleton void InstallReportStateTimer(); private: - Room* GetJoinableRoom(const cs::CMJoin& msg); + Room* GetJoinableRoom(const cs::CMJoin& msg, const RoomType_e self_room_type); void ReportServerState(int instance_id, const std::string& host, int port); void FreeOverRoom(long long room_uuid); bool IsLimitJoin();