osgrid.org
https://forums.osgrid.org/

OpenSim Version Checker
https://forums.osgrid.org/viewtopic.php?f=5&t=1491
Page 1 of 1

Author:  Warin Cascabel [ Mon Jul 13, 2009 4:01 pm ]
Post subject:  OpenSim Version Checker

OpenSim Version Checker
(for obsessive-compulsive region owners)

Do you run your regions on the cutting edge? Do you find yourself constantly checking SVN to see if there's a new version available?

With the OpenSim Version Checker script, you can simply take a confident glance towards an unobtrusive prim on your region, and let the cheerful green hovertext reassure you that... oh no! it's yellow! there's a new version available on SVN! Update! UPDATE!

{L_IMAGE}
Ahhh, that's better...

Just drop this script into a region where you have the rights to use osGetSimulatorVersion(), and let it do its magic.

{L_CODE}:
// Server Version Check - uses hovertext to show whether the simulator is running the most current revision.
//
// Version 1.0: 10 July 2009 by Warin Cascabel

// Color vectors for the text. Change these if you don't like the defaults.
//
vector Red = <1.0,0.0,0.0>;
vector Green = <0.0,1.0,0.0>;
vector Blue = <0.5,0.5,1.0>;
vector Yellow = <1.0,1.0,0.0>;

// Internal variables; don't bother changing them, as they'll be overwritten.
//
integer SimulatorVersion = 0;
integer SvnHeadVersion = 0;

// Indicate() actually displays the text. If you're not fond of hovertext, you could easily replace this with
//            some other method, such as drawing text on a prim with the dynamic texture functions.
//
Indicate( string text, vector color)
{
    llSetText( text, color, 1.0 );
}

// QuerySVN() attempts to retrieve the Web page of the SVN trunk revision. It's received by http_response().
//
QuerySVN()
{
    Indicate( "Checking SVN...", Blue );
    llHTTPRequest( "http://opensimulator.org/svn/opensim/trunk/", [], "" );
}

default
{
    // state_entry() retrieves the current simulator revision, pulls that data out of the string, and if it
    //               was successful, tries to query the SVN revision. If it couldn't pull the local simulator's
    //               revision, it just displays an error status and exits.
    //
    state_entry()
    {
        // Get simulator version - requires permission to use osGetSimulatorVersion() - and tries to pull out
        // the revision number by parsing the string into a list. This probably only works on the SVN version,
        // not on the prepackaged "stable" versions - but this script would be pretty meaningless for those
        // simulators anyway.
        //
        list parts = llParseString2List( osGetSimulatorVersion(), [ "OpenSim ", "(Dev)", " .", " " ], "" );
        SimulatorVersion = llList2Integer( parts, 1 ); // Get the version number
        if (SimulatorVersion == 0)                     // If it wasn't where we expected it, indicate error
        {
            Indicate( "Unknown Revision", Red );
            return;
        }
        QuerySVN();             // Try to get the head version on SVN.
        llSetTimerEvent( 600 ); // check every ten minutes.
    }
   
    // The timer() event handler should be called every ten minutes, give or take a few milliseconds.
    //
    timer()
    {
        QuerySVN();
    }
   
    // http_response() processes the data returned from opensimulator.org
    //
    http_response( key id, integer status, list metadata, string data )
    {
        if (status == 200) // HTTP success status
        {
            list parts = llParseString2List( data, [ "Revision ", ": /trunk" ], [] ); // Try to get the revision number
            if (llGetListLength( parts ) > 2) // at least one of the "separator" text was present
            {
                SvnHeadVersion = llList2Integer( parts, 1 );            // Get the revision number.
                if (SvnHeadVersion == 0)                                // If it was 0, we didn't get what we needed
                {
                    Indicate( "Unexpected data from SVN", Red );        // Indicate error
                    return;                                             // and exit
                }
                vector color = Yellow;                                  // Yellow = versions mismatch
                if (SvnHeadVersion == SimulatorVersion) color = Green;  // Green  = versions match
                Indicate( "Server is r" + (string) SimulatorVersion + "\nSVN is r" + (string) SvnHeadVersion, color );
            }
            else // the "separator" text was not present
                Indicate( "Invalid Data", Red );
        }
        else // anything other than HTTP success
            Indicate( "HTTP Error " + (string) status, Red );
    }
}

Author:  Maik Galaxy [ Sun Jul 19, 2009 8:14 am ]
Post subject:  Re: OpenSim Version Checker

Hello,

i become a Script-Error.. :(

{L_CODE}:
Primitive: Runtime error:


Server stack trace:

   bei OpenSim.Region.ScriptEngine.Shared.Api.OSSL_Api.OSSLError(String msg) in j:\OpenSimulator\OpenSim-Source\OpenSim-Trunk\OpenSim\Region\ScriptEngine\Shared\Api\Implementation\OSSL_Api.cs:Zeile 183.

   bei OpenSim.Region.ScriptEngine.Shared.Api.OSSL_Api.CheckThreatLevel(ThreatLevel level, String function) in j:\OpenSimulator\OpenSim-Source\OpenSim-Trunk\OpenSim\Region\ScriptEngine\Shared\Api\Implementation\OSSL_Api.cs:Zeile 261.

   bei OpenSim.Region.ScriptEngine.Shared.Api.OSSL_Api.osGetSimulatorVersion() in j:\OpenSimulator\OpenSim-Source\OpenSim-Trunk\OpenSim\Region\ScriptEngine\Shared\Api\Implementation\OSSL_Api.cs:Zeile 1142.

   bei System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)

   bei System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object ser


You can help meh? :)

Author:  Warin Cascabel [ Sun Jul 19, 2009 11:57 am ]
Post subject:  Re: OpenSim Version Checker

W!cKeD {L_WROTE}:
i become a Script-Error.. :( You can help meh? :)


The script needs to be running in a region where the script owner has rights to call the osGetSimulatorVersion().

In OpenSim.ini, you need to explicitly enable that function (either for one or more avatar UUIDs, or for everyone) under the section for whichever scripting engine(s) you're using. I believe the default is now XEngine, so open up your OpenSim.ini file and search for the [XEngine] section.

Down towards the end of the [XEngine] section, there should be a comment:
{L_CODE}:
    ; Comma separated list of UUIDS allows the function for that list of UUIDS
    ; Allow_osSetRegionWaterHeight = 888760cb-a3cf-43ac-8ea4-8732fd3ee2bb


If you want only scripts owned by you to be able to tell what simulator version is running, add this line under that comment:
{L_CODE}:
    Allow_osGetSimulatorVersion = (your UUID)


(Replace "(your UUID)" with your avatar's actual UUID.) If you want to allow anyone's scripts to be able to check the simulator version, add this line instead:
{L_CODE}:
    Allow_osGetSimulatorVersion = true

Author:  Maik Galaxy [ Sun Jul 19, 2009 12:46 pm ]
Post subject:  Re: OpenSim Version Checker

Thanks it Works :)

It where nice, the Script viewtopic.php?f=5&t=1443 with yours :)

What is better XEngine or ScriptEngine.DotNetEngine?

Author:  Warin Cascabel [ Sun Jul 19, 2009 1:37 pm ]
Post subject:  Re: OpenSim Version Checker

W!cKeD {L_WROTE}:
What is better XEngine or ScriptEngine.DotNetEngine?


XEngine; it's faster, and variables within your scripts are saved if you restart your region (usually).

Author:  Maik Galaxy [ Mon Jul 20, 2009 11:13 am ]
Post subject:  Re: OpenSim Version Checker

Warin Cascabel {L_WROTE}:
W!cKeD {L_WROTE}:
What is better XEngine or ScriptEngine.DotNetEngine?


XEngine; it's faster, and variables within your scripts are saved if you restart your region (usually).


Thanks, Bro

Ive changed to XEngine :)

Author:  Digital Fortress [ Tue May 24, 2011 5:16 am ]
Post subject:  Re: OpenSim Version Checker

Hi,
Just tried this script out, and it throws up a '500' error, anyone a clue iof how to fix?

Author:  Key Gruin [ Wed May 25, 2011 9:23 am ]
Post subject:  Re: OpenSim Version Checker

Opensimulator doesn't use SVN for version control anymore, it uses GIT. Possibly that can be modified in the script, but I am a script dummy so have no clue.

Author:  RavenDove Stormcloud [ Mon Jul 16, 2012 10:02 am ]
Post subject:  Re: OpenSim Version Checker

Ok, I thought I knew where to get my avis uuid, but I have forgotton :roll: Where do I get that again :?: :oops:

Author:  Key Gruin [ Mon Jul 16, 2012 8:01 pm ]
Post subject:  Re: OpenSim Version Checker

Most viewers will show it in your profile, unfortunately some V3 viewers only look for web profiles. Or the Wright Plaza landing zone has a UUID giver.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/