diff --git a/server/gameserver/bullet.cc b/server/gameserver/bullet.cc index 88d5d9b5..114388d0 100644 --- a/server/gameserver/bullet.cc +++ b/server/gameserver/bullet.cc @@ -48,6 +48,9 @@ Bullet::~Bullet() void Bullet::Initialize() { + if (sender.Get() && sender.Get()->IsPlayer()) { + int i = 0; + } MoveableEntity::Initialize(); ability_ = sender.Get()->GetAbility(); is_curr_weapon = sender.Get()->GetCurrWeapon()->meta == gun_meta; @@ -401,7 +404,7 @@ void Bullet::MapServiceUpdate() float distance = GetPos().DistanceGlmVec3(born_pos.ToGlmVec3()); #ifdef DEBUG if (IsFlyHook()) { - a8::XPrintf("step_len:%f born_pos:%f,%f,%f curr_pos:%f,%f,%f old_pos:%f,%f,%f distance:%f\n", + a8::XPrintf("step_len:%f born_pos:%f,%f,%f curr_pos:%f,%f,%f old_pos:%f,%f,%f distance:%f %f\n", { step_len, born_pos.GetX(), @@ -416,7 +419,8 @@ void Bullet::MapServiceUpdate() GetPos().GetY(), GetPos().GetZ(), - distance + distance, + raycast_len_ }); } #endif diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 8b79021d..0786548d 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -1680,6 +1680,9 @@ void Room::FillTeam() } } } + for (auto& pair : team_hash_) { + pair.second->GenBattleUuid(); + } } void Room::InitAirDrop() diff --git a/server/gameserver/team.cc b/server/gameserver/team.cc index db7f209b..50a92c5a 100644 --- a/server/gameserver/team.cc +++ b/server/gameserver/team.cc @@ -427,3 +427,22 @@ void Team::GenBattleReportData(Human* player, a8::MutableXObject* params) } } + +void Team::GenBattleUuid() +{ + long long battle_uuid = 0; + for (Human* hum : members_) { + if (hum->battle_uuid) { + battle_uuid = hum->battle_uuid; + break; + } + } + if (!battle_uuid) { + battle_uuid = App::Instance()->NewUuid(); + } + + for (Human* hum : members_) { + hum->battle_uuid = battle_uuid; + hum->GetBattleContext()->battle_uuid = battle_uuid; + } +} diff --git a/server/gameserver/team.h b/server/gameserver/team.h index 6a29f661..a63228d0 100644 --- a/server/gameserver/team.h +++ b/server/gameserver/team.h @@ -47,6 +47,7 @@ class Team void FillSMGameOver(cs::SMGameOver& msg); void SendTeamBattleReport(Human* sender); void GenBattleReportData(Human* player, a8::MutableXObject* params); + void GenBattleUuid(); private: int team_id_ = 0;