|
Cryas Tokhes
Great Googley Moogley...
Join date: 8 Feb 2006
Posts: 124
|
06-27-2007 16:35
The delay in the dataserver function is killing me here. I have a script that logically works very well... however it pulls a dataserver query within a while loop. now the information from the dataserver does not come through until after the loop is finished. To try to correct this I am using a simple 'if' arguement to test the information within the dataserver request. however to try to loop again I have to recall another request from with a query result. My question would be if someone knew how to properly pull a dataserver request within a while loop and have it properly use the resulting data after the request in that same while loop.
|
|
RobbyRacoon Olmstead
Red warrior is hungry!
Join date: 20 Sep 2006
Posts: 1,821
|
06-27-2007 16:41
I don't believe that this can be done... LSL is non-reentrant, and does not process event notifications while any of the script's code is running, in a while loop for instance.
|
|
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
|
06-27-2007 16:50
You don't want to do this within a while loop. Besides the fact that no values will be returned until you finish your current loop code, the events themselves will start to queue up. When they hit a certain amount (64 events I believe), it would start to drop new ones. So it's safest to just process them one at a time.
One way then is to, say, make your first request somewhere and don't do anything else. Then when the dataserver event fires, do your processing in there, then make your next request at the end of the dataserver event. Keep a counter or pointer going, as you would in a while loop, so you know what to process next, or when you're done.
|
|
Cryas Tokhes
Great Googley Moogley...
Join date: 8 Feb 2006
Posts: 124
|
06-27-2007 17:47
From: RJ Source You don't want to do this within a while loop. Besides the fact that no values will be returned until you finish your current loop code, the events themselves will start to queue up. When they hit a certain amount (64 events I believe), it would start to drop new ones. So it's safest to just process them one at a time. One way then is to, say, make your first request somewhere and don't do anything else. Then when the dataserver event fires, do your processing in there, then make your next request at the end of the dataserver event. Keep a counter or pointer going, as you would in a while loop, so you know what to process next, or when you're done. This is what I have come to think of the only other way of doing this. However I am needing to re-request a query from the dataserver. The re-request is being ignored though. I even tried creating an outside function that is called by the dataserver result. Same result.
|
|
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
|
06-27-2007 17:49
Maybe you could post some code? Re-requests usually work ok.
|
|
Pip Helios
Registered User
Join date: 29 Sep 2006
Posts: 22
|
possible help....
06-27-2007 20:35
I wrote a script scanner that uses dataservers to pull up the owners, I initiate the dataserver with the first script scanned then within the dataserver event I have a for loop that recalls the event. It works.... well sometimes it drops a script or two due to time but it works.
|
|
Cryas Tokhes
Great Googley Moogley...
Join date: 8 Feb 2006
Posts: 124
|
06-28-2007 13:32
I was able to fix the issue. It is a little backwards but it was able to work out. Using the same agruements that I used for the 'while' loop, but instead it was in an 'if' statement that recalled the dataserver request at the end of the query result. It works pretty clean now. But logic wise it makes no sense.
|