Change font size
It is currently Wed Jul 24, 2019 4:11 am

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 4 posts ]
Author Message
 Post subject: REFERENCE: Region Ready - Responder Script (OpenSim SYSOP)
PostPosted: Sun Oct 24, 2010 10:14 am 
OSG Elite
User avatar

Joined: Wed Mar 11, 2009 3:57 pm
Posts: 444
This is for OpenSimulator SYSTEM OPERATORS.

Purpose of this:
To prevent logins to a region set (opensim instance) while it is still in Startup and loading scripts etc... which are known issues and often will crash the instance when people login to it while it is still starting up. This waits till everything is started and ready, then it enables Logins and people can enjoy the regions without crashing it while it's starting up.

What is Region Ready ?
This is a Notification that is sent to OpenSim Regions on channel -800 by the OpenSim when it starts up to notify that it has completed and is ready. When this is used in combination with StartDisabled = true it will prevent logins till RegionReady is signalled by OpenSim. Look in OpenSim.ini under the ; ## SYSTEM Section for StartDisabled = false and change that to true.

Usage:
Place the script in a prim on the region you wish to be the "control region" and when it hears the RegionReady signal it will then excecute the console commands.
You MUST enable the osConsoleCommand function in your OpenSim.ini and make certain that you place YOUR OWN UUID in there to prevent anyone else from using osConsoleCommand. Refer to http://opensimulator.org/wiki/OSSL_Enabling_Functions
Pro-Tip: After Enabling RegionReady. When you Start OpenSim up, watch your OPENSIM CONSOLE as it loads, when it is finally done loading all the scripts, you will see a message like this appear on console as shown below. The Last Region that is completed will give this message, so if you wish to wait till All Regions in a set are loaded, then place the Prim Containing the Script in the LAST REGION that is fully loaded. (that will usually be the region with the most scripts)

Console Message Example
{L_CODE}:
INFO  - OpenSim.Region.OptionalModules.Scripting.RegionReady.RegionReadyModule [RegionReady]: Region "REGION NAME" is ready: "server_startup,1,1," on channel -800


RegionReady - Responder Script
{L_CODE}:
// REGION-READY Responder Script
// ===================================================================================
// Tested & Operational on OpenSim 0.7.1 Dev 80f9022-r/14257 (interface version 6)
// Date: October.23.2010
// Created by WhiteStar Magic
// Version: 1.1b
//
// Use & share happily with anyone that could use it.
// WTFPL - Do What The Fuck You Want To Public License
// http://sam.zoy.org/wtfpl/
// ===================================================================================
// FUNCTION:
//  This listens on channel -800 for the region ready console command to come in
//  When it hears the region Ready it sends commands to the Console.
//
// REQUIREMENTS:
// In OpenSim.ini
//   in ### SYSTEM section
//   StartDisabled = true          Just Above [SMTP]
//
// [RegionReady]
//     enabled = true
//     channel_notify = -800
//
// [XEngine]
//   Allow_osConsoleCommand=UUID   See http://opensimulator.org/wiki/OSSL_Enabling_Functions
// ===================================================================================
//
string regionname;        // for This Scripts Home Region Name
integer NotifyMe = TRUE;  // set to FALSE to not get Region Start Notification IM
integer listen_handle;    // to allow for unloading the listener.  Cannot be unloaded from listen event, so done in touch event.

default
{
    on_rez(integer param)
    {
        llResetScript();
    }
   
    state_entry()
    {
        regionname = llGetRegionName();
        listen_handle = llListen(-800, "", "", "");
    }
   
    listen( integer channel, string name, key id, string message )
    {
        string currtime = (string)llGetTimestamp();
        llSetObjectDesc("RegionReady Heard @ "+currtime);
        osConsoleCommand("login enable");
        osConsoleCommand("login status");
        osConsoleCommand("monitor report"); // OPTIONAL gives post start stats of instance
        if(NotifyMe) llInstantMessage(llGetOwner(),"Region Ready Processed on "+regionname+" @ "+currtime+" UTC");
    }
   
    touch_end(integer num_detected)
    {
        if(llDetectedKey(0)==llGetOwner())
        {
            llOwnerSay(llGetObjectDesc()+" - "+(string)llGetTimestamp());
            llListenRemove(listen_handle);
        }
    }
   
    changed(integer mask)
    {
        // The 1024 Bit needs to be checked so the listen_handle is refreshed on region restart
        // same bitmask for CHANGED_REGION_RESTART = 1024; CHANGED_REGION_START = 1024; //LL Changed the constant from CHANGED_REGION_RESTART
        if(mask & 1024)
        {
            llResetScript();
        }
    }
}

_________________
No further support of any kind, for any of my materials. Use as/is whereis.
PLEASE UNSTICKY Any Stickied Posting by myself.


Top
 Profile  
 
 Post subject: Re: REFERENCE: Region Ready - Responder Script (OpenSim SYSOP)
PostPosted: Tue Oct 26, 2010 12:38 pm 
OSG Elite
User avatar

Joined: Wed Mar 11, 2009 3:57 pm
Posts: 444
The Above has been Tested on Windows 7, Win Server 2003 & 2008, UBUNTU 10 & Centos 5.3

In Console you should see messages similar to this extract from the Console Display.
NOTE: osConsoleCommand does not display the command issued on OpenSim Console by an in-world script.

{L_CODE}:
[RegionReady]: Region "FirstStar_Station" is ready: "server_startup,1,1," on channel -800

Enabling logins for region FirstStar_SW
Enabling logins for region FirstStar_W
Enabling logins for region FirstStar_NW
Enabling logins for region FirstStar_S
Enabling logins for region FirstStar_Station
Enabling logins for region FirstStar_N
Enabling logins for region FirstStar_SE
Enabling logins for region FirstStar_E
Enabling logins for region FirstStar_NE
Login in FirstStar_SW are enabled
Login in FirstStar_W are enabled
Login in FirstStar_NW are enabled
Login in FirstStar_S are enabled
Login in FirstStar_Station are enabled
Login in FirstStar_N are enabled
Login in FirstStar_SE are enabled
Login in FirstStar_E are enabled
Login in FirstStar_NE are enabled
13:33:45 - [MonitorModule]: FirstStar_SW reports Root Agent Count = 0 agent(s)
---- and much more -- cut for brevity ---

_________________
No further support of any kind, for any of my materials. Use as/is whereis.
PLEASE UNSTICKY Any Stickied Posting by myself.


Top
 Profile  
 
 Post subject: Re: REFERENCE: Region Ready - Responder Script (OpenSim SYSOP)
PostPosted: Sun Nov 28, 2010 1:41 am 
OSG Elite
User avatar

Joined: Sat Nov 06, 2010 10:19 am
Posts: 1047
Location: Czech Republic
Very cool feature, thank you :D


Top
 Profile  
 
 Post subject: Re: REFERENCE: Region Ready - Responder Script (OpenSim SYSOP)
PostPosted: Mon Apr 29, 2013 9:43 pm 
OSG Elite
User avatar

Joined: Wed Mar 11, 2009 3:57 pm
Posts: 444
PLEASE UNSTICKY THIS ASAP and Any other Stickied Posting by myself

_________________
No further support of any kind, for any of my materials. Use as/is whereis.
PLEASE UNSTICKY Any Stickied Posting by myself.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 4 posts ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net