Tammy Dallas Posted November 20 Posted November 20 (edited) It gets worse and worse, the system functions on checking in an avatar is online keeps lagging the offline flag, atm I have a game system I am making for SL, this system has a webpage that allows players to post their location and their game status, this is "Go Live" function I made so gamers could find each other that own my HUD. If you do not remove the HUD and log off SL it will keep showing them live. so I made a system for my server, that checks every 90 seconds for any players showing online, it runs their uuid through a function using llRequestAgentData(uuid, DATA_ONLINE); if they show offline it changes their database status so they do not show as a live player. It will not show them offline until I IM the account, and then SL system show them offline. Can not believe LL is lacking a system for players who do not log off and just use the X and close the window so I must be doing something wrong. I made a workaround where the script IM each player showing live after it checks their status, but that means they get a message every 120 seconds and is not a great way to work around this.any advice? checkNextAvatar() { if (currentIndex < llGetListLength(dataA)) { string uuid = llList2String(dataA, currentIndex); requestKey = llRequestAgentData(uuid, DATA_ONLINE); llSetTimerEvent(1.0); // Timer for the next check (1 second interval) } else { // llSay(0, "All UUIDs have been checked."); currentIndex = 0; // Reset index for future checks llSetTimerEvent(0.0); // Stop the timer } } Edited November 20 by Tammy Dallas
Qie Niangao Posted November 20 Posted November 20 This has always been up to fifteen minutes late, and there's considerable public support for making it stop working altogether, or to make it only available for users who want their online status public (which llRequestAgentData() simply ignores). But you mention a HUD, and if the real question is whether a HUD-wearing player is online, then the HUD could provide that information. There are several ways to do this, but to avoid needing an external service, I'd use the key-value pair storage of an Experience because it's available grid-wide, serves almost-instant updates, and unlike other Experience operations does not require any permissions. (It does, however, require that the script itself be compiled to an Experience, so somebody needs to be Premium to contribute that Experience.) A couple of ways come to mind for using the Experience KVP for this. The simplest way would be for each HUD to update "their" key with the unix time every minute or so, then anybody wanting to know if an avatar is online can just read that avatar's key-value pair for when it was last updated. That approach means every HUD-wearer must have a pair stored, but the storage is big and another process could go through and lazily sweep out pairs that haven't been online for five minutes or whatever. The other way is for those wanting to know if an avatar is online to post a query for that avatar's status, and then the avatar's HUD would poll for "their" query every minute, say, and post a reply for which the querying process is polling. This only uses space for the queries and responses, not for everybody whose status might be queried, but it takes a little more time to get a response. As with llRequestAgentData, everything with Experience KVP is asynchronous, accessible through dataserver events. 1
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now