|
Draco18s Majestic
Registered User
Join date: 19 Sep 2005
Posts: 2,744
|
01-21-2006 22:06
I've got a script that tracks the sales of my Lotto Ticket vendors (and the numbers and who bought the ticket) and keeps them in a growing string. When the program has collected almost enough to run out of memory (calculated based on the length of each addition to the string and the remaining memory) it would then email me that giant string and then delete it and start over.
Problem just occured: Last known number of tickets was 112 (29 of them already emailed) and no where close to memory issue levels and it crashed. The script no longer responds to any of its events (touch, listen, or timer for checking email). Just crashed. I need a way to extract the data the script holds so that I can reset the script without losing any data (there's no way I'm going to take the flak for losing 80 or more tickets probably purchased by over 20 people).
I can't just re-rez the object because I have on_rez(integer param) { llResetScript(); } in it. That would cause the scripts variables to be cleared and I don't want that. Please, somebody tell me there is a way to get at the data.
To Linden Labs: we need a variable viewer. A way to interact with variables in a given script as the script runs. I hate debug llOwnerSay() stuff just to passively watch what the variables are at certain points to find errors, I want to be able to stick my fingers in and watch one variable as I step though the script one line at a time. GIVE ME MY C++ DEBUGING! Sorry, I'm just a tad tweaked that the most useful scripting tool in all the multi-verse is missing and it could save me the anguish I'm suffering now with this frozen script. All I'd do it open the script, open a the script debug window and select a variable to copy the data to Notepad.
|
|
Introvert Petunia
over 2 billion posts
Join date: 11 Sep 2004
Posts: 2,065
|
01-21-2006 22:44
Gah, you try to code in a manner that doesn't beat upon the mail server and it bites you.
In case you might have missed the obvious (as have we all at times) verify that the Running box is checked on the relevant script. I've seen at least one instance where a script went into non-running state for no identifiable reason. If this is what happened, putting the script back into running state shouldn't cause an on_rez() or state_entry() to fire. However, if there was a runtime error (like stack-heap collision i.e. out of script memory) that put the script into non-running state, all the data is likely lost already.
The script data, if still there, is in principle recoverable, but not by you and I would not expect that you'd be likely to get LL to grovel through the VM for you, but you can try.
In the future, you might like to look at some of the ATM-type acknowledged transactions mechanisms to ensure that the ticket sale is either securely recorded off-world or the money is refunded. This is not simple code, but it is the best way to guard against this problem.
How do you code an off-line transaction base? Beats me, but it includes XML-RPC which would be a good place to start. Good luck
|
|
Draco18s Majestic
Registered User
Join date: 19 Sep 2005
Posts: 2,744
|
01-21-2006 22:52
Thanks for the reply. I don't think a heap error occured, I had enough space to store over 200 ticket numbers and the avatars' keys. I lost an estimated 80. I'll check to see if it has running checked. As for storing the data outside SL, that's why it emailed me ever 200 tickets (I think it could take 250 before a heap error, 14000+ bytes free and 55 characters per ticket). I didn't understand XML-RPC well enough to set up my sever box to do that (it requires me writing a C++/Per/Java/something program to check email, WTF). If it is set non-running I'll make a test to see if it triggers a variable reset or not before trying it. As for LL trudging though VM to find the data, who knows? I know a LL techie told me to post here as xe didn't know of a way to dredge up the data.
[Edit] The script is [x] Running. [Edit2] A friend had me run a for loop to see how many tickets it could actually store, here's what I learned: 84 tickets and a character takes up more space that 1 byte. A string of 55 characters takes up 150 bytes.
|
|
Introvert Petunia
over 2 billion posts
Join date: 11 Sep 2004
Posts: 2,065
|
01-21-2006 23:16
As you seem honorable and concerned that you took payment without getting a record or issuing a ticket, you may find that World->Account History can help you trace those who have paid your machine but for whom you didn't get a purchase email. This could allow you to refund to the accidentally "stiffed" players or perhaps allow you to manually correct for the data loss.
|
|
Draco18s Majestic
Registered User
Join date: 19 Sep 2005
Posts: 2,744
|
01-21-2006 23:17
Yeah, I'm doing that. It's a slow process. :-\
|