Jump to content

OpenSimulator Internals/Connector Architecture/Avatar Connector

From Open Simulator Technical Help

OpenSimulator Internals/Connector Architecture/Avatar Connector

[edit]

Overview

[edit]

AvatarServicesConnector is the simulator-side remote connector for IAvatarService. It translates IAvatarService calls into HTTP POST requests to the ROBUST Avatar handler at /avatar.

Source file:

OpenSim/Services/Connectors/Avatar/AvatarServicesConnector.cs

Initialisation

[edit]

Config section: [AvatarService]

Required key:

  • AvatarServerURI -- URL of the ROBUST avatar endpoint; throws if missing

Base class BaseServiceConnector.Initialise() called for auth setup.

Three constructors:

  • Default (no args) -- URI must be set externally
  • String URI -- used by callers that pass the URI directly
  • IConfigSource -- calls Initialise(), normal grid mode

Transport

[edit]

All methods POST to m_ServerURI + "/avatar" using SynchronousRestFormsRequester.

All requests include:

  • VERSIONMIN / VERSIONMAX -- protocol version negotiation
  • METHOD -- identifies the operation

Methods

[edit]
Method METHOD field Notes
GetAvatar(userID) "getavatar" Returns AvatarData constructed from result dictionary; null on empty reply or missing result
GetAppearance(userID) (none) Calls GetAvatar(), then avatar.ToAvatarAppearance()
SetAvatar(userID, avatar) "setavatar" Serializes avatar via ToKeyValuePairs(); returns bool from result field
SetAppearance(userID, appearance) (none) Constructs AvatarData from AvatarAppearance, calls SetAvatar()
ResetAvatar(userID) "resetavatar" Returns bool from result field
SetItems(userID, names[], values[]) "setitems" Sends Names and Values as parallel List<string>; returns bool
RemoveItems(userID, names[]) "removeitems" Sends Names as List<string>; returns bool

All write methods (SetAvatar, ResetAvatar, SetItems, RemoveItems) check replyData["result"].ToLower() == "success" and return false on empty reply, missing result field, or exception.


Notes

[edit]
  • The log message in ResetAvatar() says "SetItems reply" in both the missing-result and empty-reply branches -- copy-paste error from SetItems(). The method itself is correct; only the log text is wrong.
  • ScopeID fields are present in the code but commented out throughout.

See Also

[edit]