29 using System.Reflection;
30 using System.Collections.Generic;
33 using OpenMetaverse.StructuredData;
35 namespace OpenSim.Framework
44 private static readonly ILog m_log =
46 MethodBase.GetCurrentMethod().DeclaringType);
67 public string CapsPath = String.Empty;
104 public string Name {
get {
return string.Format(
"{0} {1}", firstname, lastname); } }
121 public string ServiceSessionID = string.Empty;
131 private string m_viewerInternal;
138 set { m_viewerInternal = value; }
146 if (m_viewerInternal == null || m_viewerInternal.Contains(
" "))
148 return m_viewerInternal;
152 return Channel +
" " + m_viewerInternal;
190 args[
"agent_id"] = OSD.FromUUID(AgentID);
191 args[
"base_folder"] = OSD.FromUUID(BaseFolder);
192 args[
"caps_path"] = OSD.FromString(CapsPath);
194 if (ChildrenCapSeeds != null)
197 foreach (KeyValuePair<ulong, string> kvp
in ChildrenCapSeeds)
200 pair[
"handle"] = OSD.FromString(kvp.Key.ToString());
201 pair[
"seed"] = OSD.FromString(kvp.Value);
202 childrenSeeds.Add(pair);
204 if (ChildrenCapSeeds.Count > 0)
205 args[
"children_seeds"] = childrenSeeds;
207 args[
"child"] = OSD.FromBoolean(child);
208 args[
"circuit_code"] = OSD.FromString(circuitcode.ToString());
209 args[
"first_name"] = OSD.FromString(firstname);
210 args[
"last_name"] = OSD.FromString(lastname);
211 args[
"inventory_folder"] = OSD.FromUUID(InventoryFolder);
212 args[
"secure_session_id"] = OSD.FromUUID(SecureSessionID);
213 args[
"session_id"] = OSD.FromUUID(SessionID);
215 args[
"service_session_id"] = OSD.FromString(ServiceSessionID);
216 args[
"start_pos"] = OSD.FromString(startpos.ToString());
217 args[
"client_ip"] = OSD.FromString(IPAddress);
218 args[
"viewer"] = OSD.FromString(Viewer);
219 args[
"channel"] = OSD.FromString(Channel);
220 args[
"mac"] = OSD.FromString(Mac);
221 args[
"id0"] = OSD.FromString(Id0);
223 if (Appearance != null)
225 args[
"appearance_serial"] = OSD.FromInteger(Appearance.Serial);
227 OSDMap appmap = Appearance.Pack(ctx);
228 args[
"packed_appearance"] = appmap;
233 if (ServiceURLs != null && ServiceURLs.Count > 0)
236 foreach (KeyValuePair<string, object> kvp
in ServiceURLs)
239 urls.Add(OSD.FromString(kvp.Key));
240 urls.Add(OSD.FromString((kvp.Value == null) ?
string.Empty : kvp.Value.ToString()));
242 args[
"service_urls"] = urls;
246 if (ServiceURLs != null && ServiceURLs.Count > 0)
249 foreach (KeyValuePair<string, object> kvp
in ServiceURLs)
252 urls[kvp.Key] = OSD.FromString((kvp.Value == null) ?
string.Empty : kvp.Value.ToString());
254 args[
"serviceurls"] = urls;
267 if (args[
"agent_id"] != null)
268 AgentID = args[
"agent_id"].AsUUID();
269 if (args[
"base_folder"] != null)
270 BaseFolder = args[
"base_folder"].AsUUID();
271 if (args[
"caps_path"] != null)
272 CapsPath = args[
"caps_path"].AsString();
274 if ((args[
"children_seeds"] != null) && (args[
"children_seeds"].Type == OSDType.Array))
277 ChildrenCapSeeds =
new Dictionary<ulong, string>();
278 foreach (
OSD o
in childrenSeeds)
280 if (o.Type == OSDType.Map)
285 if (pair[
"handle"] != null)
286 if (!UInt64.TryParse(pair[
"handle"].AsString(), out handle))
288 if (pair[
"seed"] != null)
289 seed = pair[
"seed"].AsString();
290 if (!ChildrenCapSeeds.ContainsKey(handle))
291 ChildrenCapSeeds.Add(handle, seed);
296 ChildrenCapSeeds =
new Dictionary<ulong, string>();
298 if (args[
"child"] != null)
299 child = args[
"child"].AsBoolean();
300 if (args[
"circuit_code"] != null)
301 UInt32.TryParse(args[
"circuit_code"].AsString(), out circuitcode);
302 if (args[
"first_name"] != null)
303 firstname = args[
"first_name"].AsString();
304 if (args[
"last_name"] != null)
305 lastname = args[
"last_name"].AsString();
306 if (args[
"inventory_folder"] != null)
307 InventoryFolder = args[
"inventory_folder"].AsUUID();
308 if (args[
"secure_session_id"] != null)
309 SecureSessionID = args[
"secure_session_id"].AsUUID();
310 if (args[
"session_id"] != null)
311 SessionID = args[
"session_id"].AsUUID();
312 if (args[
"service_session_id"] != null)
313 ServiceSessionID = args[
"service_session_id"].AsString();
314 if (args[
"client_ip"] != null)
315 IPAddress = args[
"client_ip"].AsString();
316 if (args[
"viewer"] != null)
317 Viewer = args[
"viewer"].AsString();
318 if (args[
"channel"] != null)
319 Channel = args[
"channel"].AsString();
320 if (args[
"mac"] != null)
321 Mac = args[
"mac"].AsString();
322 if (args[
"id0"] != null)
323 Id0 = args[
"id0"].AsString();
324 if (args[
"teleport_flags"] != null)
325 teleportFlags = args[
"teleport_flags"].AsUInteger();
327 if (args[
"start_pos"] != null)
328 Vector3.TryParse(args[
"start_pos"].AsString(), out startpos);
339 if (args[
"appearance_serial"] != null)
340 Appearance.Serial = args[
"appearance_serial"].AsInteger();
342 if (args.ContainsKey(
"packed_appearance") && (args[
"packed_appearance"].Type == OSDType.Map))
344 Appearance.Unpack((
OSDMap)args[
"packed_appearance"]);
349 m_log.Warn(
"[AGENTCIRCUITDATA]: failed to find a valid packed_appearance");
354 m_log.ErrorFormat(
"[AGENTCIRCUITDATA] failed to unpack appearance; {0}",e.Message);
357 ServiceURLs =
new Dictionary<string, object>();
359 if (args.ContainsKey(
"serviceurls") && args[
"serviceurls"] != null && (args[
"serviceurls"]).
Type == OSDType.Map)
362 foreach (KeyValuePair<String, OSD> kvp
in urls)
364 ServiceURLs[kvp.Key] = kvp.Value.AsString();
371 else if (args.ContainsKey(
"service_urls") && args[
"service_urls"] != null && (args[
"service_urls"]).
Type == OSDType.Array)
374 for (
int i = 0; i < urls.Count / 2; i++)
376 ServiceURLs[urls[i * 2].AsString()] = urls[(i * 2) + 1].AsString();
string lastname
Agent's account last name
uint circuitcode
Number given to the client when they log-in that they provide as credentials to the UDP server ...
OpenMetaverse.StructuredData.OSDArray OSDArray
AvatarAppearance Appearance
Avatar's Appearance
string Id0
The id0 as reported by the viewer at login
Contains the Avatar's Appearance and methods to manipulate the appearance.
OpenMetaverse.StructuredData.OSDMap OSDMap
string Channel
The channel strinf sent by the viewer at login
Vector3 startpos
Position the Agent's Avatar starts in the region
bool child
Root agent, or Child agent
Dictionary< string, object > ServiceURLs
OSDMap PackAgentCircuitData(EntityTransferContext ctx)
Pack AgentCircuitData into an OSDMap for transmission over LLSD XML or LLSD json
string IPAddress
The client's IP address, as captured by the login service
string Mac
The Mac address as reported by the viewer at login
UUID SessionID
Non secure Session ID
string firstname
Agent's account first name
UUID SecureSessionID
Random Unique GUID for this session. Client gets this at login and it's only supposed to be disclosed...
Dictionary< ulong, string > ChildrenCapSeeds
Seed caps for neighbor regions that the user can see into
Circuit data for an agent. Connection information shared between regions that accept UDP connections ...
OpenMetaverse.StructuredData.OSD OSD
UUID AgentID
Avatar Unique Agent Identifier
uint teleportFlags
How this agent got here
UUID BaseFolder
Agent's root inventory folder
void UnpackAgentCircuitData(OSDMap args)
Unpack agent circuit data map into an AgentCiruitData object