This commit is contained in:
2025-07-10 17:06:53 +06:00
parent c0989a53ea
commit 62959a36b2
21 changed files with 2053 additions and 88 deletions

View File

@@ -11,6 +11,7 @@ namespace LV::Server {
ContentEventController::ContentEventController(std::unique_ptr<RemoteClient> &&remote)
: Remote(std::move(remote))
{
LastPos = Pos = {0, Remote->CameraPos};
}
uint16_t ContentEventController::getViewRangeBackground() const {
@@ -18,11 +19,11 @@ uint16_t ContentEventController::getViewRangeBackground() const {
}
ServerObjectPos ContentEventController::getLastPos() const {
return {0, Remote->CameraPos};
return LastPos;
}
ServerObjectPos ContentEventController::getPos() const {
return {0, Remote->CameraPos};
return Pos;
}
void ContentEventController::removeUnobservable(const ContentViewInfo_Diff& diff) {
@@ -97,4 +98,15 @@ void ContentEventController::onPortalUpdates(const std::vector<void*> &portals)
}
void ContentEventController::onUpdate() {
LastPos = Pos;
Pos.ObjectPos = Remote->CameraPos;
Pos::GlobalRegion r1 = LastPos.ObjectPos >> 12 >> 4 >> 2;
Pos::GlobalRegion r2 = Pos.ObjectPos >> 12 >> 4 >> 2;
if(r1 != r2) {
CrossedBorder = true;
}
}
}