Skip to content

Instantly share code, notes, and snippets.

@typhartez
Created April 3, 2020 13:32
Show Gist options
  • Select an option

  • Save typhartez/dd23ece23c69c9e142b21932cedfc5e0 to your computer and use it in GitHub Desktop.

Select an option

Save typhartez/dd23ece23c69c9e142b21932cedfc5e0 to your computer and use it in GitHub Desktop.
Simulator Hostname script

The function `llGetSimulatorHostname()\ has a 10 seconds delay. It's maybe good in SL or for region owners renting parcels, but not for region owners.

Taken from the SL Wiki, llGetEnv() gives the same result without delay.

// llGetEnv now offers an equivalent function without the 10 second delay.
SaySimulatorHostname()
{ 
    llOwnerSay("Simulator Hostname: " + llGetEnv("simulator_hostname") );
}
 
default
{
    on_rez(integer start_param)
    {
        SaySimulatorHostname();
    }
 
    changed(integer iChange)
    {
        if (iChange & (CHANGED_REGION_START|CHANGED_REGION))
            SaySimulatorHostname();
    }
 
    state_entry()
    {
        SaySimulatorHostname();
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment