aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs61
3 files changed, 52 insertions, 16 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index 3016bbe..d8e3082 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -1047,6 +1047,10 @@ namespace OpenSim.Region.CoreModules.World.Land
1047 /// <param name="remote_client">The object representing the client</param> 1047 /// <param name="remote_client">The object representing the client</param>
1048 public void SendParcelOverlay(IClientAPI remote_client) 1048 public void SendParcelOverlay(IClientAPI remote_client)
1049 { 1049 {
1050
1051 if (remote_client.SceneAgent.PresenceType == PresenceType.Npc)
1052 return;
1053
1050 const int LAND_BLOCKS_PER_PACKET = 1024; 1054 const int LAND_BLOCKS_PER_PACKET = 1024;
1051 1055
1052 byte[] byteArray = new byte[LAND_BLOCKS_PER_PACKET]; 1056 byte[] byteArray = new byte[LAND_BLOCKS_PER_PACKET];
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index 7de6365..29c2234 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -244,6 +244,9 @@ namespace OpenSim.Region.CoreModules.World.Land
244 244
245 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client) 245 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client)
246 { 246 {
247 if (remote_client.SceneAgent.PresenceType == PresenceType.Npc)
248 return;
249
247 IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>(); 250 IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>();
248 uint regionFlags = 336723974 & ~((uint)(RegionFlags.AllowLandmark | RegionFlags.AllowSetHome)); 251 uint regionFlags = 336723974 & ~((uint)(RegionFlags.AllowLandmark | RegionFlags.AllowSetHome));
249 if (estateModule != null) 252 if (estateModule != null)
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 415dbcd..faaf74c 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -88,7 +88,17 @@ namespace OpenSim.Region.Framework.Scenes
88 m_scene.EventManager.TriggerScenePresenceUpdated(this); 88 m_scene.EventManager.TriggerScenePresenceUpdated(this);
89 } 89 }
90 90
91 public PresenceType PresenceType { get; private set; } 91 public bool isNPC { get; private set; }
92
93 private PresenceType m_presenceType;
94 public PresenceType PresenceType {
95 get {return m_presenceType;}
96 private set
97 {
98 m_presenceType = value;
99 isNPC = (m_presenceType == PresenceType.Npc);
100 }
101 }
92 102
93 private ScenePresenceStateMachine m_stateMachine; 103 private ScenePresenceStateMachine m_stateMachine;
94 104
@@ -1258,6 +1268,7 @@ namespace OpenSim.Region.Framework.Scenes
1258 // and it has already rezzed the attachments and started their scripts. 1268 // and it has already rezzed the attachments and started their scripts.
1259 // We do the following only for non-login agents, because their scripts 1269 // We do the following only for non-login agents, because their scripts
1260 // haven't started yet. 1270 // haven't started yet.
1271/* moved down
1261 if (PresenceType == PresenceType.Npc || (TeleportFlags & TeleportFlags.ViaLogin) != 0) 1272 if (PresenceType == PresenceType.Npc || (TeleportFlags & TeleportFlags.ViaLogin) != 0)
1262 { 1273 {
1263 // Viewers which have a current outfit folder will actually rez their own attachments. However, 1274 // Viewers which have a current outfit folder will actually rez their own attachments. However,
@@ -1273,6 +1284,7 @@ namespace OpenSim.Region.Framework.Scenes
1273 }); 1284 });
1274 } 1285 }
1275 else 1286 else
1287
1276 { 1288 {
1277 // We need to restart scripts here so that they receive the correct changed events (CHANGED_TELEPORT 1289 // We need to restart scripts here so that they receive the correct changed events (CHANGED_TELEPORT
1278 // and CHANGED_REGION) when the attachments have been rezzed in the new region. This cannot currently 1290 // and CHANGED_REGION) when the attachments have been rezzed in the new region. This cannot currently
@@ -1314,7 +1326,7 @@ namespace OpenSim.Region.Framework.Scenes
1314 } 1326 }
1315 } 1327 }
1316 } 1328 }
1317 1329*/
1318/* 1330/*
1319 SendAvatarDataToAllAgents(); 1331 SendAvatarDataToAllAgents();
1320 1332
@@ -1741,7 +1753,7 @@ namespace OpenSim.Region.Framework.Scenes
1741 try 1753 try
1742 { 1754 {
1743 // Make sure it's not a login agent. We don't want to wait for updates during login 1755 // Make sure it's not a login agent. We don't want to wait for updates during login
1744 if (PresenceType != PresenceType.Npc && (m_teleportFlags & TeleportFlags.ViaLogin) == 0) 1756 if (!isNPC && (m_teleportFlags & TeleportFlags.ViaLogin) == 0)
1745 { 1757 {
1746 // Let's wait until UpdateAgent (called by departing region) is done 1758 // Let's wait until UpdateAgent (called by departing region) is done
1747 if (!WaitForUpdateAgent(client)) 1759 if (!WaitForUpdateAgent(client))
@@ -1820,7 +1832,6 @@ namespace OpenSim.Region.Framework.Scenes
1820 m_previusParcelUUID = UUID.Zero; 1832 m_previusParcelUUID = UUID.Zero;
1821 m_currentParcelHide = false; 1833 m_currentParcelHide = false;
1822 m_currentParcelUUID = UUID.Zero; 1834 m_currentParcelUUID = UUID.Zero;
1823
1824 1835
1825 // send initial land overlay and parcel 1836 // send initial land overlay and parcel
1826 if (!IsChildAgent) 1837 if (!IsChildAgent)
@@ -1842,28 +1853,48 @@ namespace OpenSim.Region.Framework.Scenes
1842 ValidateAndSendAppearanceAndAgentData(); 1853 ValidateAndSendAppearanceAndAgentData();
1843 1854
1844 // Create child agents in neighbouring regions 1855 // Create child agents in neighbouring regions
1845 if (openChildAgents && !IsChildAgent) 1856 if (openChildAgents && !IsChildAgent && !isNPC)
1846 { 1857 {
1847 IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>(); 1858 IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>();
1848 if (m_agentTransfer != null) 1859 if (m_agentTransfer != null)
1849 m_agentTransfer.EnableChildAgents(this); 1860 m_agentTransfer.EnableChildAgents(this);
1850 } 1861 }
1851 1862
1852 // XXX: If we force an update here, then multiple attachments do appear correctly on a destination region 1863
1853 // If we do it a little bit earlier (e.g. when converting the child to a root agent) then this does not work. 1864 // attachments
1854 // This may be due to viewer code or it may be something we're not doing properly simulator side. 1865 if (isNPC || (TeleportFlags & TeleportFlags.ViaLogin) != 0)
1855 lock (m_attachments)
1856 { 1866 {
1857 foreach (SceneObjectGroup sog in m_attachments) 1867 if (Scene.AttachmentsModule != null)
1858 sog.ScheduleGroupForFullUpdate(); 1868 Util.FireAndForget(
1869 o =>
1870 {
1871 Scene.AttachmentsModule.RezAttachments(this);
1872 });
1859 } 1873 }
1874 else
1875 {
1876 List<SceneObjectGroup> attachments = GetAttachments();
1860 1877
1878 if (attachments.Count > 0)
1879 {
1880 m_log.DebugFormat(
1881 "[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name);
1882
1883 // Resume scripts this possible should also be moved down after sending the avatar to viewer ?
1884 foreach (SceneObjectGroup sog in attachments)
1885 {
1886 sog.ScheduleGroupForFullUpdate();
1887 sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource());
1888 sog.ResumeScripts();
1889 }
1890 }
1891 }
1861 // m_log.DebugFormat( 1892 // m_log.DebugFormat(
1862 // "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms", 1893 // "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms",
1863 // client.Name, Scene.RegionInfo.RegionName, (DateTime.Now - startTime).Milliseconds); 1894 // client.Name, Scene.RegionInfo.RegionName, (DateTime.Now - startTime).Milliseconds);
1864 1895
1865 // send the rest of the world 1896 // send the rest of the world
1866 if (m_teleportFlags > 0) 1897 if (m_teleportFlags > 0 && !isNPC)
1867 SendInitialDataToMe(); 1898 SendInitialDataToMe();
1868 1899
1869 if (!IsChildAgent) 1900 if (!IsChildAgent)
@@ -5488,7 +5519,7 @@ namespace OpenSim.Region.Framework.Scenes
5488 } 5519 }
5489 } 5520 }
5490 5521
5491 if (killsToSendme.Count > 0) 5522 if (killsToSendme.Count > 0 && PresenceType != PresenceType.Npc)
5492 { 5523 {
5493 foreach (ScenePresence p in killsToSendme) 5524 foreach (ScenePresence p in killsToSendme)
5494 { 5525 {
@@ -5509,7 +5540,7 @@ namespace OpenSim.Region.Framework.Scenes
5509 } 5540 }
5510 } 5541 }
5511 5542
5512 if (viewsToSendme.Count > 0) 5543 if (viewsToSendme.Count > 0 && PresenceType != PresenceType.Npc)
5513 { 5544 {
5514 foreach (ScenePresence p in viewsToSendme) 5545 foreach (ScenePresence p in viewsToSendme)
5515 { 5546 {
@@ -5520,8 +5551,6 @@ namespace OpenSim.Region.Framework.Scenes
5520 p.Animator.SendAnimPackToClient(ControllingClient); 5551 p.Animator.SendAnimPackToClient(ControllingClient);
5521 } 5552 }
5522 } 5553 }
5523
5524
5525 } 5554 }
5526 } 5555 }
5527} 5556}