lundi 4 octobre 2021

LSL - Adding a random time element to database queries to prevent flooding

I am working on an LSL (Linden Scripting Language) Script to be included in Radios and TVs to be distributed in-world to users within our specific community. The Radios & TVs will 'tune' the users land audio or media to a selected station via a menu. The URL's of the stations change regularly, especially during our 'special events', up-to once per hour at the top of the hour (for DJ handovers). To make the Radios and TVs work grid-wide, the URLs for the station streams will be updated to a cloud database every time they change. The Radios and TVs will query the database to check if the stream URL has changed every hour, but to prevent the database being flooded with queries at the same time, I want to create a random element, so the Scripts query the database for a changed URL at a random timeframe between a window of 2 minutes and 5 minutes past every hour. I have the database storage and retrieval syntax, but can anyone help with the LSL Script syntax to achieve the random time window trigger for the database query between the window of 2 mins and 5 mins past every hour?




Aucun commentaire:

Enregistrer un commentaire