RemoteAdmin:admin create region

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m (PHP: Fixed broken Google Code link, replacing with internal page)
 
(4 intermediate revisions by 4 users not shown)
Line 126: Line 126:
 
When an error occures the following error value are returned
 
When an error occures the following error value are returned
  
*cannot instantiate new region, server capacity {MAX REGION LIMIT} already reached; delete regions first
+
* cannot instantiate new region, server capacity {MAX REGION LIMIT} already reached; delete regions first
*region {UUID} already in use by region {REGION NAME}, UUID {REGION UUID}
+
* region {UUID} already in use by region {REGION NAME}, UUID {REGION UUID}
*region name already in use by region {REGION NAME}, UUID {REGION UUID}
+
* region name already in use by region {REGION NAME}, UUID {REGION UUID}
*region location <{X},{Y}> already in use by region {REGION NAME}, UUID {REGION UUID}
+
* region location <{X},{Y}> already in use by region {REGION NAME}, UUID {REGION UUID}
*region internal IP {IP} and port {PORT} already in use by {REGION NAME}, UUID {REGION UUID}
+
* region internal IP {IP} and port {PORT} already in use by {REGION NAME}, UUID {REGION UUID}
*Invalid location for region file.
+
* Invalid location for region file.
*Specified user was not found.
+
* Specified user was not found.
*Estate owner details not provided.
+
* Estate owner details not provided.
*Failed to join estate.
+
* Failed to join estate.
  
  
 
== Notes ==
 
== Notes ==
*When adding a region to a existing estate in the estate database, then one does not need to specify the estate owner. If the estate is does not exist or the estate exists with diffrent estate owners, then one has to use the ''estate_owner_uuid'' or ''estate_owner_first'' + ''estate_owner_last''.
+
* When adding a region to a existing estate in the estate database, then one does not need to specify the estate owner. If the estate is does not exist or the estate exists with diffrent estate owners, then one has to use the ''estate_owner_uuid'' or ''estate_owner_first'' + ''estate_owner_last''.
*When using the optional ''persist'' parameter the region configs will be saved to the default region file. You can specify the file using the parameter region_file if you dont want to use the default
+
* When using the optional ''persist'' parameter the region configs will be saved to the default region file. You can specify the file using the parameter region_file if you dont want to use the default
  
  
 
== Example ==
 
== Example ==
 
=== PHP ===
 
=== PHP ===
 +
This example needs the RemoteAdmin PHP Class file available [[RemoteAdmin:RemoteAdmin_Class|here]].
 +
 
<source lang="php">
 
<source lang="php">
 
<?php
 
<?php
Line 153: Line 155:
 
$myRemoteAdmin = new RemoteAdmin('127.0.0.1', 9000, 'secret');
 
$myRemoteAdmin = new RemoteAdmin('127.0.0.1', 9000, 'secret');
  
// Invoke admin_create_user (multiple parameters)
+
// Invoke admin_create_region (multiple parameters)
 
$parameters = array('region_name' => 'My Plaza', 'listen_ip' => '0.0.0.0', 'listen_port' => '9001', 'region_x' => '1000', 'region_y' => '1000', 'estate_name' => 'My Estate');
 
$parameters = array('region_name' => 'My Plaza', 'listen_ip' => '0.0.0.0', 'listen_port' => '9001', 'region_x' => '1000', 'region_y' => '1000', 'estate_name' => 'My Estate');
 
$myRemoteAdmin->SendCommand('admin_create_region', $parameters);
 
$myRemoteAdmin->SendCommand('admin_create_region', $parameters);
Line 159: Line 161:
 
</source>
 
</source>
  
[[RemoteAdmin]]
+
 
[[RemoteAdmin:Commands]]
+
 
 +
[[Category:RemoteAdmin]]
 +
[[Category:RemoteAdmin Commands]]

Latest revision as of 11:38, 16 March 2021

admin_create_region remotely allows to create a new regions and adds them to an estate. After creation the region is online and available in the map


Contents

[edit] Enabling admin create region

If not all functions are enabled, use admin_create_region to enable the function in the [RemoteAdmin] section

enabled_methods = admin_create_region,...


[edit] Parameters

[edit] Required Parameters

These parameters are required

parameter Description Values
region_name Name of the new region
listen_ip listen ip to be used by region
listen_port integer value of port
external_address external address to be used by the region
region_x region x location in grid
region_y region y location in grid
estate_name estate name that the new region belongs to. Specify estate owner if the estate does not exist yet


[edit] Optional Parameters

These parameters are optional and do not need to be set

parameter Description Values
region_id region uuid to be used for new region
estate_owner_uuid estate owner uuid (optionaly use estate_owner_first and estate_owner_last)
estate_owner_first estate owners first name
estate_owner_last estate owners last name
persist saves new region configs to file e.g. region.ini true, false
region_file when using persist you can specify the file to save region configs to (requires persist to be used)
public enable/disable public access to new region true, false
enable_voice enable/disable voice to new region true, false
heightmap_file load a heightmap file once the new region has been created


[edit] Returned Parameters

[edit] Returned Parameters

These parameters are returned by Remote Admin

parameter Description Values
success true when successfull true, false
error error message when not successfull
region_name name of the new region
region_uuid region uuid of the new region


[edit] Error messages

When an error occures the following error value are returned

  • cannot instantiate new region, server capacity {MAX REGION LIMIT} already reached; delete regions first
  • region {UUID} already in use by region {REGION NAME}, UUID {REGION UUID}
  • region name already in use by region {REGION NAME}, UUID {REGION UUID}
  • region location <{X},{Y}> already in use by region {REGION NAME}, UUID {REGION UUID}
  • region internal IP {IP} and port {PORT} already in use by {REGION NAME}, UUID {REGION UUID}
  • Invalid location for region file.
  • Specified user was not found.
  • Estate owner details not provided.
  • Failed to join estate.


[edit] Notes

  • When adding a region to a existing estate in the estate database, then one does not need to specify the estate owner. If the estate is does not exist or the estate exists with diffrent estate owners, then one has to use the estate_owner_uuid or estate_owner_first + estate_owner_last.
  • When using the optional persist parameter the region configs will be saved to the default region file. You can specify the file using the parameter region_file if you dont want to use the default


[edit] Example

[edit] PHP

This example needs the RemoteAdmin PHP Class file available here.

<?php
 
// Including the RemoteAdmin PHP class.
include('RemoteAdmin.php');
 
// Instantiate the class with parameters identical to the Python example above
$myRemoteAdmin = new RemoteAdmin('127.0.0.1', 9000, 'secret');
 
// Invoke admin_create_region (multiple parameters)
$parameters = array('region_name' => 'My Plaza', 'listen_ip' => '0.0.0.0', 'listen_port' => '9001', 'region_x' => '1000', 'region_y' => '1000', 'estate_name' => 'My Estate');
$myRemoteAdmin->SendCommand('admin_create_region', $parameters);
?>
Personal tools
General
About This Wiki