Change font size
It is currently Sat Dec 15, 2018 2:00 pm

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 10 posts ]
Author Message
 Post subject: OpenSim Version Checker
PostPosted: Mon Jul 13, 2009 4:01 pm 
Site Admin
User avatar

Joined: Wed Jul 16, 2008 7:22 pm
Posts: 186
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 );
    }
}


Top
 Profile  
 
 Post subject: Re: OpenSim Version Checker
PostPosted: Sun Jul 19, 2009 8:14 am 

Joined: Mon Jun 22, 2009 7:48 pm
Posts: 4
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? :)

_________________
Ingame: Maik Galaxy - El Diablo
www.OpenSimgerman.us - German Help Site


Top
 Profile  
 
 Post subject: Re: OpenSim Version Checker
PostPosted: Sun Jul 19, 2009 11:57 am 
Site Admin
User avatar

Joined: Wed Jul 16, 2008 7:22 pm
Posts: 186
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


Top
 Profile  
 
 Post subject: Re: OpenSim Version Checker
PostPosted: Sun Jul 19, 2009 12:46 pm 

Joined: Mon Jun 22, 2009 7:48 pm
Posts: 4
Thanks it Works :)

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

What is better XEngine or ScriptEngine.DotNetEngine?

_________________
Ingame: Maik Galaxy - El Diablo
www.OpenSimgerman.us - German Help Site


Top
 Profile  
 
 Post subject: Re: OpenSim Version Checker
PostPosted: Sun Jul 19, 2009 1:37 pm 
Site Admin
User avatar

Joined: Wed Jul 16, 2008 7:22 pm
Posts: 186
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).


Top
 Profile  
 
 Post subject: Re: OpenSim Version Checker
PostPosted: Mon Jul 20, 2009 11:13 am 

Joined: Mon Jun 22, 2009 7:48 pm
Posts: 4
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 :)

_________________
Ingame: Maik Galaxy - El Diablo
www.OpenSimgerman.us - German Help Site


Top
 Profile  
 
 Post subject: Re: OpenSim Version Checker
PostPosted: Tue May 24, 2011 5:16 am 

Joined: Thu May 19, 2011 7:38 am
Posts: 6
Hi,
Just tried this script out, and it throws up a '500' error, anyone a clue iof how to fix?


Top
 Profile  
 
 Post subject: Re: OpenSim Version Checker
PostPosted: Wed May 25, 2011 9:23 am 
Site Admin
User avatar

Joined: Sun Feb 22, 2009 1:39 pm
Posts: 402
Location: Wisconsin, USA
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.


Top
 Profile  
 
 Post subject: Re: OpenSim Version Checker
PostPosted: Mon Jul 16, 2012 10:02 am 

Joined: Wed Dec 09, 2009 10:31 pm
Posts: 1
Ok, I thought I knew where to get my avis uuid, but I have forgotton :roll: Where do I get that again :?: :oops:


Top
 Profile  
 
 Post subject: Re: OpenSim Version Checker
PostPosted: Mon Jul 16, 2012 8:01 pm 
Site Admin
User avatar

Joined: Sun Feb 22, 2009 1:39 pm
Posts: 402
Location: Wisconsin, USA
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.


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


Who is online

Users browsing this forum: No registered users and 2 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