aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs63
1 files changed, 42 insertions, 21 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 8545425..2c8c675 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -33,12 +33,12 @@ using OpenMetaverse;
33using log4net; 33using log4net;
34using OpenSim.Framework; 34using OpenSim.Framework;
35using OpenSim.Framework.Client; 35using OpenSim.Framework.Client;
36using OpenSim.Framework.Communications.Cache;
37using OpenSim.Region.Framework.Interfaces; 36using OpenSim.Region.Framework.Interfaces;
38using OpenSim.Region.Framework.Scenes.Animation; 37using OpenSim.Region.Framework.Scenes.Animation;
39using OpenSim.Region.Framework.Scenes.Types; 38using OpenSim.Region.Framework.Scenes.Types;
40using OpenSim.Region.Physics.Manager; 39using OpenSim.Region.Physics.Manager;
41using GridRegion = OpenSim.Services.Interfaces.GridRegion; 40using GridRegion = OpenSim.Services.Interfaces.GridRegion;
41using OpenSim.Services.Interfaces;
42 42
43namespace OpenSim.Region.Framework.Scenes 43namespace OpenSim.Region.Framework.Scenes
44{ 44{
@@ -246,6 +246,8 @@ namespace OpenSim.Region.Framework.Scenes
246 246
247 // For teleports and crossings callbacks 247 // For teleports and crossings callbacks
248 string m_callbackURI; 248 string m_callbackURI;
249 UUID m_originRegionID;
250
249 ulong m_rootRegionHandle; 251 ulong m_rootRegionHandle;
250 252
251 /// <value> 253 /// <value>
@@ -1070,6 +1072,8 @@ namespace OpenSim.Region.Framework.Scenes
1070 /// </summary> 1072 /// </summary>
1071 public void CompleteMovement() 1073 public void CompleteMovement()
1072 { 1074 {
1075 //m_log.Debug("[SCENE PRESENCE]: CompleteMovement");
1076
1073 Vector3 look = Velocity; 1077 Vector3 look = Velocity;
1074 if ((look.X == 0) && (look.Y == 0) && (look.Z == 0)) 1078 if ((look.X == 0) && (look.Y == 0) && (look.Z == 0))
1075 { 1079 {
@@ -1094,7 +1098,7 @@ namespace OpenSim.Region.Framework.Scenes
1094 if ((m_callbackURI != null) && !m_callbackURI.Equals("")) 1098 if ((m_callbackURI != null) && !m_callbackURI.Equals(""))
1095 { 1099 {
1096 m_log.DebugFormat("[SCENE PRESENCE]: Releasing agent in URI {0}", m_callbackURI); 1100 m_log.DebugFormat("[SCENE PRESENCE]: Releasing agent in URI {0}", m_callbackURI);
1097 Scene.SendReleaseAgent(m_rootRegionHandle, UUID, m_callbackURI); 1101 Scene.SimulationService.ReleaseAgent(m_originRegionID, UUID, m_callbackURI);
1098 m_callbackURI = null; 1102 m_callbackURI = null;
1099 } 1103 }
1100 1104
@@ -1103,6 +1107,16 @@ namespace OpenSim.Region.Framework.Scenes
1103 m_controllingClient.MoveAgentIntoRegion(m_regionInfo, AbsolutePosition, look); 1107 m_controllingClient.MoveAgentIntoRegion(m_regionInfo, AbsolutePosition, look);
1104 SendInitialData(); 1108 SendInitialData();
1105 1109
1110 // Create child agents in neighbouring regions
1111 if (!m_isChildAgent)
1112 {
1113 IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>();
1114 if (m_agentTransfer != null)
1115 m_agentTransfer.EnableChildAgents(this);
1116 else
1117 m_log.DebugFormat("[SCENE PRESENCE]: Unable to create child agents in neighbours, because AgentTransferModule is not active");
1118 }
1119
1106 } 1120 }
1107 1121
1108 /// <summary> 1122 /// <summary>
@@ -2155,6 +2169,7 @@ namespace OpenSim.Region.Framework.Scenes
2155 { 2169 {
2156 if (m_isChildAgent) 2170 if (m_isChildAgent)
2157 { 2171 {
2172 // WHAT???
2158 m_log.Debug("[SCENEPRESENCE]: AddNewMovement() called on child agent, making root agent!"); 2173 m_log.Debug("[SCENEPRESENCE]: AddNewMovement() called on child agent, making root agent!");
2159 2174
2160 // we have to reset the user's child agent connections. 2175 // we have to reset the user's child agent connections.
@@ -2178,7 +2193,9 @@ namespace OpenSim.Region.Framework.Scenes
2178 2193
2179 if (m_scene.SceneGridService != null) 2194 if (m_scene.SceneGridService != null)
2180 { 2195 {
2181 m_scene.SceneGridService.EnableNeighbourChildAgents(this, new List<RegionInfo>()); 2196 IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>();
2197 if (m_agentTransfer != null)
2198 m_agentTransfer.EnableChildAgents(this);
2182 } 2199 }
2183 2200
2184 return; 2201 return;
@@ -2475,14 +2492,9 @@ namespace OpenSim.Region.Framework.Scenes
2475 m_controllingClient.SendAvatarData(new SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, LocalId, 2492 m_controllingClient.SendAvatarData(new SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, LocalId,
2476 pos, m_appearance.Texture.GetBytes(), m_parentID, m_bodyRot)); 2493 pos, m_appearance.Texture.GetBytes(), m_parentID, m_bodyRot));
2477 2494
2478 if (!m_isChildAgent)
2479 {
2480 m_scene.InformClientOfNeighbours(this);
2481 }
2482
2483 SendInitialFullUpdateToAllClients(); 2495 SendInitialFullUpdateToAllClients();
2484 SendAppearanceToAllOtherAgents(); 2496 SendAppearanceToAllOtherAgents();
2485 } 2497 }
2486 2498
2487 /// <summary> 2499 /// <summary>
2488 /// Tell the client for this scene presence what items it should be wearing now 2500 /// Tell the client for this scene presence what items it should be wearing now
@@ -2562,14 +2574,19 @@ namespace OpenSim.Region.Framework.Scenes
2562 } 2574 }
2563 } 2575 }
2564 } 2576 }
2577
2565 } 2578 }
2566 2579
2580
2567 #endregion Bake Cache Check 2581 #endregion Bake Cache Check
2568 2582
2569 m_appearance.SetAppearance(textureEntry, visualParams); 2583 m_appearance.SetAppearance(textureEntry, visualParams);
2570 if (m_appearance.AvatarHeight > 0) 2584 if (m_appearance.AvatarHeight > 0)
2571 SetHeight(m_appearance.AvatarHeight); 2585 SetHeight(m_appearance.AvatarHeight);
2572 m_scene.CommsManager.AvatarService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance); 2586
2587 // This is not needed, because only the transient data changed
2588 //AvatarData adata = new AvatarData(m_appearance);
2589 //m_scene.AvatarService.SetAvatar(m_controllingClient.AgentId, adata);
2573 2590
2574 SendAppearanceToAllOtherAgents(); 2591 SendAppearanceToAllOtherAgents();
2575 if (!m_startAnimationSet) 2592 if (!m_startAnimationSet)
@@ -2589,7 +2606,8 @@ namespace OpenSim.Region.Framework.Scenes
2589 public void SetWearable(int wearableId, AvatarWearable wearable) 2606 public void SetWearable(int wearableId, AvatarWearable wearable)
2590 { 2607 {
2591 m_appearance.SetWearable(wearableId, wearable); 2608 m_appearance.SetWearable(wearableId, wearable);
2592 m_scene.CommsManager.AvatarService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance); 2609 AvatarData adata = new AvatarData(m_appearance);
2610 m_scene.AvatarService.SetAvatar(m_controllingClient.AgentId, adata);
2593 m_controllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++); 2611 m_controllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++);
2594 } 2612 }
2595 2613
@@ -2867,11 +2885,14 @@ namespace OpenSim.Region.Framework.Scenes
2867 // For now, assign god level 200 to anyone 2885 // For now, assign god level 200 to anyone
2868 // who is granted god powers, but has no god level set. 2886 // who is granted god powers, but has no god level set.
2869 // 2887 //
2870 CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(agentID); 2888 UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, agentID);
2871 if (profile.UserProfile.GodLevel > 0) 2889 if (account != null)
2872 m_godlevel = profile.UserProfile.GodLevel; 2890 {
2873 else 2891 if (account.UserLevel > 0)
2874 m_godlevel = 200; 2892 m_godlevel = account.UserLevel;
2893 else
2894 m_godlevel = 200;
2895 }
2875 } 2896 }
2876 else 2897 else
2877 { 2898 {
@@ -2937,7 +2958,7 @@ namespace OpenSim.Region.Framework.Scenes
2937 public void CopyTo(AgentData cAgent) 2958 public void CopyTo(AgentData cAgent)
2938 { 2959 {
2939 cAgent.AgentID = UUID; 2960 cAgent.AgentID = UUID;
2940 cAgent.RegionHandle = m_rootRegionHandle; 2961 cAgent.RegionID = Scene.RegionInfo.RegionID;
2941 2962
2942 cAgent.Position = AbsolutePosition; 2963 cAgent.Position = AbsolutePosition;
2943 cAgent.Velocity = m_velocity; 2964 cAgent.Velocity = m_velocity;
@@ -3036,7 +3057,7 @@ namespace OpenSim.Region.Framework.Scenes
3036 3057
3037 public void CopyFrom(AgentData cAgent) 3058 public void CopyFrom(AgentData cAgent)
3038 { 3059 {
3039 m_rootRegionHandle = cAgent.RegionHandle; 3060 m_originRegionID = cAgent.RegionID;
3040 3061
3041 m_callbackURI = cAgent.CallbackURI; 3062 m_callbackURI = cAgent.CallbackURI;
3042 3063
@@ -3406,7 +3427,7 @@ namespace OpenSim.Region.Framework.Scenes
3406 } 3427 }
3407 } 3428 }
3408 3429
3409 public bool CrossAttachmentsIntoNewRegion(ulong regionHandle, bool silent) 3430 public bool CrossAttachmentsIntoNewRegion(GridRegion destination, bool silent)
3410 { 3431 {
3411 lock (m_attachments) 3432 lock (m_attachments)
3412 { 3433 {
@@ -3427,8 +3448,8 @@ namespace OpenSim.Region.Framework.Scenes
3427 gobj.AbsolutePosition = gobj.RootPart.AttachedPos; 3448 gobj.AbsolutePosition = gobj.RootPart.AttachedPos;
3428 gobj.RootPart.IsAttachment = false; 3449 gobj.RootPart.IsAttachment = false;
3429 //gobj.RootPart.LastOwnerID = gobj.GetFromAssetID(); 3450 //gobj.RootPart.LastOwnerID = gobj.GetFromAssetID();
3430 m_log.DebugFormat("[ATTACHMENT]: Sending attachment {0} to region {1}", gobj.UUID, regionHandle); 3451 m_log.DebugFormat("[ATTACHMENT]: Sending attachment {0} to region {1}", gobj.UUID, destination.RegionName);
3431 m_scene.CrossPrimGroupIntoNewRegion(regionHandle, gobj, silent); 3452 m_scene.CrossPrimGroupIntoNewRegion(destination, gobj, silent);
3432 } 3453 }
3433 } 3454 }
3434 m_attachments.Clear(); 3455 m_attachments.Clear();