aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authordahlia2013-12-06 15:58:51 -0800
committerdahlia2013-12-06 15:58:51 -0800
commitaba2a444538fc0ab5ae093004dc9994abab299e3 (patch)
tree21b1dc7790e08ba8de07c073dd7b6186ce10d938 /OpenSim/Region
parentuse System.IO.Compression.DeflateStream for mesh decompression in an attempt ... (diff)
parentAdd support for user preferences (im via email) (diff)
downloadopensim-SC_OLD-aba2a444538fc0ab5ae093004dc9994abab299e3.zip
opensim-SC_OLD-aba2a444538fc0ab5ae093004dc9994abab299e3.tar.gz
opensim-SC_OLD-aba2a444538fc0ab5ae093004dc9994abab299e3.tar.bz2
opensim-SC_OLD-aba2a444538fc0ab5ae093004dc9994abab299e3.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs18
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs25
-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/Framework/Scenes/ScenePresence.cs7
5 files changed, 108 insertions, 11 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/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index c1aae3f..a04ded5 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -5091,7 +5091,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5091// acceleration = new Vector3(1, 0, 0); 5091// acceleration = new Vector3(1, 0, 0);
5092 5092
5093 angularVelocity = presence.AngularVelocity; 5093 angularVelocity = presence.AngularVelocity;
5094
5095 // Whilst not in mouselook, an avatar will transmit only the Z rotation as this is the only axis
5096 // it rotates around.
5097 // In mouselook, X and Y co-ordinate will also be sent but when used in Rotation, these cause unwanted
5098 // excessive up and down movements of the camera when looking up and down.
5099 // See http://opensimulator.org/mantis/view.php?id=3274
5100 // This does not affect head movement, since this is controlled entirely by camera movement rather than
5101 // body rotation. It does not affect sitting avatar since it's the sitting part rotation that takes
5102 // effect, not the avatar rotation.
5094 rotation = presence.Rotation; 5103 rotation = presence.Rotation;
5104 rotation.X = 0;
5105 rotation.Y = 0;
5095 5106
5096 if (sendTexture) 5107 if (sendTexture)
5097 textureEntry = presence.Appearance.Texture.GetBytes(); 5108 textureEntry = presence.Appearance.Texture.GetBytes();
@@ -5207,7 +5218,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5207 data.OffsetPosition.ToBytes(objectData, 16); 5218 data.OffsetPosition.ToBytes(objectData, 16);
5208// data.Velocity.ToBytes(objectData, 28); 5219// data.Velocity.ToBytes(objectData, 28);
5209// data.Acceleration.ToBytes(objectData, 40); 5220// data.Acceleration.ToBytes(objectData, 40);
5210 data.Rotation.ToBytes(objectData, 52); 5221
5222 // Whilst not in mouselook, an avatar will transmit only the Z rotation as this is the only axis
5223 // it rotates around.
5224 // In mouselook, X and Y co-ordinate will also be sent but when used in Rotation, these cause unwanted
5225 // excessive up and down movements of the camera when looking up and down.
5226 // See http://opensimulator.org/mantis/view.php?id=3274
5227 // This does not affect head movement, since this is controlled entirely by camera movement rather than
5228 // body rotation. It does not affect sitting avatar since it's the sitting part rotation that takes
5229 // effect, not the avatar rotation.
5230 Quaternion rot = data.Rotation;
5231 rot.X = 0;
5232 rot.Y = 0;
5233 rot.ToBytes(objectData, 52);
5211 //data.AngularVelocity.ToBytes(objectData, 64); 5234 //data.AngularVelocity.ToBytes(objectData, 64);
5212 5235
5213 ObjectUpdatePacket.ObjectDataBlock update = new ObjectUpdatePacket.ObjectDataBlock(); 5236 ObjectUpdatePacket.ObjectDataBlock update = new ObjectUpdatePacket.ObjectDataBlock();
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/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 1dc7e20..7ed3a4b 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1648,12 +1648,13 @@ namespace OpenSim.Region.Framework.Scenes
1648 1648
1649 if (AllowMovement && !SitGround) 1649 if (AllowMovement && !SitGround)
1650 { 1650 {
1651 Quaternion bodyRotation = agentData.BodyRotation; 1651// m_log.DebugFormat("[SCENE PRESENCE]: Initial body rotation {0} for {1}", agentData.BodyRotation, Name);
1652
1652 bool update_rotation = false; 1653 bool update_rotation = false;
1653 1654
1654 if (bodyRotation != Rotation) 1655 if (agentData.BodyRotation != Rotation)
1655 { 1656 {
1656 Rotation = bodyRotation; 1657 Rotation = agentData.BodyRotation;
1657 update_rotation = true; 1658 update_rotation = true;
1658 } 1659 }
1659 1660