aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2013-12-07 01:19:20 +0000
committerMelanie2013-12-07 01:19:20 +0000
commitba48816fb676d17298e03e82579fc4f54fa48800 (patch)
treecfa25ad1116eb0f7bd42eb2d2ebecf19eae939e8 /OpenSim/Region
parentMerge branch 'master' into careminster (diff)
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-ba48816fb676d17298e03e82579fc4f54fa48800.zip
opensim-SC_OLD-ba48816fb676d17298e03e82579fc4f54fa48800.tar.gz
opensim-SC_OLD-ba48816fb676d17298e03e82579fc4f54fa48800.tar.bz2
opensim-SC_OLD-ba48816fb676d17298e03e82579fc4f54fa48800.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs67
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/UserProfiles/LocalUserProfilesServiceConnector.cs2
-rw-r--r--OpenSim/Region/Physics/Meshing/Meshmerizer.cs16
3 files changed, 77 insertions, 8 deletions
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 e92ae50..6938e55 100644
--- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
+++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
@@ -40,7 +40,6 @@ using log4net;
40using Nini.Config; 40using Nini.Config;
41using System.Reflection; 41using System.Reflection;
42using System.IO; 42using System.IO;
43using ComponentAce.Compression.Libs.zlib;
44 43
45namespace OpenSim.Region.Physics.Meshing 44namespace 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,17 @@ 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];
568 inMs.Read(readBuffer, 0, 2); // skip first 2 bytes in header
570 int readLen = 0; 569 int readLen = 0;
571 while ((readLen = inMs.Read(readBuffer, 0, readBuffer.Length)) > 0) 570
572 { 571 while ((readLen = decompressionStream.Read(readBuffer, 0, readBuffer.Length)) > 0)
573 zOut.Write(readBuffer, 0, readLen); 572 outMs.Write(readBuffer, 0, readLen);
574 } 573
575 zOut.Flush(); 574 outMs.Flush();
575
576 outMs.Seek(0, SeekOrigin.Begin); 576 outMs.Seek(0, SeekOrigin.Begin);
577 577
578 byte[] decompressedBuf = outMs.GetBuffer(); 578 byte[] decompressedBuf = outMs.GetBuffer();