Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

AV list/memory question

Logan Bauer
Inept Adept
Join date: 13 Jun 2004
Posts: 2,237
11-17-2005 20:37
If I want to make a guestbook, or even an item that would simply keep track of the key of every AV who clicks on it, I could add their name or key to a list. But, script memory limitations would mean that I couldn't do this indefinitely with a ton of AV's because the list would grow too big. I was thinking of making an object that gives money or an object to an AV, but only once. Is there any easy way to do this without using an external database or some other data storage solution outside of SL? And if not, what's the best way to do this externally, given that I can write HTML and figure out enough to set up something like PHPBB, but don't have much webdev knowledge outside of that...
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
11-17-2005 21:15
Well, HTML doesn't exactly run a lot of db storage...though SQLServer is a really easy language to work with...and if you run outta storage space with a SQL DB, you can be sure you've given an item to everyone in the world (no, not everyone in SL...everyone in the real world).
_____________________
--AeonVox--

Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
Logan Bauer
Inept Adept
Join date: 13 Jun 2004
Posts: 2,237
11-18-2005 10:47
From: Kenn Nilsson
Well, HTML doesn't exactly run a lot of db storage...though SQLServer is a really easy language to work with...and if you run outta storage space with a SQL DB, you can be sure you've given an item to everyone in the world (no, not everyone in SL...everyone in the real world).


Hmm, well I'll look into learning SQLServer then, thankyou for your suggestion. To better illustrate how dense I am when it comes to this stuff... would just learning SQLServer be all that I need here, or would I need to use ASP or PHP or something to "tie it all together"?

Edit > Or is this all done through visual studio? And, will I need visual studio?
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
11-18-2005 10:53
I'm pretty clueless about off-world communication too, but since you can only send an email out from SL, I'm pretty sure you'll need to redirect that email to a script, Perl/PHP/Python/shell/whatever, and then use that script to parse the email's contents and then add make the mySQL calls to add them to the database.

Or every time the list gets to 20 (or whatever) entries, you could have the object IM you all the names and erase the list. Then you maintain the guestbook manually by saving those names in a notecard :)
Logan Bauer
Inept Adept
Join date: 13 Jun 2004
Posts: 2,237
11-18-2005 10:58
From: Ziggy Puff

Or every time the list gets to 20 (or whatever) entries, you could have the object IM you all the names and erase the list. Then you maintain the guestbook manually by saving those names in a notecard :)


Yah, I was even thinking, once the list gets full, have it e-mail me the list and then temporarily 'shut down' until I can take the list and hard-code it into seperate script modules... I'm just moving towards more complex projects and was wondering how hard it would be to make it more scalable...
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
11-18-2005 23:15
You'll really only need an ASP/PHP e-mail receiver and to throw the SQL code into it. Visual Studio is a great program if you have it...if not, you can do without. Additionally, SQL has helpers build into the program that will help you out immensely.

I also suggest looking into LLBLGen Pro if you want to do extensive database work with call-ups on a website.

It all depends on how in-depth you really wanna go.

Just remember...that once you send your data off SL, you'll get to bring it back as well :)
_____________________
--AeonVox--

Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
AJ DaSilva
woz ere
Join date: 15 Jun 2005
Posts: 1,993
11-19-2005 01:31
Hihi, just a thought: If you're gonna go for the manual update method you could store hashes rather than the full values so you don't have to do it so often.
_____________________
AJ DaSilva
woz ere
Join date: 15 Jun 2005
Posts: 1,993
11-19-2005 01:39
Actually... that wouldn't work, would it? Too little sleep to be sure atm, soz. :o
_____________________
Tezkat Murakami
Ebil Genius
Join date: 25 Sep 2005
Posts: 12
11-19-2005 07:55
Actually, this problem should be pretty simple to address without resorting to external storage.

I'd design it something like this: Install several essentially identical, numbered scripts to handle storage. A single script can easily store 100 keys in a global list, so let’s just pick that as a nice round number and say that each script holds 100 keys. When a new guestbook event is triggered, you dump a link message on the prim with the datastore, and each of them would look through their lists. If they find the guy, they trigger the "found" event. If nobody replies with a "found" event after [some reasonable time], the lowest non-full script (call it "x";) adds him to the list and triggers the "new guestbook entry" event. Once the list in script x is full, it sends out a "next guy, please take over" message to the others, and script x+1 becomes the place where new inserts happen. The neat thing about this design is that it can theoretically be expanded as your guest book grows--just add more storage scripts when your existing collection starts to fill up. :cool:
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
11-19-2005 09:18
From: Tezkat Murakami
Actually, this problem should be pretty simple to address without resorting to external storage.

I'd design it something like this: Install several essentially identical, numbered scripts to handle storage. A single script can easily store 100 keys in a global list, so let’s just pick that as a nice round number and say that each script holds 100 keys. When a new guestbook event is triggered, you dump a link message on the prim with the datastore, and each of them would look through their lists. If they find the guy, they trigger the "found" event. If nobody replies with a "found" event after [some reasonable time], the lowest non-full script (call it "x";) adds him to the list and triggers the "new guestbook entry" event. Once the list in script x is full, it sends out a "next guy, please take over" message to the others, and script x+1 becomes the place where new inserts happen. The neat thing about this design is that it can theoretically be expanded as your guest book grows--just add more storage scripts when your existing collection starts to fill up. :cool:


If you're going for such a solution there are some other options too that make the hunting around faster. You can, for example start with 15 scripts (1-f) and sort by first digit of the av's key. Key's are randomly distributed (but no initial 0), so that would give you about 1,500 people straight off. Then you add your extra scripts as needed. If you want to go further you do it on the first two digits of the key (I think that's 15^2, but maybe 15X16) so over 20,000 stored names. That's a pretty damn big guestbook.