添加调试信息
This commit is contained in:
parent
793275c8a3
commit
5bb68a169e
@ -285,7 +285,7 @@ void Human::Shot(a8::Vec2& target_dir)
|
||||
AutoLoadingBullet();
|
||||
}
|
||||
need_sync_active_player = true;
|
||||
SyncAroundPlayers();
|
||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
@ -306,7 +306,7 @@ void Human::Shot(a8::Vec2& target_dir)
|
||||
AutoLoadingBullet();
|
||||
}
|
||||
need_sync_active_player = true;
|
||||
SyncAroundPlayers();
|
||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -619,11 +619,11 @@ void Human::UpdatePoisoning()
|
||||
poisoning_time -= 1000;
|
||||
}
|
||||
if (need_notify && entity_subtype == EST_Player) {
|
||||
SyncAroundPlayers();
|
||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
}
|
||||
}
|
||||
|
||||
void Human::SyncAroundPlayers()
|
||||
void Human::SyncAroundPlayers(const char* file, int line, const char* func)
|
||||
{
|
||||
for (auto& cell : grid_list) {
|
||||
for (Human* hum : cell->human_list) {
|
||||
@ -762,7 +762,7 @@ void Human::BeKill(int killer_id, const std::string& killer_name, int weapon_id)
|
||||
} else {
|
||||
((Human*)hum)->stats.kills++;
|
||||
((Human*)hum)->kill_humans.insert(this);
|
||||
((Human*)hum)->SyncAroundPlayers();
|
||||
((Human*)hum)->SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
if (weapon_id == VW_Tank) {
|
||||
std::string msg = a8::Format("%s 使用 %s 干掉了 %s",
|
||||
{
|
||||
@ -831,7 +831,7 @@ void Human::BeKill(int killer_id, const std::string& killer_name, int weapon_id)
|
||||
health = 0.0f;
|
||||
dead_frameno = room->frame_no;
|
||||
room->OnHumanDie(this);
|
||||
SyncAroundPlayers();
|
||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
if (team_members) {
|
||||
for (auto& hum : *team_members) {
|
||||
if (hum != this && hum->action_type == AT_Relive &&
|
||||
@ -857,7 +857,7 @@ void Human::BeKill(int killer_id, const std::string& killer_name, int weapon_id)
|
||||
member->health = 0.0f;
|
||||
member->dead_frameno = room->frame_no;
|
||||
member->room->OnHumanDie(this);
|
||||
member->SyncAroundPlayers();
|
||||
member->SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
member->SendGameOver();
|
||||
room->xtimer.DeleteTimer(member->downed_timer);
|
||||
member->downed_timer = nullptr;
|
||||
@ -938,7 +938,7 @@ void Human::DecHP(float dec_hp, int killer_id, const std::string& killer_name, i
|
||||
}
|
||||
}
|
||||
}
|
||||
SyncAroundPlayers();
|
||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
}
|
||||
|
||||
void Human::AddToNewObjects(Entity* entity)
|
||||
@ -1011,7 +1011,7 @@ void Human::Land()
|
||||
}
|
||||
}
|
||||
FindLocation();
|
||||
SyncAroundPlayers();
|
||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
}
|
||||
|
||||
void Human::DoJump()
|
||||
@ -1020,7 +1020,7 @@ void Human::DoJump()
|
||||
a8::UnSetBitFlag(status, HS_Fly);
|
||||
a8::SetBitFlag(status, HS_Jump);
|
||||
jump_frameno = room->frame_no;
|
||||
SyncAroundPlayers();
|
||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
room->xtimer.AddDeadLineTimerAndAttach(MetaMgr::Instance()->jump_time * SERVER_FRAME_RATE,
|
||||
a8::XParams()
|
||||
.SetSender(this),
|
||||
@ -1228,7 +1228,7 @@ void Human::DoGetDown()
|
||||
tank_oil_value = 0.0f;
|
||||
tank_oil_max = 0.0f;
|
||||
RecalcSelfCollider();
|
||||
SyncAroundPlayers();
|
||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
room->NotifyUiUpdate();
|
||||
need_sync_active_player = true;
|
||||
}
|
||||
@ -1850,7 +1850,7 @@ void Human::UpdateAction()
|
||||
stats.heal_amount += health - old_health;
|
||||
DecInventory(item_meta->i->_inventory_slot(), 1);
|
||||
need_sync_active_player = true;
|
||||
SyncAroundPlayers();
|
||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1882,7 +1882,7 @@ void Human::UpdateAction()
|
||||
hum->health += param.param1.GetDouble();
|
||||
hum->health = std::min(hum->health, hum->GetMaxHP());
|
||||
hum->stats.heal_amount += hum->health - old_health;
|
||||
hum->SyncAroundPlayers();
|
||||
hum->SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
if (hum->room->frame_no - hum->pain_killer_frameno > hum->pain_killer_lastingtime * SERVER_FRAME_RATE) {
|
||||
hum->room->xtimer.DeleteTimer(hum->pain_killer_timer);
|
||||
hum->pain_killer_timer = nullptr;
|
||||
@ -1924,7 +1924,7 @@ void Human::UpdateAction()
|
||||
}
|
||||
++hum->stats.rescue_member;
|
||||
}
|
||||
hum->SyncAroundPlayers();
|
||||
hum->SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -2355,7 +2355,7 @@ void Human::ProcLootSkin(Loot* entity, MetaData::Equip* item_meta)
|
||||
pos = entity->pos;
|
||||
RecalcSelfCollider();
|
||||
RecalcBuff();
|
||||
SyncAroundPlayers();
|
||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
room->TakeOnCarObject(skin_tank.tank_uniid);
|
||||
room->NotifyUiUpdate();
|
||||
room->frame_event.AddTankBulletNumChg(this);
|
||||
@ -2383,7 +2383,7 @@ void Human::ProcLootSkin(Loot* entity, MetaData::Equip* item_meta)
|
||||
skill_meta = nullptr;
|
||||
}
|
||||
RecalcBuff();
|
||||
SyncAroundPlayers();
|
||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ class Human : public Entity
|
||||
float GetRadius();
|
||||
float GetMaxHP();
|
||||
void UpdatePoisoning();
|
||||
void SyncAroundPlayers();
|
||||
void SyncAroundPlayers(const char* file, int line, const char* func);
|
||||
void AutoLoadingBullet(bool manual = false);
|
||||
void StartAction(ActionType_e action_type,
|
||||
int action_duration,
|
||||
|
@ -183,7 +183,7 @@ void Player::UpdateSelectWeapon()
|
||||
curr_weapon = weapon;
|
||||
ResetAction();
|
||||
need_sync_active_player = true;
|
||||
SyncAroundPlayers();
|
||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
if (old_weapon != weapon) {
|
||||
AutoLoadingBullet();
|
||||
}
|
||||
@ -397,7 +397,7 @@ void Player::Shot()
|
||||
}
|
||||
}
|
||||
need_sync_active_player = true;
|
||||
SyncAroundPlayers();
|
||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
@ -420,7 +420,7 @@ void Player::Shot()
|
||||
}
|
||||
}
|
||||
need_sync_active_player = true;
|
||||
SyncAroundPlayers();
|
||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -525,7 +525,7 @@ void Player::LootInteraction(Loot* entity)
|
||||
weapons[0].Recalc();
|
||||
}
|
||||
need_sync_active_player = true;
|
||||
SyncAroundPlayers();
|
||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
} else {
|
||||
Weapon* weapon = nullptr;
|
||||
if (weapons[GUN_SLOT1].weapon_id == 0) {
|
||||
@ -556,7 +556,7 @@ void Player::LootInteraction(Loot* entity)
|
||||
weapon->Recalc();
|
||||
AutoLoadingBullet();
|
||||
need_sync_active_player = true;
|
||||
SyncAroundPlayers();
|
||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -655,7 +655,7 @@ void Player::LootInteraction(Loot* entity)
|
||||
AutoLoadingBullet();
|
||||
}
|
||||
need_sync_active_player = true;
|
||||
SyncAroundPlayers();
|
||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -819,7 +819,7 @@ void Player::ProcPrepareItems(const ::google::protobuf::RepeatedField< ::google:
|
||||
}//end for
|
||||
need_sync_active_player = true;
|
||||
if (prepare_items.size() > 0) {
|
||||
SyncAroundPlayers();
|
||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1003,7 +1003,7 @@ void Player::UpdateDropWeapon()
|
||||
}
|
||||
}
|
||||
need_sync_active_player = true;
|
||||
SyncAroundPlayers();
|
||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user