流量优化

This commit is contained in:
aozhiwei 2020-07-07 19:50:49 +08:00
parent bcf7da98fe
commit e55e61026b
2 changed files with 4 additions and 0 deletions

View File

@ -231,3 +231,4 @@ const int DEFAULT_BORN_POINT_X = 3000;
const int DEFAULT_BORN_POINT_Y = 3000;
const int FIXED_OBJECT_MAXID = 1024;
const int VIEW_RANGE = 512;

View File

@ -35,6 +35,9 @@ cs::SMUpdate* FrameMaker::MakeUpdateMsg(const Human* hum)
continue;
}
}
if (((Human*)hum)->pos.ManhattanDistance(entity->pos) > VIEW_RANGE + 100) {
continue;
}
entity->FillMFObjectPart((Human*)hum, msg->add_part_objects());
}
for (auto& itr : hum->del_objects) {