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 | |
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
10 files changed, 32 insertions, 50 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 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index e945b30..29f5a83 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -3114,7 +3114,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3114 | if (appearanceModule != null) | 3114 | if (appearanceModule != null) |
3115 | { | 3115 | { |
3116 | appearanceModule.SaveBakedTextures(sp.UUID); | 3116 | appearanceModule.SaveBakedTextures(sp.UUID); |
3117 | OSDMap appearancePacked = sp.Appearance.Pack(-1); | 3117 | EntityTransferContext ctx = new EntityTransferContext(); |
3118 | OSDMap appearancePacked = sp.Appearance.Pack(ctx); | ||
3118 | 3119 | ||
3119 | TaskInventoryItem item | 3120 | TaskInventoryItem item |
3120 | = SaveNotecard(notecard, "Avatar Appearance", Util.GetFormattedXml(appearancePacked as OSD), true); | 3121 | = SaveNotecard(notecard, "Avatar Appearance", Util.GetFormattedXml(appearancePacked as OSD), true); |
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index f6a7e19..7ab7dea 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | |||
@@ -262,7 +262,6 @@ namespace OpenSim.Server.Handlers.Simulation | |||
262 | resp["version"] = OSD.FromString(legacyVersion); | 262 | resp["version"] = OSD.FromString(legacyVersion); |
263 | resp["negotiated_inbound_version"] = OSD.FromReal(inboundVersion); | 263 | resp["negotiated_inbound_version"] = OSD.FromReal(inboundVersion); |
264 | resp["negotiated_outbound_version"] = OSD.FromReal(outboundVersion); | 264 | resp["negotiated_outbound_version"] = OSD.FromReal(outboundVersion); |
265 | resp["variable_wearables_count_supported"] = OSD.FromBoolean(true); | ||
266 | 265 | ||
267 | OSDArray featuresWanted = new OSDArray(); | 266 | OSDArray featuresWanted = new OSDArray(); |
268 | foreach (UUID feature in features) | 267 | foreach (UUID feature in features) |
@@ -661,6 +660,9 @@ namespace OpenSim.Server.Handlers.Simulation | |||
661 | 660 | ||
662 | protected void DoAgentPut(Hashtable request, Hashtable responsedata) | 661 | protected void DoAgentPut(Hashtable request, Hashtable responsedata) |
663 | { | 662 | { |
663 | // TODO: Encode the ENtityTransferContext | ||
664 | EntityTransferContext ctx = new EntityTransferContext(); | ||
665 | |||
664 | OSDMap args = Utils.GetOSDMap((string)request["body"]); | 666 | OSDMap args = Utils.GetOSDMap((string)request["body"]); |
665 | if (args == null) | 667 | if (args == null) |
666 | { | 668 | { |
@@ -703,7 +705,7 @@ namespace OpenSim.Server.Handlers.Simulation | |||
703 | AgentData agent = new AgentData(); | 705 | AgentData agent = new AgentData(); |
704 | try | 706 | try |
705 | { | 707 | { |
706 | agent.Unpack(args, m_SimulationService.GetScene(destination.RegionID)); | 708 | agent.Unpack(args, m_SimulationService.GetScene(destination.RegionID), ctx); |
707 | } | 709 | } |
708 | catch (Exception ex) | 710 | catch (Exception ex) |
709 | { | 711 | { |
@@ -722,7 +724,7 @@ namespace OpenSim.Server.Handlers.Simulation | |||
722 | AgentPosition agent = new AgentPosition(); | 724 | AgentPosition agent = new AgentPosition(); |
723 | try | 725 | try |
724 | { | 726 | { |
725 | agent.Unpack(args, m_SimulationService.GetScene(destination.RegionID)); | 727 | agent.Unpack(args, m_SimulationService.GetScene(destination.RegionID), ctx); |
726 | } | 728 | } |
727 | catch (Exception ex) | 729 | catch (Exception ex) |
728 | { | 730 | { |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs index d355eab..a52dd6c 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs | |||
@@ -152,7 +152,8 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
152 | // <param name=""></param> | 152 | // <param name=""></param> |
153 | public bool SetAppearance(UUID userID, AvatarAppearance appearance) | 153 | public bool SetAppearance(UUID userID, AvatarAppearance appearance) |
154 | { | 154 | { |
155 | OSDMap map = appearance.Pack(-1); | 155 | EntityTransferContext ctx = new EntityTransferContext(); |
156 | OSDMap map = appearance.Pack(ctx); | ||
156 | if (map == null) | 157 | if (map == null) |
157 | { | 158 | { |
158 | m_log.WarnFormat("[SIMIAN AVATAR CONNECTOR]: Failed to encode appearance for {0}",userID); | 159 | m_log.WarnFormat("[SIMIAN AVATAR CONNECTOR]: Failed to encode appearance for {0}",userID); |
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index bb47e6b..0ebd37e 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | |||
@@ -121,7 +121,7 @@ namespace OpenSim.Services.Connectors.Simulation | |||
121 | 121 | ||
122 | try | 122 | try |
123 | { | 123 | { |
124 | OSDMap args = aCircuit.PackAgentCircuitData(-1); | 124 | OSDMap args = aCircuit.PackAgentCircuitData(ctx); |
125 | PackData(args, source, aCircuit, destination, flags); | 125 | PackData(args, source, aCircuit, destination, flags); |
126 | 126 | ||
127 | OSDMap result = WebUtil.PostToServiceCompressed(uri, args, 30000); | 127 | OSDMap result = WebUtil.PostToServiceCompressed(uri, args, 30000); |
@@ -260,7 +260,7 @@ namespace OpenSim.Services.Connectors.Simulation | |||
260 | 260 | ||
261 | try | 261 | try |
262 | { | 262 | { |
263 | OSDMap args = cAgentData.Pack(); | 263 | OSDMap args = cAgentData.Pack(ctx); |
264 | 264 | ||
265 | args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString()); | 265 | args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString()); |
266 | args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString()); | 266 | args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString()); |
@@ -347,8 +347,6 @@ namespace OpenSim.Services.Connectors.Simulation | |||
347 | ctx.OutboundVersion = float.Parse(parts[1]); | 347 | ctx.OutboundVersion = float.Parse(parts[1]); |
348 | } | 348 | } |
349 | } | 349 | } |
350 | if (data.ContainsKey("variable_wearables_count_supported")) | ||
351 | ctx.VariableWearablesSupported = true; | ||
352 | 350 | ||
353 | m_log.DebugFormat( | 351 | m_log.DebugFormat( |
354 | "[REMOTE SIMULATION CONNECTOR]: QueryAccess to {0} returned {1}, reason {2}, version {3}/{4}", | 352 | "[REMOTE SIMULATION CONNECTOR]: QueryAccess to {0} returned {1}, reason {2}, version {3}/{4}", |
diff --git a/OpenSim/Services/Interfaces/ISimulationService.cs b/OpenSim/Services/Interfaces/ISimulationService.cs index 4496a9f..d89f6ff 100644 --- a/OpenSim/Services/Interfaces/ISimulationService.cs +++ b/OpenSim/Services/Interfaces/ISimulationService.cs | |||
@@ -34,20 +34,6 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; | |||
34 | 34 | ||
35 | namespace OpenSim.Services.Interfaces | 35 | namespace OpenSim.Services.Interfaces |
36 | { | 36 | { |
37 | public class EntityTransferContext | ||
38 | { | ||
39 | public EntityTransferContext() | ||
40 | { | ||
41 | InboundVersion = VersionInfo.SimulationServiceVersionAcceptedMax; | ||
42 | OutboundVersion = VersionInfo.SimulationServiceVersionSupportedMax; | ||
43 | VariableWearablesSupported = false; | ||
44 | } | ||
45 | |||
46 | public float InboundVersion { get; set; } | ||
47 | public float OutboundVersion { get; set; } | ||
48 | public bool VariableWearablesSupported { get; set; } | ||
49 | } | ||
50 | |||
51 | public interface ISimulationService | 37 | public interface ISimulationService |
52 | { | 38 | { |
53 | /// <summary> | 39 | /// <summary> |