You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.
This proposal is simply to add a new AGENT_LIST_LIMIT (or similar) constant to limit the maximum number of results returned by llGetAgentList().
Note: This is a repost of SCR-371 rather than a duplicate, as I do not have the ability to move issues.
Example
default {
touch_start(integerx) {
integercount = llGetRegionAgentCount();
listagents = llGetAgentList(AGENT_LIST_REGION, [AGENT_LIST_LIMIT, 20]);
integerlength = llGetListLength(agents); integeri;
if (!length) { llRegionSayTo(llDetectedKey(0), PUBLIC_CHANNEL, "No avatars found"); return; }
stringmessage = "Found " + (string)length + " avatar(s):";
for (i = 0; i < length; ++i) {
message += "\n\tsecondlife:///app/agent/" + llList2String(agents, i) + "/displayname";
}
if (length != count) { message += "\nThere may be further results"; }
llRegionSayTo(llDetectedKey(0), PUBLIC_CHANNEL, message);
}
}
This simple example will retrieve the first 20 avatars in the region, ensuring a predictable amount of memory is required.
Why is this feature important to you? How would it benefit the community?
Currently the llGetAgentList() function can return up to 100 results, which represents a minimum of 3,600 bytes (LSO @ 36-bytes UTF-8 per key) or 7,200 bytes (Mono @ 72-bytes UTF-16 per key) which is a lot of memory for a script, as it doesn't include the overhead of the list itself, or of processing its contents!
In the example above, if the output were generated for 100 results then in addition to the 7,200 bytes for the list you'd also need a further 15-16kb for the message, ignoring additional space for the manipulations; all-in you're talking half or more of a Mono script's memory! In an LSO script it is impossible to do much of use with the list without deleting it as you go (which is very slow), so far from ideal.
So yeah, an option to limit the results to what the script can actually handle is a must!
{
'Business Unit': ['Platform'],
'Date of First Response': '2022-07-16T10:35:53.385-0500',
'How would you like the feature to work?': 'This proposal is simply to add a new {{AGENT_LIST_LIMIT}} (or similar) constant to limit the maximum number of results returned by [{{llGetAgentList()}}|http://wiki.secondlife.com/wiki/LlGetAgentList].\r\n\r\nNote: This is a repost of SCR-371 rather than a duplicate, as I do not have the ability to move issues.\r\n\r\nh3. Example\r\n{code}default {\r\n touch_start(integer x) {\r\n integer count = llGetRegionAgentCount();\r\n list agents = llGetAgentList(AGENT_LIST_REGION, [AGENT_LIST_LIMIT, 20]);\r\n integer length = llGetListLength(agents); integer i;\r\n\r\n if (!length) { llRegionSayTo(llDetectedKey(0), PUBLIC_CHANNEL, "No avatars found"); return; }\r\n\r\n string message = "Found " + (string)length + " avatar(s):";\r\n for (i = 0; i < length; ++i) {\r\n message += "\\n\\tsecondlife:///app/agent/" + llList2String(agents, i) + "/displayname";\r\n }\r\n if (length != count) { message += "\\nThere may be further results"; }\r\n llRegionSayTo(llDetectedKey(0), PUBLIC_CHANNEL, message);\r\n }\r\n}{code}\r\n\r\nThis simple example will retrieve the first 20 avatars in the region, ensuring a predictable amount of memory is required.',
'ReOpened Count': 0.0,
'Severity': 'Unset',
'Target Viewer Version': 'viewer-development',
'Why is this feature important to you? How would it benefit the community?': "Currently the {{llGetAgentList()}} function can return up to 100 results, which represents a minimum of 3,600 bytes (LSO @ 36-bytes UTF-8 per key) or 7,200 bytes (Mono @ 72-bytes UTF-16 per key) which is a lot of memory for a script, as it doesn't include the overhead of the list itself, or of processing its contents!\r\n\r\nIn the example above, if the output were generated for 100 results then in addition to the 7,200 bytes for the list you'd also need a further 15-16kb for the message, ignoring additional space for the manipulations; all-in you're talking half or more of a Mono script's memory! In an LSO script it is impossible to do much of use with the list without deleting it as you go (which is very slow), so far from ideal.\r\n\r\nSo yeah, an option to limit the results to what the script can actually handle is a must!",
}
The text was updated successfully, but these errors were encountered:
Arrehn Oberlander commented at 2022-07-16T15:35:53Z, updated at 2022-07-16T15:38:29Z
This issue is even more important now with the 200-avatar capable regions, in anticipation that we will eventually want a llGetAgentList that returns the more avatars, and more script memory available to process them.
How would you like the feature to work?
This proposal is simply to add a new
AGENT_LIST_LIMIT
(or similar) constant to limit the maximum number of results returned byllGetAgentList()
.Note: This is a repost of SCR-371 rather than a duplicate, as I do not have the ability to move issues.
Example
This simple example will retrieve the first 20 avatars in the region, ensuring a predictable amount of memory is required.
Why is this feature important to you? How would it benefit the community?
Currently the
llGetAgentList()
function can return up to 100 results, which represents a minimum of 3,600 bytes (LSO @ 36-bytes UTF-8 per key) or 7,200 bytes (Mono @ 72-bytes UTF-16 per key) which is a lot of memory for a script, as it doesn't include the overhead of the list itself, or of processing its contents!In the example above, if the output were generated for 100 results then in addition to the 7,200 bytes for the list you'd also need a further 15-16kb for the message, ignoring additional space for the manipulations; all-in you're talking half or more of a Mono script's memory! In an LSO script it is impossible to do much of use with the list without deleting it as you go (which is very slow), so far from ideal.
So yeah, an option to limit the results to what the script can actually handle is a must!
Links
Related
Original Jira Fields
The text was updated successfully, but these errors were encountered: