GridService

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(API)
Line 21: Line 21:
  
 
== Calls ==
 
== Calls ==
 +
 +
=== get_region_flags ===
 +
This get information on the flags of a region (yes, this should really just be included in get_region_range).
 +
 +
The POST field is a urlencoded string like so
 +
 +
SCOPEID=00000000-0000-0000-0000-000000000000&REGIONID=dd5b77f8-bf88-45ac-aace-35bd76426c81&METHOD=get_region_flags
 +
 +
where
 +
 +
* '''SCOPEID''' must always be present and always 00000000-0000-0000-0000-000000000000 (UUID.Zero) at the present time.
 +
* '''REGIONID''' is the UUID of region to query for flags.
 +
 +
If the region exists, a response like
 +
 +
<source lang='xml'>
 +
<?xml version="1.0"?>
 +
<ServerResponse>
 +
  <result>7</result>
 +
</ServerResponse>
 +
</source>
 +
 +
will be received.  The result corresponds to bit flags
 +
 +
* DefaultRegion = 1, // Used for new Rez. Random if multiple defined
 +
* FallbackRegion = 2, // Regions we redirect to when the destination is down
 +
* RegionOnline = 4, // Set when a region comes online, unset when it unregisters and DeleteOnUnregister is false
 +
* NoDirectLogin = 8, // Region unavailable for direct logins (by name)
 +
* Persistent = 16, // Don't remove on unregister
 +
* LockedOut = 32, // Don't allow registration
 +
* NoMove = 64, // Don't allow moving this region
 +
* Reservation = 128, // This is an inactive reservation
 +
* Authenticate = 256, // Require authentication
 +
* Hyperlink = 512, // Record represents a HG link
 +
* DefaultHGRegion = 1024 // Record represents a default region for hypergrid teleports only.
 +
 +
If no region with the given ID is found, then the response is
 +
 +
<source lang='xml'>
 +
<?xml version="1.0"?>
 +
<ServerResponse>
 +
  <result>-1</result>
 +
</ServerResponse>
 +
</source>
  
 
=== get_region_range ===
 
=== get_region_range ===
Line 32: Line 76:
  
 
* '''SCOPEID''' must always be present and always 00000000-0000-0000-0000-000000000000 (UUID.Zero) at the present time.
 
* '''SCOPEID''' must always be present and always 00000000-0000-0000-0000-000000000000 (UUID.Zero) at the present time.
* '''XMIN''' The minimum x-coordinate in the region range.  Please note that this is in meters, not 256m map tiles.  So to start this at map tile co-ordinate 1000, one must specify 256000 (1000 * 256).
+
* '''XMIN''' The minimum x-coordinate in the region range.  Please note that this is in meters, not 256m map tiles.  This must be in the range 0 - 2147483647.  So to start this at map tile co-ordinate 1000, one must specify 256000 (1000 * 256).
* '''YMIN''' The minimum u-coordinate in the region range.  Please note that this is in meters, not 256m map tiles.
+
* '''YMIN''' The minimum u-coordinate in the region range.  Please note that this is in meters, not 256m map tiles.  This must be in the range 0 - 2147483647.
* '''XMAX''' The maximum x-coordinate in the region range.  Please note that this is in meters, not 256m map tiles.
+
* '''XMAX''' The maximum x-coordinate in the region range.  Please note that this is in meters, not 256m map tiles.  This must be in the range 0 - 2147483647.
* '''XMIN''' The maximum y-coordinate in the region range.  Please note that this is in meters, not 256m map tiles.
+
* '''XMIN''' The maximum y-coordinate in the region range.  Please note that this is in meters, not 256m map tiles.  This must be in the range 0 - 2147483647.
  
 
If there are any regions in the range, a response like
 
If there are any regions in the range, a response like
Line 91: Line 135:
  
 
will be returned.
 
will be returned.
 +
 +
==== Notes ====
 +
You can get information on all the regions in a grid by specifying 0,0 min values and 2147483647,2147483647 max values.

Revision as of 16:43, 29 July 2014

Contents

Introduction

The grid service manages information about regions on the grid.

API

Functions available on the grid service are

  • register - registers a region with the grid.
  • deregister - deregisters a region from the grid.
  • get_neighbours - gets the region neighbours of a given location.
  • get_region_by_uuid - returns region details given a region UUID.
  • get_region_by_position - returns region details given a position.
  • get_region_by_name - returns region details given a name. This will only return the first name if there are multiple regions with the same name.
  • get_regions_by_name - returns details of all regions that match a given name
  • get_region_range - returns details of all regions in a given area
  • get_default_regions - returns default regions for a grid. These are regions that are tried in order if the requested login region does not exist.
  • get_default_hypergrid_regions - returns default Hypergrid regions for a grid. These are regions that are tried in order if Hypergrid destination request by an inbound foreign user does not exist.
  • get_fallback_regions - returns fallback regions for a grid. These are regions that are tried in order if no default regions are online.
  • get_hyperlinks - get linked Hypergrid regions.
  • get_region_flags - get flags for a region.

Calls

get_region_flags

This get information on the flags of a region (yes, this should really just be included in get_region_range).

The POST field is a urlencoded string like so

SCOPEID=00000000-0000-0000-0000-000000000000&REGIONID=dd5b77f8-bf88-45ac-aace-35bd76426c81&METHOD=get_region_flags

where

  • SCOPEID must always be present and always 00000000-0000-0000-0000-000000000000 (UUID.Zero) at the present time.
  • REGIONID is the UUID of region to query for flags.

If the region exists, a response like

<?xml version="1.0"?>
<ServerResponse>
  <result>7</result>
</ServerResponse>

will be received. The result corresponds to bit flags

  • DefaultRegion = 1, // Used for new Rez. Random if multiple defined
  • FallbackRegion = 2, // Regions we redirect to when the destination is down
  • RegionOnline = 4, // Set when a region comes online, unset when it unregisters and DeleteOnUnregister is false
  • NoDirectLogin = 8, // Region unavailable for direct logins (by name)
  • Persistent = 16, // Don't remove on unregister
  • LockedOut = 32, // Don't allow registration
  • NoMove = 64, // Don't allow moving this region
  • Reservation = 128, // This is an inactive reservation
  • Authenticate = 256, // Require authentication
  • Hyperlink = 512, // Record represents a HG link
  • DefaultHGRegion = 1024 // Record represents a default region for hypergrid teleports only.

If no region with the given ID is found, then the response is

<?xml version="1.0"?>
<ServerResponse>
  <result>-1</result>
</ServerResponse>

get_region_range

This gets information on all the regions in a given co-ordinate range.

The POST field is a urlencoded string like so

SCOPEID=00000000-0000-0000-0000-000000000000&XMIN=0&YMIN=0&XMAX=2147483647&YMAX=2147483647&METHOD=get_region_range 

where

  • SCOPEID must always be present and always 00000000-0000-0000-0000-000000000000 (UUID.Zero) at the present time.
  • XMIN The minimum x-coordinate in the region range. Please note that this is in meters, not 256m map tiles. This must be in the range 0 - 2147483647. So to start this at map tile co-ordinate 1000, one must specify 256000 (1000 * 256).
  • YMIN The minimum u-coordinate in the region range. Please note that this is in meters, not 256m map tiles. This must be in the range 0 - 2147483647.
  • XMAX The maximum x-coordinate in the region range. Please note that this is in meters, not 256m map tiles. This must be in the range 0 - 2147483647.
  • XMIN The maximum y-coordinate in the region range. Please note that this is in meters, not 256m map tiles. This must be in the range 0 - 2147483647.

If there are any regions in the range, a response like

<?xml version="1.0"?>
<ServerResponse>
  <region0 type="List">
    <uuid>dd5b77f8-bf88-45ac-aace-35bd76426c81</uuid>
    <locX>256000</locX>
    <locY>256000</locY>
    <sizeX>256</sizeX>
    <sizeY>256</sizeY>
    <regionName>test</regionName>
    <serverIP>192.168.1.2</serverIP>
    <serverHttpPort>9000</serverHttpPort>
    <serverURI>http://192.168.1.2:9000/</serverURI>
    <serverPort>9000</serverPort>
    <regionMapTexture>fc8fda13-c2e9-4e83-8543-b7fe98231399</regionMapTexture>
    <parcelMapTexture>00000000-0000-0000-0000-000000000000</parcelMapTexture>
    <access>13</access>
    <regionSecret>0ab0a97d-ffcc-4b29-a715-74372b763b88</regionSecret>
    <owner_uuid>f2f493c0-27d3-4cf2-be97-b44dfdad13b6</owner_uuid>
    <Token/>
  </region0>
  <region1 type="List">
    <uuid>dd5b77f8-bf88-45ac-aace-35bd76426c82</uuid>
    <locX>256000</locX>
    <locY>256256</locY>
    <sizeX>256</sizeX>
    <sizeY>256</sizeY>
    <regionName>test2</regionName>
    <serverIP>192.168.1.2</serverIP>
    <serverHttpPort>9000</serverHttpPort>
    <serverURI>http://192.168.1.2:9000/</serverURI>
    <serverPort>9001</serverPort>
    <regionMapTexture>e8c14947-c7d2-48e8-bab2-5a62ec4da4d8</regionMapTexture>
    <parcelMapTexture>00000000-0000-0000-0000-000000000000</parcelMapTexture>
    <access>13</access>
    <regionSecret>273b84ff-bfe1-480b-901b-c6e4bcd3e091</regionSecret>
    <owner_uuid>f2f493c0-27d3-4cf2-be97-b44dfdad13b6</owner_uuid>
    <Token/>
  </region1>
</ServerResponse>

If no matching regions are found then

<?xml version="1.0"?>
<ServerResponse>
  <result>null</result>
</ServerResponse>

will be returned.

Notes

You can get information on all the regions in a grid by specifying 0,0 min values and 2147483647,2147483647 max values.

Personal tools
General
About This Wiki