diff options
author | Diva Canto | 2013-12-06 16:02:03 -0800 |
---|---|---|
committer | Diva Canto | 2013-12-06 16:02:03 -0800 |
commit | 5047bd7b4403177fb92a6b4c84a7ba2eaff3b86e (patch) | |
tree | 855b759cf5de6fff16e81b39d09eeaeab7c3d012 /OpenSim/Region | |
parent | Fixed misleading comment (diff) | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-5047bd7b4403177fb92a6b4c84a7ba2eaff3b86e.zip opensim-SC-5047bd7b4403177fb92a6b4c84a7ba2eaff3b86e.tar.gz opensim-SC-5047bd7b4403177fb92a6b4c84a7ba2eaff3b86e.tar.bz2 opensim-SC-5047bd7b4403177fb92a6b4c84a7ba2eaff3b86e.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region')
4 files changed, 85 insertions, 16 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index 1d4c7f0..a4fe81c 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | |||
@@ -498,24 +498,28 @@ namespace OpenSim.Region.ClientStack.Linden | |||
498 | 498 | ||
499 | if (inventoryType == "sound") | 499 | if (inventoryType == "sound") |
500 | { | 500 | { |
501 | inType = 1; | 501 | inType = (sbyte)InventoryType.Sound; |
502 | assType = 1; | 502 | assType = (sbyte)AssetType.Sound; |
503 | } | ||
504 | else if (inventoryType == "snapshot") | ||
505 | { | ||
506 | inType = (sbyte)InventoryType.Snapshot; | ||
503 | } | 507 | } |
504 | else if (inventoryType == "animation") | 508 | else if (inventoryType == "animation") |
505 | { | 509 | { |
506 | inType = 19; | 510 | inType = (sbyte)InventoryType.Animation; |
507 | assType = 20; | 511 | assType = (sbyte)AssetType.Animation; |
508 | } | 512 | } |
509 | else if (inventoryType == "wearable") | 513 | else if (inventoryType == "wearable") |
510 | { | 514 | { |
511 | inType = 18; | 515 | inType = (sbyte)InventoryType.Wearable; |
512 | switch (assetType) | 516 | switch (assetType) |
513 | { | 517 | { |
514 | case "bodypart": | 518 | case "bodypart": |
515 | assType = 13; | 519 | assType = (sbyte)AssetType.Bodypart; |
516 | break; | 520 | break; |
517 | case "clothing": | 521 | case "clothing": |
518 | assType = 5; | 522 | assType = (sbyte)AssetType.Clothing; |
519 | break; | 523 | break; |
520 | } | 524 | } |
521 | } | 525 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index 56ff2bd..b21082f 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs | |||
@@ -270,6 +270,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
270 | // Notes | 270 | // Notes |
271 | client.AddGenericPacketHandler("avatarnotesrequest", NotesRequest); | 271 | client.AddGenericPacketHandler("avatarnotesrequest", NotesRequest); |
272 | client.OnAvatarNotesUpdate += NotesUpdate; | 272 | client.OnAvatarNotesUpdate += NotesUpdate; |
273 | |||
274 | // Preferences | ||
275 | client.OnUserInfoRequest += UserPreferencesRequest; | ||
276 | client.OnUpdateUserInfo += UpdateUserPreferences; | ||
273 | } | 277 | } |
274 | #endregion Region Event Handlers | 278 | #endregion Region Event Handlers |
275 | 279 | ||
@@ -799,6 +803,69 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
799 | } | 803 | } |
800 | #endregion Notes | 804 | #endregion Notes |
801 | 805 | ||
806 | #region User Preferences | ||
807 | /// <summary> | ||
808 | /// Updates the user preferences. | ||
809 | /// </summary> | ||
810 | /// <param name='imViaEmail'> | ||
811 | /// Im via email. | ||
812 | /// </param> | ||
813 | /// <param name='visible'> | ||
814 | /// Visible. | ||
815 | /// </param> | ||
816 | /// <param name='remoteClient'> | ||
817 | /// Remote client. | ||
818 | /// </param> | ||
819 | public void UpdateUserPreferences(bool imViaEmail, bool visible, IClientAPI remoteClient) | ||
820 | { | ||
821 | UserPreferences pref = new UserPreferences(); | ||
822 | |||
823 | pref.UserId = remoteClient.AgentId; | ||
824 | pref.IMViaEmail = imViaEmail; | ||
825 | pref.Visible = visible; | ||
826 | |||
827 | string serverURI = string.Empty; | ||
828 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | ||
829 | |||
830 | object Pref = pref; | ||
831 | if(!JsonRpcRequest(ref Pref, "user_preferences_update", serverURI, UUID.Random().ToString())) | ||
832 | { | ||
833 | m_log.InfoFormat("[PROFILES]: UserPreferences update error"); | ||
834 | remoteClient.SendAgentAlertMessage("Error updating preferences", false); | ||
835 | return; | ||
836 | } | ||
837 | } | ||
838 | |||
839 | /// <summary> | ||
840 | /// Users the preferences request. | ||
841 | /// </summary> | ||
842 | /// <param name='remoteClient'> | ||
843 | /// Remote client. | ||
844 | /// </param> | ||
845 | public void UserPreferencesRequest(IClientAPI remoteClient) | ||
846 | { | ||
847 | UserPreferences pref = new UserPreferences(); | ||
848 | |||
849 | pref.UserId = remoteClient.AgentId; | ||
850 | |||
851 | string serverURI = string.Empty; | ||
852 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | ||
853 | |||
854 | |||
855 | object Pref = (object)pref; | ||
856 | if(!JsonRpcRequest(ref Pref, "user_preferences_request", serverURI, UUID.Random().ToString())) | ||
857 | { | ||
858 | m_log.InfoFormat("[PROFILES]: UserPreferences request error"); | ||
859 | remoteClient.SendAgentAlertMessage("Error requesting preferences", false); | ||
860 | return; | ||
861 | } | ||
862 | pref = (UserPreferences) Pref; | ||
863 | |||
864 | remoteClient.SendUserInfoReply(pref.IMViaEmail, pref.Visible, pref.EMail); | ||
865 | |||
866 | } | ||
867 | #endregion User Preferences | ||
868 | |||
802 | #region Avatar Properties | 869 | #region Avatar Properties |
803 | /// <summary> | 870 | /// <summary> |
804 | /// Update the avatars interests . | 871 | /// Update the avatars interests . |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/UserProfiles/LocalUserProfilesServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/UserProfiles/LocalUserProfilesServiceConnector.cs index 323535a..4701ee6 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/UserProfiles/LocalUserProfilesServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/UserProfiles/LocalUserProfilesServiceConnector.cs | |||
@@ -153,6 +153,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Profile | |||
153 | Server.AddJsonRPCHandler("avatar_properties_request", handler.AvatarPropertiesRequest); | 153 | Server.AddJsonRPCHandler("avatar_properties_request", handler.AvatarPropertiesRequest); |
154 | Server.AddJsonRPCHandler("avatar_properties_update", handler.AvatarPropertiesUpdate); | 154 | Server.AddJsonRPCHandler("avatar_properties_update", handler.AvatarPropertiesUpdate); |
155 | Server.AddJsonRPCHandler("avatar_interests_update", handler.AvatarInterestsUpdate); | 155 | Server.AddJsonRPCHandler("avatar_interests_update", handler.AvatarInterestsUpdate); |
156 | Server.AddJsonRPCHandler("user_preferences_update", handler.UserPreferenecesUpdate); | ||
157 | Server.AddJsonRPCHandler("user_preferences_request", handler.UserPreferencesRequest); | ||
156 | Server.AddJsonRPCHandler("image_assets_request", handler.AvatarImageAssetsRequest); | 158 | Server.AddJsonRPCHandler("image_assets_request", handler.AvatarImageAssetsRequest); |
157 | Server.AddJsonRPCHandler("user_data_request", handler.RequestUserAppData); | 159 | Server.AddJsonRPCHandler("user_data_request", handler.RequestUserAppData); |
158 | Server.AddJsonRPCHandler("user_data_update", handler.UpdateUserAppData); | 160 | Server.AddJsonRPCHandler("user_data_update", handler.UpdateUserAppData); |
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index 1f08b03..e313a30 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs | |||
@@ -40,7 +40,6 @@ using log4net; | |||
40 | using Nini.Config; | 40 | using Nini.Config; |
41 | using System.Reflection; | 41 | using System.Reflection; |
42 | using System.IO; | 42 | using System.IO; |
43 | using ComponentAce.Compression.Libs.zlib; | ||
44 | 43 | ||
45 | namespace OpenSim.Region.Physics.Meshing | 44 | namespace OpenSim.Region.Physics.Meshing |
46 | { | 45 | { |
@@ -549,7 +548,6 @@ namespace OpenSim.Region.Physics.Meshing | |||
549 | return true; | 548 | return true; |
550 | } | 549 | } |
551 | 550 | ||
552 | |||
553 | /// <summary> | 551 | /// <summary> |
554 | /// decompresses a gzipped OSD object | 552 | /// decompresses a gzipped OSD object |
555 | /// </summary> | 553 | /// </summary> |
@@ -564,15 +562,13 @@ namespace OpenSim.Region.Physics.Meshing | |||
564 | { | 562 | { |
565 | using (MemoryStream outMs = new MemoryStream()) | 563 | using (MemoryStream outMs = new MemoryStream()) |
566 | { | 564 | { |
567 | using (ZOutputStream zOut = new ZOutputStream(outMs)) | 565 | using (DeflateStream decompressionStream = new DeflateStream(inMs, CompressionMode.Decompress)) |
568 | { | 566 | { |
569 | byte[] readBuffer = new byte[2048]; | 567 | byte[] readBuffer = new byte[2048]; |
570 | int readLen = 0; | 568 | inMs.Read(readBuffer, 0, 2); // skip first 2 bytes in header |
571 | while ((readLen = inMs.Read(readBuffer, 0, readBuffer.Length)) > 0) | 569 | |
572 | { | 570 | decompressionStream.CopyTo(outMs); |
573 | zOut.Write(readBuffer, 0, readLen); | 571 | |
574 | } | ||
575 | zOut.Flush(); | ||
576 | outMs.Seek(0, SeekOrigin.Begin); | 572 | outMs.Seek(0, SeekOrigin.Begin); |
577 | 573 | ||
578 | byte[] decompressedBuf = outMs.GetBuffer(); | 574 | byte[] decompressedBuf = outMs.GetBuffer(); |