diff options
author | Melanie Thielker | 2015-11-01 19:37:14 +0100 |
---|---|---|
committer | Melanie Thielker | 2015-11-01 19:37:14 +0100 |
commit | 5f18f2ce6a4308fe30de8b7816058bd5d4b962ca (patch) | |
tree | b41362f4ea4942110f6ccb5260dc3e2697d20686 /OpenSim/Framework | |
parent | More plumbing of the EntityTransferContext (not yet complete) (diff) | |
download | opensim-SC-5f18f2ce6a4308fe30de8b7816058bd5d4b962ca.zip opensim-SC-5f18f2ce6a4308fe30de8b7816058bd5d4b962ca.tar.gz opensim-SC-5f18f2ce6a4308fe30de8b7816058bd5d4b962ca.tar.bz2 opensim-SC-5f18f2ce6a4308fe30de8b7816058bd5d4b962ca.tar.xz |
More EntityTransferContext plumbing
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/AgentCircuitData.cs | 4 | ||||
-rw-r--r-- | OpenSim/Framework/AvatarAppearance.cs | 6 | ||||
-rw-r--r-- | OpenSim/Framework/ChildAgentDataUpdate.cs | 30 | ||||
-rw-r--r-- | OpenSim/Framework/Tests/AgentCircuitDataTest.cs | 3 | ||||
-rw-r--r-- | OpenSim/Framework/Tests/MundaneFrameworkTests.cs | 5 |
5 files changed, 21 insertions, 27 deletions
diff --git a/OpenSim/Framework/AgentCircuitData.cs b/OpenSim/Framework/AgentCircuitData.cs index f4b35a6..4529944 100644 --- a/OpenSim/Framework/AgentCircuitData.cs +++ b/OpenSim/Framework/AgentCircuitData.cs | |||
@@ -184,7 +184,7 @@ namespace OpenSim.Framework | |||
184 | /// Pack AgentCircuitData into an OSDMap for transmission over LLSD XML or LLSD json | 184 | /// Pack AgentCircuitData into an OSDMap for transmission over LLSD XML or LLSD json |
185 | /// </summary> | 185 | /// </summary> |
186 | /// <returns>map of the agent circuit data</returns> | 186 | /// <returns>map of the agent circuit data</returns> |
187 | public OSDMap PackAgentCircuitData(int wearablesCount) | 187 | public OSDMap PackAgentCircuitData(EntityTransferContext ctx) |
188 | { | 188 | { |
189 | OSDMap args = new OSDMap(); | 189 | OSDMap args = new OSDMap(); |
190 | args["agent_id"] = OSD.FromUUID(AgentID); | 190 | args["agent_id"] = OSD.FromUUID(AgentID); |
@@ -224,7 +224,7 @@ namespace OpenSim.Framework | |||
224 | { | 224 | { |
225 | args["appearance_serial"] = OSD.FromInteger(Appearance.Serial); | 225 | args["appearance_serial"] = OSD.FromInteger(Appearance.Serial); |
226 | 226 | ||
227 | OSDMap appmap = Appearance.Pack(wearablesCount); | 227 | OSDMap appmap = Appearance.Pack(ctx); |
228 | args["packed_appearance"] = appmap; | 228 | args["packed_appearance"] = appmap; |
229 | } | 229 | } |
230 | 230 | ||
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index 50746a0..5258760 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs | |||
@@ -717,7 +717,7 @@ namespace OpenSim.Framework | |||
717 | /// <summary> | 717 | /// <summary> |
718 | /// Create an OSDMap from the appearance data | 718 | /// Create an OSDMap from the appearance data |
719 | /// </summary> | 719 | /// </summary> |
720 | public OSDMap Pack(int wearablesCount) | 720 | public OSDMap Pack(EntityTransferContext ctx) |
721 | { | 721 | { |
722 | OSDMap data = new OSDMap(); | 722 | OSDMap data = new OSDMap(); |
723 | 723 | ||
@@ -728,8 +728,8 @@ namespace OpenSim.Framework | |||
728 | // | 728 | // |
729 | // This will send as many or as few wearables as we have, unless a count | 729 | // This will send as many or as few wearables as we have, unless a count |
730 | // is given. Used for legacy (pre 0.4) versions. | 730 | // is given. Used for legacy (pre 0.4) versions. |
731 | int count = wearablesCount; | 731 | int count = ctx.WearablesCount; |
732 | if (wearablesCount == -1) | 732 | if (ctx.WearablesCount == -1) |
733 | count = m_wearables.Length; | 733 | count = m_wearables.Length; |
734 | OSDArray wears = new OSDArray(count); | 734 | OSDArray wears = new OSDArray(count); |
735 | for (int i = 0; i < count; i++) | 735 | for (int i = 0; i < count; i++) |
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index 2fce155..72c2c34 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs | |||
@@ -61,8 +61,8 @@ namespace OpenSim.Framework | |||
61 | { | 61 | { |
62 | UUID AgentID { get; set; } | 62 | UUID AgentID { get; set; } |
63 | 63 | ||
64 | OSDMap Pack(Object parms = null); | 64 | OSDMap Pack(EntityTransferContext ctx); |
65 | void Unpack(OSDMap map, IScene scene); | 65 | void Unpack(OSDMap map, IScene scene, EntityTransferContext ctx); |
66 | } | 66 | } |
67 | 67 | ||
68 | /// <summary> | 68 | /// <summary> |
@@ -96,7 +96,7 @@ namespace OpenSim.Framework | |||
96 | 96 | ||
97 | public Dictionary<ulong, string> ChildrenCapSeeds = null; | 97 | public Dictionary<ulong, string> ChildrenCapSeeds = null; |
98 | 98 | ||
99 | public OSDMap Pack(Object parms = null) | 99 | public OSDMap Pack(EntityTransferContext ctx) |
100 | { | 100 | { |
101 | OSDMap args = new OSDMap(); | 101 | OSDMap args = new OSDMap(); |
102 | args["message_type"] = OSD.FromString("AgentPosition"); | 102 | args["message_type"] = OSD.FromString("AgentPosition"); |
@@ -136,7 +136,7 @@ namespace OpenSim.Framework | |||
136 | return args; | 136 | return args; |
137 | } | 137 | } |
138 | 138 | ||
139 | public void Unpack(OSDMap args, IScene scene) | 139 | public void Unpack(OSDMap args, IScene scene, EntityTransferContext ctx) |
140 | { | 140 | { |
141 | if (args.ContainsKey("region_handle")) | 141 | if (args.ContainsKey("region_handle")) |
142 | UInt64.TryParse(args["region_handle"].AsString(), out RegionHandle); | 142 | UInt64.TryParse(args["region_handle"].AsString(), out RegionHandle); |
@@ -391,18 +391,10 @@ namespace OpenSim.Framework | |||
391 | 391 | ||
392 | public Dictionary<string, UUID> MovementAnimationOverRides = new Dictionary<string, UUID>(); | 392 | public Dictionary<string, UUID> MovementAnimationOverRides = new Dictionary<string, UUID>(); |
393 | 393 | ||
394 | public virtual OSDMap Pack(Object parms = null) | 394 | public virtual OSDMap Pack(EntityTransferContext ctx) |
395 | { | 395 | { |
396 | int wearablesCount = -1; | 396 | int wearablesCount = -1; |
397 | 397 | ||
398 | if (parms != null) | ||
399 | { | ||
400 | Hashtable p = (Hashtable)parms; | ||
401 | |||
402 | if (p.ContainsKey("wearablesCount")) | ||
403 | wearablesCount = (int)p["wearablesCount"]; | ||
404 | } | ||
405 | |||
406 | // m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Pack data"); | 398 | // m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Pack data"); |
407 | 399 | ||
408 | OSDMap args = new OSDMap(); | 400 | OSDMap args = new OSDMap(); |
@@ -503,7 +495,7 @@ namespace OpenSim.Framework | |||
503 | } | 495 | } |
504 | 496 | ||
505 | if (Appearance != null) | 497 | if (Appearance != null) |
506 | args["packed_appearance"] = Appearance.Pack(wearablesCount); | 498 | args["packed_appearance"] = Appearance.Pack(ctx); |
507 | 499 | ||
508 | //if ((AgentTextures != null) && (AgentTextures.Length > 0)) | 500 | //if ((AgentTextures != null) && (AgentTextures.Length > 0)) |
509 | //{ | 501 | //{ |
@@ -594,7 +586,7 @@ namespace OpenSim.Framework | |||
594 | /// Avoiding reflection makes it painful to write, but that's the price! | 586 | /// Avoiding reflection makes it painful to write, but that's the price! |
595 | /// </summary> | 587 | /// </summary> |
596 | /// <param name="hash"></param> | 588 | /// <param name="hash"></param> |
597 | public virtual void Unpack(OSDMap args, IScene scene) | 589 | public virtual void Unpack(OSDMap args, IScene scene, EntityTransferContext ctx) |
598 | { | 590 | { |
599 | //m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Unpack data"); | 591 | //m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Unpack data"); |
600 | 592 | ||
@@ -903,14 +895,14 @@ namespace OpenSim.Framework | |||
903 | 895 | ||
904 | public class CompleteAgentData : AgentData | 896 | public class CompleteAgentData : AgentData |
905 | { | 897 | { |
906 | public override OSDMap Pack(object parms = null) | 898 | public override OSDMap Pack(EntityTransferContext ctx) |
907 | { | 899 | { |
908 | return base.Pack(parms); | 900 | return base.Pack(ctx); |
909 | } | 901 | } |
910 | 902 | ||
911 | public override void Unpack(OSDMap map, IScene scene) | 903 | public override void Unpack(OSDMap map, IScene scene, EntityTransferContext ctx) |
912 | { | 904 | { |
913 | base.Unpack(map, scene); | 905 | base.Unpack(map, scene, ctx); |
914 | } | 906 | } |
915 | } | 907 | } |
916 | } | 908 | } |
diff --git a/OpenSim/Framework/Tests/AgentCircuitDataTest.cs b/OpenSim/Framework/Tests/AgentCircuitDataTest.cs index a2a2eea..e8ae728 100644 --- a/OpenSim/Framework/Tests/AgentCircuitDataTest.cs +++ b/OpenSim/Framework/Tests/AgentCircuitDataTest.cs | |||
@@ -311,8 +311,9 @@ namespace OpenSim.Framework.Tests | |||
311 | Agent1Data.SessionID = SessionId; | 311 | Agent1Data.SessionID = SessionId; |
312 | Agent1Data.startpos = StartPos; | 312 | Agent1Data.startpos = StartPos; |
313 | 313 | ||
314 | EntityTransferContext ctx = new EntityTransferContext(); | ||
314 | OSDMap map2; | 315 | OSDMap map2; |
315 | OSDMap map = Agent1Data.PackAgentCircuitData(-1); | 316 | OSDMap map = Agent1Data.PackAgentCircuitData(ctx); |
316 | try | 317 | try |
317 | { | 318 | { |
318 | string str = OSDParser.SerializeJsonString(map); | 319 | string str = OSDParser.SerializeJsonString(map); |
diff --git a/OpenSim/Framework/Tests/MundaneFrameworkTests.cs b/OpenSim/Framework/Tests/MundaneFrameworkTests.cs index 08f2af5..d8072c7 100644 --- a/OpenSim/Framework/Tests/MundaneFrameworkTests.cs +++ b/OpenSim/Framework/Tests/MundaneFrameworkTests.cs | |||
@@ -116,7 +116,8 @@ namespace OpenSim.Framework.Tests | |||
116 | position2 = new AgentPosition(); | 116 | position2 = new AgentPosition(); |
117 | 117 | ||
118 | Assert.IsFalse(position2.AgentID == position1.AgentID, "Test Error, position2 should be a blank uninitialized AgentPosition"); | 118 | Assert.IsFalse(position2.AgentID == position1.AgentID, "Test Error, position2 should be a blank uninitialized AgentPosition"); |
119 | position2.Unpack(position1.Pack(), null); | 119 | EntityTransferContext ctx = new EntityTransferContext(); |
120 | position2.Unpack(position1.Pack(ctx), null, ctx); | ||
120 | 121 | ||
121 | Assert.IsTrue(position2.AgentID == position1.AgentID, "Agent ID didn't unpack the same way it packed"); | 122 | Assert.IsTrue(position2.AgentID == position1.AgentID, "Agent ID didn't unpack the same way it packed"); |
122 | Assert.IsTrue(position2.Position == position1.Position, "Position didn't unpack the same way it packed"); | 123 | Assert.IsTrue(position2.Position == position1.Position, "Position didn't unpack the same way it packed"); |
@@ -305,4 +306,4 @@ namespace OpenSim.Framework.Tests | |||
305 | 306 | ||
306 | } | 307 | } |
307 | } | 308 | } |
308 | } \ No newline at end of file | 309 | } |