AvatarService

From OpenSimulator

Jump to: navigation, search

Contents

Introduction

The OpenSimulator avatar service stores user avatar parameters (height, visual parameters) and items that are attached and provides this on request.

TODO: Document remaining operations.

API

General notes

Unlike the asset service, the avatar service is an RPC interface. Therefore it exposes only one URI which is avatar (e.g. http://localhost:8003/avatar). The invocation of different operations (e.g. getavatar, setavatar) is controlled via a METHOD parameter.

Calls

getavatar

This returns data about a user's avatar. POST field is a urlencoded string like so

VERSIONMIN=0&VERSIONMAX=0&UserID=efc1b932-20e3-4298-8824-0f891fe3dc59&METHOD=getavatar

where

  • VERSIONMIN is the minimum version client protocol compatible with this request. Currently unused, can set to zero.
  • VERSIONMIN is the maximum version client protocol compatible with this request. Currently unused, can set to zero.
  • UserID is the UUID of the avatar.
  • METHOD is the XMLRPC method, in this case "getavatar".

If successful, example return is

<?xml version="1.0"?>
<ServerResponse>
  <result type="List">
    <AvatarType>1</AvatarType>
    <AvatarHeight>1.375023</AvatarHeight>
    <METHOD>setavatar</METHOD>
    <Serial>0</Serial>
    <UserID>efc1b932-20e3-4298-8824-0f891fe3dc59</UserID>
    <VERSIONMAX>0</VERSIONMAX>
    <VERSIONMIN>0</VERSIONMIN><VisualParams>2,17,15,0,51,140,12,79,10,76,0,129,68,36,198,104,112,53,0,132,12,176,88,94,63,35,42,73,86,114,122,0,203,0,0,0,0,0,127,0,0,0,0,0,0,127,142,102,28,68,127,135,191,127,239,0,0,188,0,42,0,0,0,0,0,0,0,0,84,142,145,170,0,107,0,193,79,0,0,107,84,193,85,127,127,0,134,140,100,216,214,204,204,204,51,25,89,76,204,0,107,0,0,111,112,84,130,107,112,0,127,142,127,127,127,127,135,93,135,127,196,93,71,79,158,45,71,63,0,0,0,0,127,127,0,0,0,0,127,0,159,0,0,178,127,68,38,140,94,127,104,142,127,15,165,131,0,79,135,0,214,204,255,0,0,35,56,124,255,255,255,255,255,255,255,255,255,255,255,255,132,114,255,255,255,255,255,255,255,255,255,255,255,0,255,255,255,255,255,0,109,35,255,25,100,255,255,255,255,84,0,0,0,51,54,255,255,255</VisualParams>
    <Wearable_x0020_0_x003A_0>4ec1712f-a233-6c38-6bb4-abda2176a98e:cb88c0b3-6874-a9d2-b046-209982656000</Wearable_x0020_0_x003A_0>
    <Wearable_x0020_1_x003A_0>d62c5c25-fb59-d957-c6a7-6244427ba54a:f90883b6-4dcb-eb6c-312b-bcf9bfbde000</Wearable_x0020_1_x003A_0>
    <Wearable_x0020_2_x003A_0>abb14136-8dbb-7233-7c2d-9694d6d94b61:d1fe60ba-589a-e2fb-59f1-b0c068726000</Wearable_x0020_2_x003A_0>
    <Wearable_x0020_3_x003A_0>b67ed83a-2047-36fe-470b-1cc7d0eb2ceb:4bb6fa4d-1cd2-498a-a84c-95c1a0e74000</Wearable_x0020_3_x003A_0>
    <Wearable_x0020_4_x003A_0>df259029-37cd-a8c4-740a-979f5eba929d:32012209-b656-6a32-2c87-97010974b000</Wearable_x0020_4_x003A_0>
    <Wearable_x0020_5_x003A_0>a2ab37cc-7e1d-e66e-9a62-721922d0b5fa:0d72de3d-afe3-c783-802e-7f322d564000</Wearable_x0020_5_x003A_0>
    <_ap_32> => 2b410a2f-e639-4d09-a4d4-e6ca71bc68bd</_ap_32>
  </result>
</ServerResponse>

where

  • MAXVERSION can be ignored - this is accidentally being stored and retrieved on OpenSimulator 0.7.4 and before.
  • MINVERSION can be ignored - this is accidentally being stored and retrieved on OpenSimulator 0.7.4 and before.
  • METHOD can be ignored - this is accidentally being stored and retrieved on OpenSimulator 0.7.4 and before.
  • UserID can be ignored - this is accidentally being stored and retrieved on OpenSimulator 0.7.4 and before. If it is present it will be the same as the requested UserID.
  • AvatarType is the type of avatar. This can currently be ignored and will always be 1 for real avatars.
  • AvatarHeight is the height of the avatar in meters.
  • Serial is the serial number of the avatar parameters update.
  • VisualParams is a comma separated list of integers that control aspects of the avatars appearance.
  • Wearable_x0020_AvatarWearable_x003A_0> is an entry that controls the items that the avatar is wearing. The data is in the format <inventory-id>:<asset-id>. In the element format, AvatarWearable corresponds to the wearable type in OpenMetaverseTypes.WearableType. For instance, 2 is hair and 4 is shirt.
  • _ap_attachment-point-number corresponds to an attachment. The data here is just the inventory id. In the element format, attachment-point-number corresponds to OpenMetaverseTypes.AttachmentPoint. In this case 32, is AttachmentPoint.HUDTopRight. If there are no attachment then there will be no such elements.

Data Storage

The underlying data storage for the Avatar service is a name:value table where the columns are

+-------------+-------------+------+-----+---------+-------+
| Field       | Type        | Null | Key | Default | Extra |
+-------------+-------------+------+-----+---------+-------+
| PrincipalID | char(36)    | NO   | PRI | NULL    |       |
| Name        | varchar(32) | NO   | PRI | NULL    |       |
| Value       | text        | YES  |     | NULL    |       |
+-------------+-------------+------+-----+---------+-------+

The PrincipalID corresponds to the user ID. The Name and Value pairs can be the following.

Name Value Example
AvatarHeight Avatar height in meters 1.69
AvatarType Avatar type. There's only one implemented type in OpenSimulator at the moment - the LL avatar (type 1) 1
Serial Serial number of the appearance. This is incremented every time it is changed 1
VisualParams A comma separate list of visual parameters which determine the base avatar's appearance (e.g. length of nose). These come directly from the viewer but don't correspond exactly to numbers entered in avatar appearance settings 33,61,85,23,58,127,...
Wearable <p>:<n> Item ID and asset ID of an attachment at a specific attachment point (p). The format for the value is <item-id>:<asset-id>. p corresponds to the libomv OpenMetaverse.AttachmentPoint enum (e.g. Chest = 1). n corresponds to the attachment number with the index starting from 0. This is to accommodate multiple attachments. (Name = Wearable 1:0), (Value = 9333693c-dcb5-461f-ba37-ccb5d18f5ebf:77c41e39-38f9-f75a-024e-585989bbabbb)
Personal tools
General
About This Wiki