diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 4fff4e6..79809c9 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -461,10 +461,11 @@ void Human::BeKill(int killer_id, const std::string& killer_name, int weapon_id) if (!dead && !room->game_over) { if (immediately_revive_times_ > 0) { --immediately_revive_times_; + dead = true; status = 0; ClearBuffList(); room->frame_event.AddDead(this, 0); - room->xtimer.AddDeadLineTimerAndAttach(1, + room->xtimer.AddDeadLineTimerAndAttach(2, a8::XParams() .SetSender(this), [] (const a8::XParams& param) @@ -1859,6 +1860,7 @@ void Human::Revive() skill_dir = a8::Vec2(); skill_param1 = 0.0f; playing_skill = false; + SyncAroundPlayers(); } void Human::ImmediatelyRevive() @@ -1881,6 +1883,7 @@ void Human::ImmediatelyRevive() skill_dir = a8::Vec2(); skill_param1 = 0.0f; playing_skill = false; + SyncAroundPlayers(); } void Human::SelectSkillTargets(const a8::Vec2& target_pos, std::set& target_list) diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 4e61047..1311ebb 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -749,12 +749,12 @@ int Room::GetAliveTeamNum() return num; } -bool Room::CanJoin(const std::string& accountid, const std::string& team_uuid) +bool Room::CanJoin(const cs::CMJoin& msg) { if (gas_data.gas_mode != kGasInactive) { return false; } - if (accountid_hash_.find(accountid) != accountid_hash_.end()) { + if (accountid_hash_.find(msg.account_id()) != accountid_hash_.end()) { return false; } if (App::Instance()->HasFlag(5)) { diff --git a/server/gameserver/room.h b/server/gameserver/room.h index 589a83f..5860dac 100644 --- a/server/gameserver/room.h +++ b/server/gameserver/room.h @@ -11,6 +11,7 @@ namespace cs { + class CMJoin; class SMUiUpdate; } @@ -95,7 +96,7 @@ public: bool BattleStarted(); int GetAliveTeamNum(); std::set* GetAliveTeam(); - bool CanJoin(const std::string& accountid, const std::string& team_uuid); + bool CanJoin(const cs::CMJoin& msg); void OnPlayerOffline(Player* hum); Obstacle* CreateObstacle(int id, float x, float y); bool IsGameOver(); diff --git a/server/gameserver/roommgr.cc b/server/gameserver/roommgr.cc index 38abfe9..38559c1 100644 --- a/server/gameserver/roommgr.cc +++ b/server/gameserver/roommgr.cc @@ -46,7 +46,7 @@ void RoomMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg) if (!hum_meta) { abort(); } - Room* room = GetJoinableRoom(msg.account_id(), msg.team_uuid()); + Room* room = GetJoinableRoom(msg); if (!room) { room = new Room(); room->room_uuid = App::Instance()->NewUuid(); @@ -99,10 +99,10 @@ int RoomMgr::OverRoomNum() return over_room_hash_.size(); } -Room* RoomMgr::GetJoinableRoom(const std::string& account_id, const std::string& team_uuid) +Room* RoomMgr::GetJoinableRoom(const cs::CMJoin& msg) { for (auto& pair : inactive_room_hash_) { - if (pair.second->CanJoin(account_id, team_uuid)) { + if (pair.second->CanJoin(msg)) { return pair.second; } } diff --git a/server/gameserver/roommgr.h b/server/gameserver/roommgr.h index cb93dc1..dbeb1a3 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 std::string& account_id, const std::string& team_uuid); + Room* GetJoinableRoom(const cs::CMJoin& msg); void ReportServerState(int instance_id, const std::string& host, int port); void FreeOverRoom(long long room_uuid);