aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorMelanie2011-04-30 14:37:37 +0100
committerMelanie2011-04-30 14:37:37 +0100
commitd1cf1fe3d7d3867bcdf7c725ceebdb7aa9579be9 (patch)
tree1310049348fe722ca9c3e970cf5e300f9ad29fce /OpenSim/Framework
parentMerge branch 'careminster-presence-refactor' of ssh://melanie@3dhosting.de/va... (diff)
parentDelaying starting the scripts on TPs and crossings until the agent is root. (diff)
downloadopensim-SC-d1cf1fe3d7d3867bcdf7c725ceebdb7aa9579be9.zip
opensim-SC-d1cf1fe3d7d3867bcdf7c725ceebdb7aa9579be9.tar.gz
opensim-SC-d1cf1fe3d7d3867bcdf7c725ceebdb7aa9579be9.tar.bz2
opensim-SC-d1cf1fe3d7d3867bcdf7c725ceebdb7aa9579be9.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/AgentCircuitData.cs69
-rw-r--r--OpenSim/Framework/ChildAgentDataUpdate.cs57
-rw-r--r--OpenSim/Framework/ClientInfo.cs3
-rw-r--r--OpenSim/Framework/Tests/MundaneFrameworkTests.cs2
4 files changed, 54 insertions, 77 deletions
diff --git a/OpenSim/Framework/AgentCircuitData.cs b/OpenSim/Framework/AgentCircuitData.cs
index 3dbc215..dbd47d3 100644
--- a/OpenSim/Framework/AgentCircuitData.cs
+++ b/OpenSim/Framework/AgentCircuitData.cs
@@ -152,27 +152,6 @@ namespace OpenSim.Framework
152 } 152 }
153 153
154 /// <summary> 154 /// <summary>
155 /// Create AgentCircuitData from a Serializable AgentCircuitData
156 /// </summary>
157 /// <param name="cAgent"></param>
158 public AgentCircuitData(sAgentCircuitData cAgent)
159 {
160 AgentID = new UUID(cAgent.AgentID);
161 SessionID = new UUID(cAgent.SessionID);
162 SecureSessionID = new UUID(cAgent.SecureSessionID);
163 startpos = new Vector3(cAgent.startposx, cAgent.startposy, cAgent.startposz);
164 firstname = cAgent.firstname;
165 lastname = cAgent.lastname;
166 circuitcode = cAgent.circuitcode;
167 child = cAgent.child;
168 InventoryFolder = new UUID(cAgent.InventoryFolder);
169 BaseFolder = new UUID(cAgent.BaseFolder);
170 CapsPath = cAgent.CapsPath;
171 ChildrenCapSeeds = cAgent.ChildrenCapSeeds;
172 Viewer = cAgent.Viewer;
173 }
174
175 /// <summary>
176 /// Pack AgentCircuitData into an OSDMap for transmission over LLSD XML or LLSD json 155 /// Pack AgentCircuitData into an OSDMap for transmission over LLSD XML or LLSD json
177 /// </summary> 156 /// </summary>
178 /// <returns>map of the agent circuit data</returns> 157 /// <returns>map of the agent circuit data</returns>
@@ -369,52 +348,4 @@ namespace OpenSim.Framework
369 } 348 }
370 349
371 350
372 /// <summary>
373 /// Serializable Agent Circuit Data
374 /// </summary>
375 [Serializable]
376 public class sAgentCircuitData
377 {
378 public Guid AgentID;
379 public Guid BaseFolder;
380 public string CapsPath = String.Empty;
381 public Dictionary<ulong, string> ChildrenCapSeeds;
382 public bool child;
383 public uint circuitcode;
384 public string firstname;
385 public Guid InventoryFolder;
386 public string lastname;
387 public Guid SecureSessionID;
388 public Guid SessionID;
389 public float startposx;
390 public float startposy;
391 public float startposz;
392 public string Viewer;
393 public string Channel;
394 public string Mac;
395 public string Id0;
396
397 public sAgentCircuitData()
398 {
399 }
400
401 public sAgentCircuitData(AgentCircuitData cAgent)
402 {
403 AgentID = cAgent.AgentID.Guid;
404 SessionID = cAgent.SessionID.Guid;
405 SecureSessionID = cAgent.SecureSessionID.Guid;
406 startposx = cAgent.startpos.X;
407 startposy = cAgent.startpos.Y;
408 startposz = cAgent.startpos.Z;
409 firstname = cAgent.firstname;
410 lastname = cAgent.lastname;
411 circuitcode = cAgent.circuitcode;
412 child = cAgent.child;
413 InventoryFolder = cAgent.InventoryFolder.Guid;
414 BaseFolder = cAgent.BaseFolder.Guid;
415 CapsPath = cAgent.CapsPath;
416 ChildrenCapSeeds = cAgent.ChildrenCapSeeds;
417 Viewer = cAgent.Viewer;
418 }
419 }
420} 351}
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs
index ce0b2fb..a626b82 100644
--- a/OpenSim/Framework/ChildAgentDataUpdate.cs
+++ b/OpenSim/Framework/ChildAgentDataUpdate.cs
@@ -62,7 +62,7 @@ namespace OpenSim.Framework
62 UUID AgentID { get; set; } 62 UUID AgentID { get; set; }
63 63
64 OSDMap Pack(); 64 OSDMap Pack();
65 void Unpack(OSDMap map); 65 void Unpack(OSDMap map, IScene scene);
66 } 66 }
67 67
68 /// <summary> 68 /// <summary>
@@ -122,7 +122,7 @@ namespace OpenSim.Framework
122 return args; 122 return args;
123 } 123 }
124 124
125 public void Unpack(OSDMap args) 125 public void Unpack(OSDMap args, IScene scene)
126 { 126 {
127 if (args.ContainsKey("region_handle")) 127 if (args.ContainsKey("region_handle"))
128 UInt64.TryParse(args["region_handle"].AsString(), out RegionHandle); 128 UInt64.TryParse(args["region_handle"].AsString(), out RegionHandle);
@@ -329,6 +329,10 @@ namespace OpenSim.Framework
329 329
330 public string CallbackURI; 330 public string CallbackURI;
331 331
332 // These two must have the same Count
333 public List<ISceneObject> AttachmentObjects;
334 public List<string> AttachmentObjectStates;
335
332 public virtual OSDMap Pack() 336 public virtual OSDMap Pack()
333 { 337 {
334 m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Pack data"); 338 m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Pack data");
@@ -441,7 +445,30 @@ namespace OpenSim.Framework
441 if ((CallbackURI != null) && (!CallbackURI.Equals(""))) 445 if ((CallbackURI != null) && (!CallbackURI.Equals("")))
442 args["callback_uri"] = OSD.FromString(CallbackURI); 446 args["callback_uri"] = OSD.FromString(CallbackURI);
443 447
448 // Attachment objects for fatpack messages
449 if (AttachmentObjects != null)
450 {
451 int i = 0;
452 OSDArray attObjs = new OSDArray(AttachmentObjects.Count);
453 foreach (ISceneObject so in AttachmentObjects)
454 {
455 OSDMap info = new OSDMap(4);
456 info["sog"] = OSD.FromString(so.ToXml2());
457 info["extra"] = OSD.FromString(so.ExtraToXmlString());
458 info["modified"] = OSD.FromBoolean(so.HasGroupChanged);
459 try
460 {
461 info["state"] = OSD.FromString(AttachmentObjectStates[i++]);
462 }
463 catch (IndexOutOfRangeException e)
464 {
465 m_log.WarnFormat("[CHILD AGENT DATA]: scrtips list is shorter than object list.");
466 }
444 467
468 attObjs.Add(info);
469 }
470 args["attach_objects"] = attObjs;
471 }
445 return args; 472 return args;
446 } 473 }
447 474
@@ -450,7 +477,7 @@ namespace OpenSim.Framework
450 /// Avoiding reflection makes it painful to write, but that's the price! 477 /// Avoiding reflection makes it painful to write, but that's the price!
451 /// </summary> 478 /// </summary>
452 /// <param name="hash"></param> 479 /// <param name="hash"></param>
453 public virtual void Unpack(OSDMap args) 480 public virtual void Unpack(OSDMap args, IScene scene)
454 { 481 {
455 m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Unpack data"); 482 m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Unpack data");
456 483
@@ -628,6 +655,26 @@ namespace OpenSim.Framework
628 655
629 if (args["callback_uri"] != null) 656 if (args["callback_uri"] != null)
630 CallbackURI = args["callback_uri"].AsString(); 657 CallbackURI = args["callback_uri"].AsString();
658
659 // Attachment objects
660 if (args["attach_objects"] != null && args["attach_objects"].Type == OSDType.Array)
661 {
662 OSDArray attObjs = (OSDArray)(args["attach_objects"]);
663 AttachmentObjects = new List<ISceneObject>();
664 AttachmentObjectStates = new List<string>();
665 foreach (OSD o in attObjs)
666 {
667 if (o.Type == OSDType.Map)
668 {
669 OSDMap info = (OSDMap)o;
670 ISceneObject so = scene.DeserializeObject(info["sog"].AsString());
671 so.ExtraFromXmlString(info["extra"].AsString());
672 so.HasGroupChanged = info["modified"].AsBoolean();
673 AttachmentObjects.Add(so);
674 AttachmentObjectStates.Add(info["state"].AsString());
675 }
676 }
677 }
631 } 678 }
632 679
633 public AgentData() 680 public AgentData()
@@ -655,9 +702,9 @@ namespace OpenSim.Framework
655 return base.Pack(); 702 return base.Pack();
656 } 703 }
657 704
658 public override void Unpack(OSDMap map) 705 public override void Unpack(OSDMap map, IScene scene)
659 { 706 {
660 base.Unpack(map); 707 base.Unpack(map, scene);
661 } 708 }
662 } 709 }
663} 710}
diff --git a/OpenSim/Framework/ClientInfo.cs b/OpenSim/Framework/ClientInfo.cs
index fbd18b5..62acb70 100644
--- a/OpenSim/Framework/ClientInfo.cs
+++ b/OpenSim/Framework/ClientInfo.cs
@@ -31,10 +31,9 @@ using System.Net;
31 31
32namespace OpenSim.Framework 32namespace OpenSim.Framework
33{ 33{
34 [Serializable]
35 public class ClientInfo 34 public class ClientInfo
36 { 35 {
37 public sAgentCircuitData agentcircuit; 36 public AgentCircuitData agentcircuit;
38 37
39 public Dictionary<uint, byte[]> needAck; 38 public Dictionary<uint, byte[]> needAck;
40 39
diff --git a/OpenSim/Framework/Tests/MundaneFrameworkTests.cs b/OpenSim/Framework/Tests/MundaneFrameworkTests.cs
index e131260..34a3f15 100644
--- a/OpenSim/Framework/Tests/MundaneFrameworkTests.cs
+++ b/OpenSim/Framework/Tests/MundaneFrameworkTests.cs
@@ -115,7 +115,7 @@ namespace OpenSim.Framework.Tests
115 position2 = new AgentPosition(); 115 position2 = new AgentPosition();
116 116
117 Assert.IsFalse(position2.AgentID == position1.AgentID, "Test Error, position2 should be a blank uninitialized AgentPosition"); 117 Assert.IsFalse(position2.AgentID == position1.AgentID, "Test Error, position2 should be a blank uninitialized AgentPosition");
118 position2.Unpack(position1.Pack()); 118 position2.Unpack(position1.Pack(), null);
119 119
120 Assert.IsTrue(position2.AgentID == position1.AgentID, "Agent ID didn't unpack the same way it packed"); 120 Assert.IsTrue(position2.AgentID == position1.AgentID, "Agent ID didn't unpack the same way it packed");
121 Assert.IsTrue(position2.Position == position1.Position, "Position didn't unpack the same way it packed"); 121 Assert.IsTrue(position2.Position == position1.Position, "Position didn't unpack the same way it packed");