diff options
author | Melanie Thielker | 2014-08-20 04:39:48 +0200 |
---|---|---|
committer | Melanie Thielker | 2014-08-20 04:39:48 +0200 |
commit | 24b4f6ad7b9e9b54b3efb80aec462fa03e226c32 (patch) | |
tree | 3128c12ea30a35b30caaf598a8a023c5987d279d /OpenSim/Framework | |
parent | Expect a missing directory, the asset cache is shared. Prevent spew if (diff) | |
parent | also send attachment pre-kills on crossings (diff) | |
download | opensim-SC-24b4f6ad7b9e9b54b3efb80aec462fa03e226c32.zip opensim-SC-24b4f6ad7b9e9b54b3efb80aec462fa03e226c32.tar.gz opensim-SC-24b4f6ad7b9e9b54b3efb80aec462fa03e226c32.tar.bz2 opensim-SC-24b4f6ad7b9e9b54b3efb80aec462fa03e226c32.tar.xz |
Merge branch 'ubitworkmaster'
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/ChildAgentDataUpdate.cs | 83 | ||||
-rw-r--r-- | OpenSim/Framework/IClientAPI.cs | 2 | ||||
-rw-r--r-- | OpenSim/Framework/WebUtil.cs | 19 |
3 files changed, 68 insertions, 36 deletions
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index 5beb37d..91df64d 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs | |||
@@ -431,6 +431,8 @@ namespace OpenSim.Framework | |||
431 | // The code to pack textures, visuals, wearables and attachments | 431 | // The code to pack textures, visuals, wearables and attachments |
432 | // should be removed; packed appearance contains the full appearance | 432 | // should be removed; packed appearance contains the full appearance |
433 | // This is retained for backward compatibility only | 433 | // This is retained for backward compatibility only |
434 | |||
435 | /* then lets remove | ||
434 | if (Appearance.Texture != null) | 436 | if (Appearance.Texture != null) |
435 | { | 437 | { |
436 | byte[] rawtextures = Appearance.Texture.GetBytes(); | 438 | byte[] rawtextures = Appearance.Texture.GetBytes(); |
@@ -459,7 +461,7 @@ namespace OpenSim.Framework | |||
459 | args["attachments"] = attachs; | 461 | args["attachments"] = attachs; |
460 | } | 462 | } |
461 | // End of code to remove | 463 | // End of code to remove |
462 | 464 | */ | |
463 | if ((Controllers != null) && (Controllers.Length > 0)) | 465 | if ((Controllers != null) && (Controllers.Length > 0)) |
464 | { | 466 | { |
465 | OSDArray controls = new OSDArray(Controllers.Length); | 467 | OSDArray controls = new OSDArray(Controllers.Length); |
@@ -647,58 +649,71 @@ namespace OpenSim.Framework | |||
647 | // AgentTextures[i++] = o.AsUUID(); | 649 | // AgentTextures[i++] = o.AsUUID(); |
648 | //} | 650 | //} |
649 | 651 | ||
650 | Appearance = new AvatarAppearance(); | ||
651 | 652 | ||
652 | // The code to unpack textures, visuals, wearables and attachments | 653 | // packed_appearence should contain all appearance information |
653 | // should be removed; packed appearance contains the full appearance | 654 | if (args.ContainsKey("packed_appearance") && (args["packed_appearance"]).Type == OSDType.Map) |
654 | // This is retained for backward compatibility only | ||
655 | if (args["texture_entry"] != null) | ||
656 | { | 655 | { |
657 | byte[] rawtextures = args["texture_entry"].AsBinary(); | 656 | m_log.WarnFormat("[CHILDAGENTDATAUPDATE] got packed appearance"); |
658 | Primitive.TextureEntry textures = new Primitive.TextureEntry(rawtextures,0,rawtextures.Length); | 657 | Appearance = new AvatarAppearance((OSDMap)args["packed_appearance"]); |
659 | Appearance.SetTextureEntries(textures); | ||
660 | } | 658 | } |
659 | else | ||
660 | { | ||
661 | // if missing try the old pack method | ||
662 | m_log.WarnFormat("[CHILDAGENTDATAUPDATE] No packed appearance, checking old method"); | ||
661 | 663 | ||
662 | if (args["visual_params"] != null) | 664 | Appearance = new AvatarAppearance(); |
663 | Appearance.SetVisualParams(args["visual_params"].AsBinary()); | ||
664 | 665 | ||
665 | if ((args["wearables"] != null) && (args["wearables"]).Type == OSDType.Array) | 666 | // The code to unpack textures, visuals, wearables and attachments |
666 | { | 667 | // should be removed; packed appearance contains the full appearance |
667 | OSDArray wears = (OSDArray)(args["wearables"]); | 668 | // This is retained for backward compatibility only |
669 | if (args["texture_entry"] != null) | ||
670 | { | ||
671 | byte[] rawtextures = args["texture_entry"].AsBinary(); | ||
672 | Primitive.TextureEntry textures = new Primitive.TextureEntry(rawtextures, 0, rawtextures.Length); | ||
673 | Appearance.SetTextureEntries(textures); | ||
674 | } | ||
668 | 675 | ||
669 | int count = wears.Count; | 676 | if (args["visual_params"] != null) |
670 | if (count > AvatarWearable.MAX_WEARABLES) | 677 | Appearance.SetVisualParams(args["visual_params"].AsBinary()); |
671 | count = AvatarWearable.MAX_WEARABLES; | ||
672 | 678 | ||
673 | for (int i = 0; i < count / 2; i++) | 679 | if ((args["wearables"] != null) && (args["wearables"]).Type == OSDType.Array) |
674 | { | 680 | { |
675 | AvatarWearable awear = new AvatarWearable((OSDArray)wears[i]); | 681 | OSDArray wears = (OSDArray)(args["wearables"]); |
676 | Appearance.SetWearable(i,awear); | 682 | |
683 | int count = wears.Count; | ||
684 | if (count > AvatarWearable.MAX_WEARABLES) | ||
685 | count = AvatarWearable.MAX_WEARABLES; | ||
686 | |||
687 | for (int i = 0; i < count / 2; i++) | ||
688 | { | ||
689 | AvatarWearable awear = new AvatarWearable((OSDArray)wears[i]); | ||
690 | Appearance.SetWearable(i, awear); | ||
691 | } | ||
677 | } | 692 | } |
678 | } | ||
679 | 693 | ||
680 | if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array) | 694 | if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array) |
681 | { | ||
682 | OSDArray attachs = (OSDArray)(args["attachments"]); | ||
683 | foreach (OSD o in attachs) | ||
684 | { | 695 | { |
685 | if (o.Type == OSDType.Map) | 696 | OSDArray attachs = (OSDArray)(args["attachments"]); |
697 | foreach (OSD o in attachs) | ||
686 | { | 698 | { |
687 | // We know all of these must end up as attachments so we | 699 | if (o.Type == OSDType.Map) |
688 | // append rather than replace to ensure multiple attachments | 700 | { |
689 | // per point continues to work | 701 | // We know all of these must end up as attachments so we |
690 | // m_log.DebugFormat("[CHILDAGENTDATAUPDATE]: Appending attachments for {0}", AgentID); | 702 | // append rather than replace to ensure multiple attachments |
691 | Appearance.AppendAttachment(new AvatarAttachment((OSDMap)o)); | 703 | // per point continues to work |
704 | // m_log.DebugFormat("[CHILDAGENTDATAUPDATE]: Appending attachments for {0}", AgentID); | ||
705 | Appearance.AppendAttachment(new AvatarAttachment((OSDMap)o)); | ||
706 | } | ||
692 | } | 707 | } |
693 | } | 708 | } |
709 | // end of code to remove | ||
694 | } | 710 | } |
695 | // end of code to remove | 711 | /* moved above |
696 | |||
697 | if (args.ContainsKey("packed_appearance") && (args["packed_appearance"]).Type == OSDType.Map) | 712 | if (args.ContainsKey("packed_appearance") && (args["packed_appearance"]).Type == OSDType.Map) |
698 | Appearance = new AvatarAppearance((OSDMap)args["packed_appearance"]); | 713 | Appearance = new AvatarAppearance((OSDMap)args["packed_appearance"]); |
699 | else | 714 | else |
700 | m_log.WarnFormat("[CHILDAGENTDATAUPDATE] No packed appearance"); | 715 | m_log.WarnFormat("[CHILDAGENTDATAUPDATE] No packed appearance"); |
701 | 716 | */ | |
702 | if ((args["controllers"] != null) && (args["controllers"]).Type == OSDType.Array) | 717 | if ((args["controllers"] != null) && (args["controllers"]).Type == OSDType.Array) |
703 | { | 718 | { |
704 | OSDArray controls = (OSDArray)(args["controllers"]); | 719 | OSDArray controls = (OSDArray)(args["controllers"]); |
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 22cc79d..3b0430b 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -755,6 +755,8 @@ namespace OpenSim.Framework | |||
755 | /// </summary> | 755 | /// </summary> |
756 | bool IsActive { get; set; } | 756 | bool IsActive { get; set; } |
757 | 757 | ||
758 | int PingTimeMS { get; } | ||
759 | |||
758 | /// <summary> | 760 | /// <summary> |
759 | /// Set if the client is closing due to a logout request | 761 | /// Set if the client is closing due to a logout request |
760 | /// </summary> | 762 | /// </summary> |
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 33ef8e0..86e5293 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs | |||
@@ -81,7 +81,7 @@ namespace OpenSim.Framework | |||
81 | /// Number of milliseconds a call can take before it is considered | 81 | /// Number of milliseconds a call can take before it is considered |
82 | /// a "long" call for warning & debugging purposes | 82 | /// a "long" call for warning & debugging purposes |
83 | /// </summary> | 83 | /// </summary> |
84 | public const int LongCallTime = 3000; | 84 | public const int LongCallTime = 500; |
85 | 85 | ||
86 | /// <summary> | 86 | /// <summary> |
87 | /// The maximum length of any data logged because of a long request time. | 87 | /// The maximum length of any data logged because of a long request time. |
@@ -208,6 +208,9 @@ namespace OpenSim.Framework | |||
208 | string errorMessage = "unknown error"; | 208 | string errorMessage = "unknown error"; |
209 | int tickstart = Util.EnvironmentTickCount(); | 209 | int tickstart = Util.EnvironmentTickCount(); |
210 | int tickdata = 0; | 210 | int tickdata = 0; |
211 | int tickcompressdata = 0; | ||
212 | int tickJsondata = 0; | ||
213 | int compsize = 0; | ||
211 | string strBuffer = null; | 214 | string strBuffer = null; |
212 | 215 | ||
213 | try | 216 | try |
@@ -225,6 +228,8 @@ namespace OpenSim.Framework | |||
225 | { | 228 | { |
226 | strBuffer = OSDParser.SerializeJsonString(data); | 229 | strBuffer = OSDParser.SerializeJsonString(data); |
227 | 230 | ||
231 | tickJsondata = Util.EnvironmentTickCountSubtract(tickstart); | ||
232 | |||
228 | if (DebugLevel >= 5) | 233 | if (DebugLevel >= 5) |
229 | LogOutgoingDetail(strBuffer); | 234 | LogOutgoingDetail(strBuffer); |
230 | 235 | ||
@@ -243,13 +248,19 @@ namespace OpenSim.Framework | |||
243 | // gets written on the strteam upon Dispose() | 248 | // gets written on the strteam upon Dispose() |
244 | } | 249 | } |
245 | byte[] buf = ms.ToArray(); | 250 | byte[] buf = ms.ToArray(); |
251 | |||
252 | tickcompressdata = Util.EnvironmentTickCountSubtract(tickstart); | ||
253 | |||
246 | request.ContentLength = buf.Length; //Count bytes to send | 254 | request.ContentLength = buf.Length; //Count bytes to send |
255 | compsize = buf.Length; | ||
247 | using (Stream requestStream = request.GetRequestStream()) | 256 | using (Stream requestStream = request.GetRequestStream()) |
248 | requestStream.Write(buf, 0, (int)buf.Length); | 257 | requestStream.Write(buf, 0, (int)buf.Length); |
249 | } | 258 | } |
250 | } | 259 | } |
251 | else | 260 | else |
252 | { | 261 | { |
262 | tickcompressdata = tickJsondata; | ||
263 | compsize = buffer.Length; | ||
253 | request.ContentType = "application/json"; | 264 | request.ContentType = "application/json"; |
254 | request.ContentLength = buffer.Length; //Count bytes to send | 265 | request.ContentLength = buffer.Length; //Count bytes to send |
255 | using (Stream requestStream = request.GetRequestStream()) | 266 | using (Stream requestStream = request.GetRequestStream()) |
@@ -291,12 +302,16 @@ namespace OpenSim.Framework | |||
291 | int tickdiff = Util.EnvironmentTickCountSubtract(tickstart); | 302 | int tickdiff = Util.EnvironmentTickCountSubtract(tickstart); |
292 | if (tickdiff > LongCallTime) | 303 | if (tickdiff > LongCallTime) |
293 | m_log.InfoFormat( | 304 | m_log.InfoFormat( |
294 | "[WEB UTIL]: Slow ServiceOSD request {0} {1} {2} took {3}ms, {4}ms writing, {5}", | 305 | "[WEB UTIL]: Slow ServiceOSD request {0} {1} {2} took {3}ms, {4}ms writing({5} at Json; {6} at comp), {7} bytes ({8} uncomp): {9}", |
295 | reqnum, | 306 | reqnum, |
296 | method, | 307 | method, |
297 | url, | 308 | url, |
298 | tickdiff, | 309 | tickdiff, |
299 | tickdata, | 310 | tickdata, |
311 | tickJsondata, | ||
312 | tickcompressdata, | ||
313 | compsize, | ||
314 | strBuffer != null ? strBuffer.Length : 0, | ||
300 | strBuffer != null | 315 | strBuffer != null |
301 | ? (strBuffer.Length > MaxRequestDiagLength ? strBuffer.Remove(MaxRequestDiagLength) : strBuffer) | 316 | ? (strBuffer.Length > MaxRequestDiagLength ? strBuffer.Remove(MaxRequestDiagLength) : strBuffer) |
302 | : ""); | 317 | : ""); |