Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
16346a4c
Commit
16346a4c
authored
2 years ago
by
Rye Mutt
Browse files
Options
Downloads
Patches
Plain Diff
Import Ansariel's patch to refresh map block data periodically
parent
d40da444
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/newview/llworldmap.cpp
+18
-1
18 additions, 1 deletion
indra/newview/llworldmap.cpp
indra/newview/llworldmap.h
+3
-0
3 additions, 0 deletions
indra/newview/llworldmap.h
with
21 additions
and
1 deletion
indra/newview/llworldmap.cpp
+
18
−
1
View file @
16346a4c
...
@@ -41,6 +41,7 @@
...
@@ -41,6 +41,7 @@
// Timers to temporise database requests
// Timers to temporise database requests
const
F32
AGENTS_UPDATE_TIMER
=
30.
f
;
// Seconds between 2 agent requests for a region
const
F32
AGENTS_UPDATE_TIMER
=
30.
f
;
// Seconds between 2 agent requests for a region
const
F32
REQUEST_ITEMS_TIMER
=
10.
f
*
60.
f
;
// Seconds before we consider re-requesting item data for the grid
const
F32
REQUEST_ITEMS_TIMER
=
10.
f
*
60.
f
;
// Seconds before we consider re-requesting item data for the grid
const
F64
BLOCK_UPDATE_TIMER
=
60.0
;
// Periodically update sim info
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// LLItemInfo
// LLItemInfo
...
@@ -310,6 +311,7 @@ void LLWorldMap::clearImageRefs()
...
@@ -310,6 +311,7 @@ void LLWorldMap::clearImageRefs()
void
LLWorldMap
::
clearSimFlags
()
void
LLWorldMap
::
clearSimFlags
()
{
{
mMapBlockLoaded
.
fill
(
false
);
mMapBlockLoaded
.
fill
(
false
);
mMapBlockLastUpdateOffsets
.
clear
();
}
}
LLSimInfo
*
LLWorldMap
::
createSimInfoFromHandle
(
const
U64
handle
)
LLSimInfo
*
LLWorldMap
::
createSimInfoFromHandle
(
const
U64
handle
)
...
@@ -618,6 +620,20 @@ void LLWorldMap::updateRegions(S32 x0, S32 y0, S32 x1, S32 y1)
...
@@ -618,6 +620,20 @@ void LLWorldMap::updateRegions(S32 x0, S32 y0, S32 x1, S32 y1)
y0
=
y0
/
MAP_BLOCK_SIZE
;
y0
=
y0
/
MAP_BLOCK_SIZE
;
y1
=
y1
/
MAP_BLOCK_SIZE
;
y1
=
y1
/
MAP_BLOCK_SIZE
;
block_last_update_map_t
new_offsets
;
F64
time_now
=
LLTimer
::
getElapsedSeconds
();
// Remove blocks that have been request more than BLOCK_UPDATE_TIMER ago
// so we re-request them for an update
for
(
block_last_update_map_t
::
iterator
it
=
mMapBlockLastUpdateOffsets
.
begin
();
it
!=
mMapBlockLastUpdateOffsets
.
end
();
++
it
)
{
if
((
time_now
-
it
->
second
)
<=
BLOCK_UPDATE_TIMER
)
{
new_offsets
[
it
->
first
]
=
it
->
second
;
}
}
mMapBlockLastUpdateOffsets
.
swap
(
new_offsets
);
// Load the region info those blocks
// Load the region info those blocks
auto
&
world_map_message
=
LLWorldMapMessage
::
instanceFast
();
auto
&
world_map_message
=
LLWorldMapMessage
::
instanceFast
();
for
(
S32
block_x
=
llmax
(
x0
,
0
);
block_x
<=
llmin
(
x1
,
MAP_BLOCK_RES
-
1
);
++
block_x
)
for
(
S32
block_x
=
llmax
(
x0
,
0
);
block_x
<=
llmin
(
x1
,
MAP_BLOCK_RES
-
1
);
++
block_x
)
...
@@ -625,11 +641,12 @@ void LLWorldMap::updateRegions(S32 x0, S32 y0, S32 x1, S32 y1)
...
@@ -625,11 +641,12 @@ void LLWorldMap::updateRegions(S32 x0, S32 y0, S32 x1, S32 y1)
for
(
S32
block_y
=
llmax
(
y0
,
0
);
block_y
<=
llmin
(
y1
,
MAP_BLOCK_RES
-
1
);
++
block_y
)
for
(
S32
block_y
=
llmax
(
y0
,
0
);
block_y
<=
llmin
(
y1
,
MAP_BLOCK_RES
-
1
);
++
block_y
)
{
{
S32
offset
=
block_x
|
(
block_y
*
MAP_BLOCK_RES
);
S32
offset
=
block_x
|
(
block_y
*
MAP_BLOCK_RES
);
if
(
!
mMapBlockLoaded
[
offset
])
if
(
!
mMapBlockLoaded
[
offset
]
||
mMapBlockLastUpdateOffsets
.
find
(
offset
)
==
mMapBlockLastUpdateOffsets
.
end
()
)
{
{
//LL_INFOS("WorldMap") << "Loading Block (" << block_x << "," << block_y << ")" << LL_ENDL;
//LL_INFOS("WorldMap") << "Loading Block (" << block_x << "," << block_y << ")" << LL_ENDL;
world_map_message
.
sendMapBlockRequest
(
block_x
*
MAP_BLOCK_SIZE
,
block_y
*
MAP_BLOCK_SIZE
,
(
block_x
*
MAP_BLOCK_SIZE
)
+
MAP_BLOCK_SIZE
-
1
,
(
block_y
*
MAP_BLOCK_SIZE
)
+
MAP_BLOCK_SIZE
-
1
);
world_map_message
.
sendMapBlockRequest
(
block_x
*
MAP_BLOCK_SIZE
,
block_y
*
MAP_BLOCK_SIZE
,
(
block_x
*
MAP_BLOCK_SIZE
)
+
MAP_BLOCK_SIZE
-
1
,
(
block_y
*
MAP_BLOCK_SIZE
)
+
MAP_BLOCK_SIZE
-
1
);
mMapBlockLoaded
[
offset
]
=
true
;
mMapBlockLoaded
[
offset
]
=
true
;
mMapBlockLastUpdateOffsets
[
offset
]
=
time_now
;
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llworldmap.h
+
3
−
0
View file @
16346a4c
...
@@ -278,6 +278,9 @@ class LLWorldMap final : public LLSingleton<LLWorldMap>
...
@@ -278,6 +278,9 @@ class LLWorldMap final : public LLSingleton<LLWorldMap>
// cases where a block is never retrieved and, because of this boolean being set, never re-requested
// cases where a block is never retrieved and, because of this boolean being set, never re-requested
std
::
array
<
bool
,
MAP_BLOCK_RES
*
MAP_BLOCK_RES
>
mMapBlockLoaded
;
// Telling us if the block of regions has been requested or not
std
::
array
<
bool
,
MAP_BLOCK_RES
*
MAP_BLOCK_RES
>
mMapBlockLoaded
;
// Telling us if the block of regions has been requested or not
typedef
std
::
map
<
S32
,
F64
>
block_last_update_map_t
;
block_last_update_map_t
mMapBlockLastUpdateOffsets
;
// Track location data : used while there's nothing tracked yet by LLTracker
// Track location data : used while there's nothing tracked yet by LLTracker
bool
mIsTrackingLocation
;
// True when we're tracking a point
bool
mIsTrackingLocation
;
// True when we're tracking a point
bool
mIsTrackingFound
;
// True when the tracking position has been found, valid or not
bool
mIsTrackingFound
;
// True when the tracking position has been found, valid or not
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment