Don't click here unless you want to be banned.

LSL Wiki : IGS

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl801.us.archive.org
Making A IGS (In Game Server) Written By ViceroLambert

Scripted LSL (Linden Second Language) Servers in SL (Second Life) run about the same way as a Real Life on would work. The "llEmail Tags" would work as a port going from one area to the next working over a wide area like from a Workstation to a DNS (Domain Name Server). But instead of ports and wires llEmail sends directly to a prims key or a outside email address.

Here is a example of a LSL server that when it gets a command from a out of sim device it sends back updated information. Just like a FTP (File Transfer Protocal) Server.


Device - Sends A Information Request For Texture When It Hears startup on Channel 0.
default
{
    state_entry() //Starts State
    {
        llListen( 0, "", NULL_KEY, "startup" ); //Starts to listion for startup
    }

    listen( integer channel, string name, key id, string message ) //chat collection
    {
        if ( id == llGetOwner() ) //Only allow owner to say this command.
        {
            llEmail("03ada148-cd2f-f9ed-60c4-e79251022fd2@lsl.secondlife.com", "request_startup_1", ""); //Send Message too prim key 03ada148-cd2f-f9ed-60c4-e79251022fd2.
        }
        else //If the chater is not the owner do somthing below this line.
        {
           
        }
    }
}

Server - Gets the request and resends the texture data to who ever sent the email.
default {
    state_entry() {

        
        llSetTimerEvent(0.1); //Starts Timer Event
    }
    
    timer() {
        llGetNextEmail("", "request_startup_1"); //Waits for email.
    }
    
    email(string time, string address, string subj, string message, integer num_left) { //Email Data
     
     llEmail(address+"@lsl.secondlife.com","6159fd53-d0ee-1a7b-c53c-d0df8989982a", ""); // When email is recived send main data back to address that was stringed on email data.
// This will not work. The address it gets has "@lsl.secondlife.com" attached already... this would come out at <key>@lsl.secondlife.com@lsl.secondlife.com
// So that line should just read - llEmail(address,"6159fd53-d0ee-1a7b-c53c-d0df8989982a", ""); ?? Correct me if I'm wrong ~ Rove Stromer 
       
    }
}

Device - Gets the information and sets the texture UUID from the server to the prim.

default {
    state_entry() {

        
        llSetTimerEvent(0.1);
    }
    
    timer() {
        llGetNextEmail("", ""); //Gets any emails coming to this object,
    }
    
    email(string time, string address, string subj, string message, integer num_left) { //email data
     
    llSetTexture(subj,ALL_SIDES); //Gets the subject of the email which holds the texture and sets it to all sides of the prim.
       
    }
}

I hope this helps you. If you have any questions feel free to contact me during my hours of 6-7pm Game Time.
Comments [Hide comments/form]
Should this be moved to examples? Because it isn't a complete script, I don't think it belongs here.
-- DolusNaumova (2005-11-03 07:32:20)
Yes examples sounds right.
-- BlindWanderer (2005-11-03 12:38:13)
I'm just a newb but I think it's a complete script.
Just a bare bones version.
The only issue I see is that the 2 device scripts should be put together.
But even that helped me with the learning curve.
I can see how this would be considered an example due to it's size.
But it's really a quite elegant primitive design perfect for beginners like me to build off of.
I think that it could stand to be referenced from an example page.
But which one? It's got a lot of commands that are essential to this type of script.
But I wouldn't have found it in an example page as easily as I did in the script ref page.
Please don't move it, just crossreferrence it if necessary.
-- BafiliusGoff (2006-03-31 13:28:47)
Perhaps TutorialInWorldServer would suit it better?
-- ChristopherOmega (2006-03-31 16:05:09)
I agree with Chris. This is more a tutorial than anything else. Next time I'm on SL I'll work on a more elaborate version and post it under a suitable name.
-- HazVega (2006-04-23 12:04:04)
Jesus, please dont poll in 0.1 second intervals, there is no need to do that with slow email. Please dont ruin the game fun with such stuff. I would suggest to use 3-5seconds instead. You should also check for number of queud messages and use llGetNextEmail() at the end of the email action. If you can, you should disable the timer in that case.

The introduction text of this page is somewhat missleading, chaotic and generally not helpfull.

Greetings BerndElswit
-- p54A34385.dip0.t-ipconnect.de (2007-04-01 10:47:18)
Attach a comment to this page: