This commit is contained in:
aozhiwei 2023-04-04 15:26:31 +08:00
parent 7e8a0b31bb
commit fb5ff4c375

View File

@ -1375,6 +1375,7 @@ void Human::SendUpdateMsg()
#ifdef DEBUG
long long begin_tick1 = a8::XGetTickCount();
long long end_tick1 = a8::XGetTickCount();
int sent_bytes = 0;
#endif
if (!follow_target_ && !a8::HasBitFlag(status, CS_Disable)) {
#ifdef DEBUG
@ -1408,6 +1409,9 @@ void Human::SendUpdateMsg()
begin_tick = a8::XGetTickCount();
#endif
NotifyObservers(msg, active_player_data_pb);
#ifdef DEBUG
sent_bytes += msg->ByteSize() + active_player_data_pb->ByteSize();
#endif
delete msg;
if (active_player_data_pb) {
@ -1420,6 +1424,12 @@ void Human::SendUpdateMsg()
#ifdef DEBUG
end_tick1 = a8::XGetTickCount();
if (end_tick1 - begin_tick1 > 100) {
f8::UdpLog::Instance()->Warning
("SendUpdateMsg sent_bytes:%d observers.size:%d",
{
sent_bytes,
observers_.size()
});
A8_ABORT();
}
#endif