Change font size
It is currently Sat Dec 15, 2018 12:57 pm

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 4 posts ]
Author Message
 Post subject: GetGridname via script
PostPosted: Fri Nov 13, 2009 7:57 pm 
Furious Typer

Joined: Fri Dec 12, 2008 9:47 am
Posts: 258
Hi

Due to a missing function to reliably get the Gridname I have created a service to get the Gridname. It can be used by anyone that needs the Gridname, eg when scripted objects are transfered to other grids via Hypergrid ;).

As it relies on a registered avatar in each grid, not all Grids are supported, but with your requests we will manage to get more Grids listed. Currently listed are SL, YAL, Grid4Us and OSGrid.

Until we have any kind of implemented Function for recieving Gridnames, I also recomend you voting for the Request here -> http://opensimulator.org/features/issue.php?id=150

GetGridname script
{L_CODE}:
// This GetGridname Script is provided by GridBay, use at own risk.
//
// This code can be used to receive the Gridname via script.
// More information can be found at http://www.gridbay.de/viewtopic.php?f=2&t=39

key http_request_id;

string grid = "unknown";
integer gridcheck = FALSE;

key g_quary_grid;
list requests;

default
{
    state_entry()
    {
        llOwnerSay( "Checking Grid ...");
        http_request_id = llHTTPRequest("http://62.75.177.153/server/gridcheck.php?mode=GET_GRIDLIST", [],"");
    }
    dataserver(key queryid, string data)
    {
        if ( llListFindList(requests, [ queryid ]) != FALSE)
        {
            gridcheck = FALSE;
            http_request_id = llHTTPRequest("http://62.75.177.153/server/gridcheck.php?mode=GETGRIDNAME&namecheck=" + llEscapeURL(data), [],"");
        }
    }

    http_response(key id, integer status, list meta, string body)
    {
        if (status == 499)
        {
            llOwnerSay( "ERROR 499");
        }
        else if (status != 200 )
        {
            llOwnerSay( "Page not found");
        }
        else if (id == http_request_id)
        {
            list n = llParseString2List(body, ["|"], []);
            if(llList2String(n,0) == "GRIDCHECK")
            {
                requests = [];
                integer i = 1;
                gridcheck = TRUE;
                while(i < llGetListLength(n) && gridcheck == TRUE)
                {
                    requests += llRequestAgentData(llList2Key(n, i), DATA_NAME);
                    i++;
                }
                gridcheck = FALSE;
            }
            else if(llList2String(n,0) == "GRIDNAME")
            {
                grid = llList2String(n,1);
                llOwnerSay("Welcome to " + grid);
            }
        }
    }
}

Please note that this script is a working example that can be used with other llRequestData() without problem, thus some codelines could be cut if not needed ;)

Have fun ;)
Michelle

_________________
{L_IMAGE}{L_IMAGE}{L_IMAGE}


Top
 Profile  
 
 Post subject: Re: GetGridname via script
PostPosted: Fri Nov 13, 2009 11:04 pm 
OSG Elite
User avatar

Joined: Wed Mar 11, 2009 3:57 pm
Posts: 444
You can use the osFunction: osGetGridNick();

You can work it as shown in snippet below:
{L_CODE}:
// Getting theGrid Nickname as defined in the Instance's OpenSim.ini
    string sThisGridName = osGetGridNick();
    llWhisper(0,"The Grid Name is = "+ sThisGridName );



This requires that Allow_osGetGridNick = true be set in the XEngine Section of OpenSim.ini
See this Example XEngine Example Below

{L_CODE}:
[XEngine]
    ; Enable this engine in this OpenSim instance
    Enabled = true

    ; How many threads to keep alive even if nothing is happening
    MinThreads = 2

    ; How many threads to start at maximum load
    MaxThreads = 100

    ; Time a thread must be idle (in seconds) before it dies
    IdleTimeout = 60

    ; Thread priority ("Lowest", "BelowNormal", "Normal", "AboveNormal", "Highest")
    Priority = "BelowNormal"

    ; Maximum number of events to queue for a script (excluding timers)
    MaxScriptEventQueue = 300

    ; Stack size per thread created
    ThreadStackSize = 262144
   
    ; Set this to true (the default) to load each script into a separate
    ; AppDomain. Setting this to false will load all script assemblies into the
    ; current AppDomain, which will reduce the per-script overhead at the
    ; expense of reduced security and the inability to garbage collect the
    ; script assemblies
    AppDomainLoading = true


    ; Rate to poll for asynchronous command replies (ms)
    ; currently unused
    ;AsyncLLCommandLoopms = 50

    ; Save the source of all compiled scripts
    WriteScriptSourceToDebugFile = false

    ; Default language for scripts
    DefaultCompileLanguage = lsl

    ; List of allowed languages (lsl,vb,js,cs)
    ; AllowedCompilers=lsl,cs,js,vb. 
    ; *warning*, non lsl languages have access to static methods such as System.IO.File.  Enable at your own risk.
    AllowedCompilers=lsl

    ; Compile debug info (line numbers) into the script assemblies
    CompileWithDebugInformation = true

    ; Allow the use of os* functions (some are dangerous)
    AllowOSFunctions = true

    ; Threat level to allow, one of None, VeryLow, Low, Moderate, High, VeryHigh, Severe
    OSFunctionThreatLevel = Low

    ; Interval (s) between background save of script states
    SaveInterval = 120

    ; Interval (s) between maintenance runs (0 = disable)
    MaintenanceInterval = 10

    ; Time a script can spend in an event handler before it is interrupted
    EventLimit = 30

    ; If a script overruns it's event limit, kill the script?
    KillTimedOutScripts = false

    ; Sets the multiplier for the scripting delays
    ScriptDelayFactor = 1.0

    ; The factor the 10 m distances llimits are multiplied by
    ScriptDistanceLimitFactor = 1.0

    ; Maximum length of notecard line read
    ; Increasing this to large values potentially opens
    ; up the system to malicious scripters
    ; NotecardLineReadCharsMax = 255

    ; Sensor settings
    SensorMaxRange = 96.0
    SensorMaxResults = 16
    ;
    ; ==== OSSL FUNCTION BLOCK ====
    ; OS Functions enable/disable
    ; For each function, you can add one line, as shown
    ; The default for all functions allows them if below threat level as defined above
    ;
    ;; = true   allows the use of the function unconditionally
    ;; = false  completely disallows regardles
    ;; = UUID allows that Individual Avatar Access to osFunction
    ;; = UUID,UUID,UUID would allow the 3 different avatars to access function
    ;
    ; ****  THREAT LEVEL NONE Functions ****
    Allow_osGetCurrentSunHour = true
    Allow_osSunGetParam = true
    Allow_osSunSetParam = true
    Allow_osWindActiveModelPluginName = true
    Allow_osMovePen = true
    Allow_osDrawLine = true
    Allow_osDrawText = true
    Allow_osDrawEllipse = true
    Allow_osDrawRectangle = true
    Allow_osDrawFilledRectangle = true
    Allow_osSetFontSize = true
    Allow_osSetPenSize = true 
    Allow_osSetPenColour = true
    Allow_osDrawImage = true 
    Allow_osGetAgents = true   
    Allow_osTerrainGetHeight = true
    Allow_osParseJSON = true
    Allow_osDrawFilledPolygon = true
    Allow_osSetPenCap = true
    Allow_osSetFontName = true
    ;
    ; **** THREAT LEVEL Nuisance Block ****
    Allow_osSetRegionSunSettings = false
    Allow_osSetEstateSunSettings = false
    ;
    ; **** THREAT LEVEL VeryLow Block ****
    Allow_osTerrainFlush = false
    Allow_osSetPrimFloatOnWater = true
    Allow_osSetDynamicTextureURL = true
    Allow_osSetDynamicTextureURLBlend = true
    Allow_osSetDynamicTextureURLBlendFace = true
    Allow_osSetDynamicTextureData = true
    Allow_osSetDynamicTextureDataBlend = true
    Allow_osSetDynamicTextureDataBlendFace = true
    Allow_osGetDrawStringSize = true
    Allow_osWindParamSet = true
    Allow_osWindParamGet = true
    Allow_osSetParcelMediaURL = true
    ;
    ; **** THREAT LEVEL Low Block ****
    Allow_osMessageObject = true
    Allow_osAvatarName2Key = true 
    Allow_osKey2Name = true
    Allow_osFormatString = true 
    Allow_osLoadedCreationDate = false 
    Allow_osLoadedCreationTime = false
    Allow_osLoadedCreationID = false
    ;
    ; **** THREAT LEVEL Moderate ****
    Allow_osGetGridNick = true
    Allow_osGetGridName = true
    Allow_osGetGridLoginURI = true
    ;
    ; **** THREAT LEVEL HIGH Block ****
    Allow_osTeleportAgent = true 
    Allow_osMakeNotecard = true
    Allow_osMatchString = false
    Allow_osTerrainSetHeight = false
    Allow_osRegionRestart = false
    Allow_osGetAgentIP = false
    Allow_osSetRegionWaterHeight = false
    Allow_osGetScriptEngineName = false
    ;
    ; **** THREAT LEVEL VeryHigh Block ****
    Allow_osRegionNotice = false
    Allow_osSetRot = false
    Allow_osAvatarPlayAnimation = false
    Allow_osAvatarStopAnimation = false
    Allow_osGetNotecardLine = false
    Allow_osGetNotecard = false
    Allow_osGetNumberOfNotecardLines = false
    ;
    ; **** THREAT LEVEL Severe Block****
    Allow_osGetSimulatorVersion = true
    Allow_osConsoleCommand = false      ; ! USE ONLY WITH REGION OPERATORS UUID !
    ;
    ; NEW as of Git# 0712196 - r11518
    Allow_osGetMapTexture = false         ; Threat-Level = NONE
    Allow_osGetRegionMapTexture = false ; osGetRegionMapTexture(string regionName);Threat-Level = HIGH
    ;
    ; ==== END OF OSSL FUNCTION BLOCK ====
    ;
    ; Allow for llCreateLink and llBreakLink to work without asking for permission
    ; only enable this in a trusted environment otherwise you may be subject to hijacking
    ; AutomaticLinkPermission = false

    ; Disable underground movement of prims (default true); set to
    ; false to allow script controlled underground positioning of
    ; prims
    ; DisableUndergroundMovement = true


Hope it Helps, Good Luck.

_________________
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: GetGridname via script
PostPosted: Sat Nov 14, 2009 2:03 am 
Furious Typer

Joined: Fri Dec 12, 2008 9:47 am
Posts: 258
Hi WhiteStar

At the moment there is no way to find the real gridname, and those methods that should do the job, are just some usersettings in the ini. What we however need is a method that sends the Gridname from the Gridserver and only then we would have a usable Gridname function ;)

_________________
{L_IMAGE}{L_IMAGE}{L_IMAGE}


Top
 Profile  
 
 Post subject: Re: GetGridname via script
PostPosted: Sat Nov 14, 2009 8:30 am 
OSG Elite
User avatar

Joined: Wed Mar 11, 2009 3:57 pm
Posts: 444
Yes, sadly the osGetGridNick does only return the value defined in the OpenSim.ini under [GridInfo], Gridnick. Which can often be incorrect.

_________________
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 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