[Opensim-dev] EstablishAgentCommunication
Cristina Videira Lopes
lopes at ics.uci.edu
Thu Dec 4 17:19:54 UTC 2008
Dr Scofield wrote:
>
> default CAPs are done in Scene.AddCapsHandler(UUID) which also triggers an
> OnRegisterCaps event via the EventManager (so that region modules can add
> specific caps; for example, the voice region module will add voice specific CAPs).
>
>
My question is about the very first CAP on a region, the seed cap. This
is the URL that the client invokes on a region in order to get all other
capabilities from every region it knows about.
It appears that right now the seed cap is first created during login,
and then carried around by the agent. All regions use the same seed
capability. As a result, regions on the same instance have the exact
same seed capability URL. Other differ only on the ip+port portion of
the url.
Is this the right thing to do? Or should each region have its on seed
capability?
Having the agent be the carrier of the seed makes it really easy for
regions to know caps seeds for all other regions, but I'm not sure this
is how caps were meant to be used. After all, it seems to be equally
easy to sniff this seed out of the wire when agents are passed around.
According to jhurliman, each region is supposed to have its own seed
capability.
The consequence of each region having its own seed cap is that there
needs to be another piece of server-side protocol that fetches caps
seeds from one region to another.
--------------
Here's an excerpt from Grid.UserLoginServices:
private bool PrepareLoginToRegion(RegionProfileData regionInfo,
UserProfileData user, LoginResponse response)
{
...
//Not sure if the + "/CAPS/" should in fact be +"CAPS/"
depending if there is already a / as part of httpServerURI
string capsPath = Util.GetRandomCapsPath();
response.SeedCapability = regionInfo.httpServerURI +
"CAPS/" + capsPath + "0000/";
...
loginParams["caps_path"] = capsPath;
...
XmlRpcRequest GridReq = new XmlRpcRequest("expect_user",
SendParams);
XmlRpcResponse GridResp =
GridReq.Send(regionInfo.httpServerURI, 6000);
...
}
(I have several questions about this capsPath, like why those trailing
zeros, but that's a detail compared to the architectural questions)
This "caps seed" is then carried around by the agent, and used as seed
capability for each region that the agent visits. Here's an excerpt from
SceneCommunicationService:
public virtual void RequestTeleportToLocation(ScenePresence
avatar, ulong regionHandle, Vector3 position,
Vector3 lookAt,
uint teleportFlags)
{
...
AgentCircuitData circuitdata =
avatar.ControllingClient.RequestClientInfo();
string capsPath =
"http://" + reg.ExternalHostName + ":" +
reg.HttpPort
+ "/CAPS/" + circuitdata.CapsPath + "0000/";
m_log.DebugFormat(
"[CAPS]: Sending new CAPS seed url {0} to
client {1}", capsPath, avatar.UUID);
if (eq != null)
{
OSD Item =
EventQueueHelper.TeleportFinishEvent(reg.RegionHandle, 13,
reg.ExternalEndPoint,
4, teleportFlags, capsPath, avatar.UUID);
eq.Enqueue(Item, avatar.UUID);
}
else
{
avatar.ControllingClient.SendRegionTeleport(reg.RegionHandle, 13,
reg.ExternalEndPoint, 4,
teleportFlags, capsPath);
}
...
}
More information about the Opensim-dev
mailing list