Remoteadmin:admin get agents

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(Issue was fixed)
(Adjusted formating to match with other commands)
Line 1: Line 1:
 
'''admin_get_agents''' get information about agents in a given region
 
'''admin_get_agents''' get information about agents in a given region
  
= Enabling admin_get_agents =
+
=== Enabling admin_get_agents ===
 
If not all functions are enabled, use admin_get_agents to enable the function in the [RemoteAdmin] section
 
If not all functions are enabled, use admin_get_agents to enable the function in the [RemoteAdmin] section
 
<source lang="csharp">
 
<source lang="csharp">
Line 7: Line 7:
 
</source>
 
</source>
  
= Parameters =
+
== Parameters ==
== Required Parameters ==
+
=== Required Parameters ===
 
These parameters are required
 
These parameters are required
 
{| cellspacing="0" cellpadding="4" border="1"
 
{| cellspacing="0" cellpadding="4" border="1"
Line 25: Line 25:
 
|}
 
|}
  
== Optional Parameters ==
+
=== Optional Parameters ===
 
These parameters are optional and do not need to be set
 
These parameters are optional and do not need to be set
  
Line 40: Line 40:
  
 
== Returned Parameters ==
 
== Returned Parameters ==
 +
=== Returned Parameters ===
 
These parameters are returned by Remote Admin
 
These parameters are returned by Remote Admin
  
Line 113: Line 114:
 
|}
 
|}
  
= Error messages =
+
 
 +
=== Error messages ===
 
No error messages
 
No error messages
  
= Notes =
+
 
 +
== Notes ==
 
* This was introduced in git master commit 3072f25 (OpenSimulator 0.7.6 development).
 
* This was introduced in git master commit 3072f25 (OpenSimulator 0.7.6 development).
  
= Examples =
+
 
== Output ==
+
== Examples ==
 +
=== Output ===
 
<pre>
 
<pre>
 
(
 
(
Line 161: Line 165:
 
</pre>
 
</pre>
  
==Code==
+
 
 
=== PHP ===
 
=== PHP ===
 
This example needs the RemoteAdmin PHP Class file available [http://code.google.com/p/opensimtools/wiki/RemoteAdminPHPClass here]. <source lang="php">
 
This example needs the RemoteAdmin PHP Class file available [http://code.google.com/p/opensimtools/wiki/RemoteAdminPHPClass here]. <source lang="php">
Line 186: Line 190:
 
?>
 
?>
 
</source>
 
</source>
 +
 +
= See Also =
 +
 +
* [[Server Commands]]
  
 
[[RemoteAdmin]]
 
[[RemoteAdmin]]
 
[[RemoteAdmin:Commands]]
 
[[RemoteAdmin:Commands]]

Revision as of 17:17, 16 November 2013

admin_get_agents get information about agents in a given region

Contents

Enabling admin_get_agents

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

enabled_methods = admin_get_agents,...

Parameters

Required Parameters

These parameters are required

parameter Description Values
region_name Name of the region to look for agents (or region_id below)
region_id UUID of the region to look for agents (or region_name above)

Optional Parameters

These parameters are optional and do not need to be set

parameter Description Values
include_children If true, then return information about child agents as well as root agents.

Returned Parameters

Returned Parameters

These parameters are returned by Remote Admin

Root

parameter Description Values
success true
regions Regions for which information is returned. See regions

Regions

parameter Description Values
name Name of region
id UUID of region
agents Agents found in the region requested. See agents

Agents

parameter Description Values
name Name of agent
type Type of agent Npc or User
id UUID of agent
current_parcel_id UUID of parcel the agent is currently over
pos_x X position of the agent
pos_y Y position of the agent
pos_z Z position of the agent
vel_x X velocity of the agent
vel_y Y velocity of the agent
vel_z Z velocity of the agent
lookat_x X gaze direction of the agent
lookat_y X gaze direction of the agent
lookat_z X gaze direction of the agent
is_sat_on_ground true if the agent is sat on the ground
is_sat_on_object true if the agent is sat on an object
is_flying true if the agent is flying


Error messages

No error messages


Notes

  • This was introduced in git master commit 3072f25 (OpenSimulator 0.7.6 development).


Examples

Output

(
    [regions] => Array
        (
            [0] => Array
                (
                    [agents] => Array
                        (
                            [0] => Array
                                (
                                    [lookat_y] => 0.04238708
                                    [lookat_z] => 0
                                    [is_sat_on_ground] => False
                                    [type] => User
                                    [current_parcel_uuid] => fc2f2820-7181-4a9f-8cba-f73d3e14f72e
                                    [name] => John Joe
                                    [uuid] => bb293b8c-4986-4ab4-844a-5d22639f2d75
                                    [vel_y] => 0
                                    [vel_z] => 0
                                    [is_flying] => False
                                    [is_sat_on_object] => False
                                    [pos_x] => 134.6547
                                    [pos_y] => 122.7092
                                    [pos_z] => 25.27129
                                    [vel_x] => 0
                                    [lookat_x] => 0.9991013
                                )

                        )

                    [uuid] => 11111111-bf88-45ac-aace-35bd76426c81
                    [name] => test one
                )

        )

    [success] => 1
)


PHP

This example needs the RemoteAdmin PHP Class file available here.
<source lang="php">
$request = xmlrpc_encode_request("admin_get_agents", array("password" => "plop", "region_name" => "test one", "include_children" => "false"));
 
$context = stream_context_create(array('http' => array(
    'method' => "POST",
    'header' => "Content-Type: text/xml\r\nConnection: close\r\n",
    'content' => $request
)));
 
$fp = fopen("http://localhost:5000", 'rb', false, $context);
$file = stream_get_contents($fp);
fclose($fp);
 
$response = xmlrpc_decode($file);
if ($response && xmlrpc_is_fault($response)) {
    trigger_error("xmlrpc: $response[faultString] ($response[faultCode])");
} else {
    print_r($response);
}
?>

See Also

RemoteAdmin RemoteAdmin:Commands

Personal tools
General
About This Wiki