error_reporting(E_ALL); ini_set('display_errors', 1);

How to add your region to the OSgrid destination guide



Before you begin:

* you must have access to the configuration of your simulator.

* the region must be online and accessible, preferably 24/7.

If your region is offline for more than 2 consecutive days it will be automatically deleted from the Destination guide.

- - - - - - - - - - -

Configuration changes in your simulator:

To add your region the simulator must be allowed to communicate with the remote scripts on osgrid servers:

* open OpenSim.ini (located in the bin folder of your simulator).

* go to the [Network] section

* find the line ExternalHostNameForLSL = and make sure that the IP or dns you use is correct. If it is missing, add it at the end.

Save the file.

Terminate your simulator by giving the proper quit command in the consol (do not simply click the X in the window!), then restart it.

- - - - - - - - - - -

Last steps:

Log in to your region and rez a box.

In Edit mode, go to Content and create a new script. Name it DestinationGuide (or whatever you like).

Copy the script below and paste it in the new script you just made and edit line categorie_name =

Choose one of the categories 3-14 from the script and paste it at line 8, then save it.

Example string categorie_name = "Gaming";

- - - - - - - - - - -

E-mail Paela Argus [email protected] with:

* Your full avatar name

* the name of your region and desired category

* a screenshot you want displayed in the Destination guide.

Please use a small 515 x 512 jpeg file. High resolution pictures will be rejected.

Done. If you need more help please ask Dan Banner or Paela Argus for assistance.

- - - - - - - - - - -

THE SCRIPT

// OpenSim Destination Guide Terminal v0.3 by djphil (CC-BY-NC-SA 4.0)
// Edited by paela argus for Osgrid in August 2018.
// For help please contact PAELA ARGUS.
// This script is full permisson. Please do not change this.
// PLEASE USE THIS BOX ON OSGRID ONLY !
// IF YOU WANT SIMILAR SYSTEM FOR YOUR GRID PLEASE GO TO https://github.com/djphil/osguide Free to use for all and will make dj phil happy :-) Cordially paela argus,
string targetUrl = "http://destination.osgrid.org/"; // WARNING Any change of this url will break this script WARNING !!
string terminal_name = "Terminal 1.1.5 Gaming"; // other name is not allowed and auto removed by osgrid server !!
string categorie_name = "Gaming"; // Use the choises 3-14 below, other names are auto removed !!
float update_rate = 200.0; // Don't use timer lower than 200 or Ip server might be banned in osgrid. Thanks you !!!
integer display_debug = FALSE; // show a debug txt
integer display_guide = TRUE; // show in guide FALSE = will only show in viewer destination guide !!
integer display_text = FALSE; // make a floating text above your box
integer face = ALL_SIDES; // change at your owner risk !!
// 1 Official location //disabled for user level 0
// 3 Arts and culture = events and art
// 4 Business
// 5 Educational
// 6 Gaming
// 7 Hangout
// 8 Newcomer friendly
// 9 Parks and Nature
// 10 Residential
// 11 Shopping
// 13 Other
// 14 Rental
// AFTER THIS LINE DONT TOUCH THIS SCRIPT THANKS YOU !! ANY CHANGE ARE AT YOUR OWN RISK AND CAN BAN YOUR SERVER ACCESS IN THE DESTINATION GRID !!!
string server_uuid;
string region_name;
string owner_name;
string owner_uuid;
string script_name;
key http_request_id;
key tiny_request_id;
key serv_request_id;
key ping_request_id;
terminal_fullbright_flash()
{
llSetLinkPrimitiveParamsFast(LINK_SET, [PRIM_FULLBRIGHT, face, TRUE]);
llSleep(0.25);
llSetLinkPrimitiveParamsFast(LINK_SET, [PRIM_FULLBRIGHT, face, FALSE]);
}
key addRegionToDestinationGuideID;
addRegionToDestinationGuide(string url)
{
integer scope = AGENT_LIST_PARCEL_OWNER| AGENT_LIST_EXCLUDENPC;//dont change this line or server ip banned in osgrid thanks you !!
list agents_list = llGetAgentList(scope, []);
integer agents_online = llGetListLength(agents_list);
addRegionToDestinationGuideID = llHTTPRequest(targetUrl + "inc/terminal.php",
[HTTP_METHOD, "POST", HTTP_MIMETYPE, "application/x-www-form-urlencoded", HTTP_BODY_MAXLENGTH, 16384],
"terminal=register" +
"&categorie_name=" + llEscapeURL(categorie_name) +
"&http_server_url=" + llStringToBase64(http_server_url) +
"&agents_online=" + agents_online +
"&agents_list=" + llStringToBase64(llList2CSV(agents_list))
);
}
string http_server_url;
request_http_server_url()
{
llReleaseURL(http_server_url);
http_server_url = "";
llRequestURL();
}
verify_region_parcel_owner()
{
list parcel_details = llGetParcelDetails(llGetPos(), [PARCEL_DETAILS_NAME, PARCEL_DETAILS_OWNER]);
string parcel_name = llList2String(parcel_details, 0);
key parcel_owner_uuid = llList2Key(parcel_details, 1);
if (owner_uuid != parcel_owner_uuid)
{
llOwnerSay("\nD sol " + owner_uuid + ", la parcelle " + parcel_name + " ne t'appartient pas ...");
llInstantMessage(parcel_owner_uuid,
"\nUn object nom \"" + llGetObjectName() + "\"" +
" contenant un script nom \"" + script_name + "\"" +
" t rezzer par " + owner_name +
" sur la parcelle " + parcel_name +
" de la r gion " + region_name +
"\n[OBJET UUID] " + llGetKey() +
"\n[OWNER UUID] " + owner_uuid
);
llDie();
}
}
default
{
state_entry()
{
llOwnerSay("Initialisation ...");
owner_uuid = llGetOwner();
region_name = llGetRegionName();
script_name = llGetScriptName();
verify_region_parcel_owner();
llSetObjectName(script_name);
llSetObjectDesc("Digital Concepts (CC-BY-NC-SA 4.0) edit paela");
if (display_text) llSetText("[? TERMINAL ?]\n" + region_name + "\n(" + owner_name + ")", <1.0, 1.0, 1.0>, 1.0);
else llSetText("", <1.0, 1.0, 1.0>, 1.0);
llSetTexture(osGetMapTexture(), face);
llSetTimerEvent(0.1);
}
touch_start(integer n)
{
key toucher_uuid = llDetectedKey(0);
if (toucher_uuid == owner_uuid) llSetTimerEvent(0.1);
else llRegionSayTo(toucher_uuid, PUBLIC_CHANNEL, "Onwer only " + " ...");
}
http_request(key id, string method, string body)
{
if (method == URL_REQUEST_GRANTED)
{
http_server_url = body;
addRegionToDestinationGuide(http_server_url);
tiny_request_id = llHTTPRequest("http://tinyurl.com/api-create.php?url=" + targetUrl, [], "");
serv_request_id = llHTTPRequest("http://tinyurl.com/api-create.php?url=" + body, [], "");
ping_request_id = llHTTPRequest(body, [], "");
}
else if (method == URL_REQUEST_DENIED)
{
llSay(PUBLIC_CHANNEL, "Something went wrong, no url. " + body);
}
else if (method == "GET")
{
llHTTPResponse(id, 200, "Terminal Http Server for " + terminal_name + " is ready to use ...\n");
}
else if (method == "POST")
{
llHTTPResponse(id, 200, "OK");
addRegionToDestinationGuide(http_server_url);
terminal_fullbright_flash();
}
else {llHTTPResponse(id, 405, "Unsupported Method"); llOwnerSay("[ERROR] Unsupported Method ...");}
}
http_response(key id, integer status, list metadata, string body)
{
if (id)
{
if (status != 200)
{
llOwnerSay("[POST RECIEVED] " + status);
return;
}
}
else if (id == NULL_KEY)
{
llOwnerSay("[POST NULL & STATUS] " + status);
return;
}
body = llStringTrim(body, STRING_TRIM);
// if (id == tiny_request_id && display_guide)
// llSay(PUBLIC_CHANNEL, "Guide @ " + body);
// if (id == serv_request_id && display_debug)
// llOwnerSay("Server @ " + body);
if (id == addRegionToDestinationGuideID && display_debug)
{
string text = "\n============================";
text += "\n" + body;
text += "\n============================";
llOwnerSay(text);
}
if (id == ping_request_id && display_debug)
{
string text = "\n============================";
text += "\n" + body;
text += "\n============================";
llOwnerSay(text);
}
if (body == "HOST_RESTRICTION")
{
body = "\n* Your \"host\" Are not allowed to use this box any question contact paela argus inworld or in mail: [email protected] ...";
body += "\n* the region \"" + region_name + "\" are not added ...";
llOwnerSay("[WARNING] " + owner_name + body);
}
if (body == "UUID_RESTRICTION")
{
body = "\n* categorie \"" + categorie_name + "\" are not allowed ...";
body += "\n* region \"" + region_name + "\" not added ...";
llOwnerSay("[WARNING] " + owner_name + body);
}
}
timer()
{
llSetTimerEvent(update_rate);
request_http_server_url();
terminal_fullbright_flash();
}
on_rez(integer n)
{
llSetTimerEvent(0.0);
verify_region_parcel_owner();
}
changed(integer change)
{
if (change & CHANGED_INVENTORY) {llResetScript();}
if (change & CHANGED_OWNER) {llResetScript();}
if (change & CHANGED_REGION) {llResetScript();}
if (change & CHANGED_REGION_START) {llResetScript();}
}
}