diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 110 |
1 files changed, 79 insertions, 31 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 9545c13..6d4cb52 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1778,6 +1778,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
1778 | 1778 | ||
1779 | private Dictionary<ulong, spRegionSizeInfo> m_knownChildRegionsSizeInfo = new Dictionary<ulong, spRegionSizeInfo>(); | 1779 | private Dictionary<ulong, spRegionSizeInfo> m_knownChildRegionsSizeInfo = new Dictionary<ulong, spRegionSizeInfo>(); |
1780 | 1780 | ||
1781 | public void AddNeighbourRegion(GridRegion region, string capsPath) | ||
1782 | { | ||
1783 | lock (m_knownChildRegions) | ||
1784 | { | ||
1785 | ulong regionHandle = region.RegionHandle; | ||
1786 | m_knownChildRegions.Add(regionHandle,capsPath); | ||
1787 | |||
1788 | spRegionSizeInfo sizeInfo = new spRegionSizeInfo(); | ||
1789 | sizeInfo.sizeX = region.RegionSizeX; | ||
1790 | sizeInfo.sizeY = region.RegionSizeY; | ||
1791 | m_knownChildRegionsSizeInfo[regionHandle] = sizeInfo; | ||
1792 | } | ||
1793 | } | ||
1794 | |||
1781 | public void AddNeighbourRegionSizeInfo(GridRegion region) | 1795 | public void AddNeighbourRegionSizeInfo(GridRegion region) |
1782 | { | 1796 | { |
1783 | lock (m_knownChildRegions) | 1797 | lock (m_knownChildRegions) |
@@ -1826,6 +1840,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
1826 | } | 1840 | } |
1827 | } | 1841 | } |
1828 | 1842 | ||
1843 | public bool knowsNeighbourRegion(ulong regionHandle) | ||
1844 | { | ||
1845 | lock (m_knownChildRegions) | ||
1846 | return m_knownChildRegions.ContainsKey(regionHandle); | ||
1847 | } | ||
1848 | |||
1829 | public void DropOldNeighbours(List<ulong> oldRegions) | 1849 | public void DropOldNeighbours(List<ulong> oldRegions) |
1830 | { | 1850 | { |
1831 | foreach (ulong handle in oldRegions) | 1851 | foreach (ulong handle in oldRegions) |
@@ -2010,6 +2030,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2010 | return; | 2030 | return; |
2011 | } | 2031 | } |
2012 | 2032 | ||
2033 | |||
2013 | m_log.DebugFormat("[CompleteMovement] MakeRootAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2034 | m_log.DebugFormat("[CompleteMovement] MakeRootAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
2014 | 2035 | ||
2015 | if(!haveGroupInformation && !IsChildAgent && !IsNPC) | 2036 | if(!haveGroupInformation && !IsChildAgent && !IsNPC) |
@@ -2029,11 +2050,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2029 | m_log.DebugFormat("[CompleteMovement]: Missing COF for {0} is {1}", client.AgentId, COF); | 2050 | m_log.DebugFormat("[CompleteMovement]: Missing COF for {0} is {1}", client.AgentId, COF); |
2030 | } | 2051 | } |
2031 | 2052 | ||
2032 | // Tell the client that we're totally ready | ||
2033 | ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); | ||
2034 | |||
2035 | m_log.DebugFormat("[CompleteMovement] MoveAgentIntoRegion: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | ||
2036 | |||
2037 | if (!string.IsNullOrEmpty(m_callbackURI)) | 2053 | if (!string.IsNullOrEmpty(m_callbackURI)) |
2038 | { | 2054 | { |
2039 | // We cannot sleep here since this would hold up the inbound packet processing thread, as | 2055 | // We cannot sleep here since this would hold up the inbound packet processing thread, as |
@@ -2054,6 +2070,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2054 | 2070 | ||
2055 | Scene.SimulationService.ReleaseAgent(originID, UUID, m_callbackURI); | 2071 | Scene.SimulationService.ReleaseAgent(originID, UUID, m_callbackURI); |
2056 | m_callbackURI = null; | 2072 | m_callbackURI = null; |
2073 | m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | ||
2057 | } | 2074 | } |
2058 | // else | 2075 | // else |
2059 | // { | 2076 | // { |
@@ -2062,19 +2079,58 @@ namespace OpenSim.Region.Framework.Scenes | |||
2062 | // client.Name, client.AgentId, m_scene.RegionInfo.RegionName); | 2079 | // client.Name, client.AgentId, m_scene.RegionInfo.RegionName); |
2063 | // } | 2080 | // } |
2064 | 2081 | ||
2065 | m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2082 | |
2083 | // Tell the client that we're totally ready | ||
2084 | ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); | ||
2085 | m_log.DebugFormat("[CompleteMovement] MoveAgentIntoRegion: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | ||
2086 | |||
2087 | bool isHGTP = (m_teleportFlags & TeleportFlags.ViaHGLogin) != 0; | ||
2088 | |||
2089 | int delayctnr = Util.EnvironmentTickCount(); | ||
2090 | |||
2091 | if (!IsChildAgent) | ||
2092 | { | ||
2093 | if( ParentPart != null && !IsNPC && (crossingFlags & 0x08) != 0) | ||
2094 | { | ||
2095 | |||
2096 | // SceneObjectPart root = ParentPart.ParentGroup.RootPart; | ||
2097 | // if(root.LocalId != ParentPart.LocalId) | ||
2098 | // ControllingClient.SendEntityTerseUpdateImmediate(root); | ||
2099 | // ControllingClient.SendEntityTerseUpdateImmediate(ParentPart); | ||
2100 | ParentPart.ParentGroup.SendFullUpdateToClient(ControllingClient); | ||
2101 | } | ||
2102 | |||
2103 | // verify baked textures and cache | ||
2104 | bool cachedbaked = false; | ||
2105 | |||
2106 | if (IsNPC) | ||
2107 | cachedbaked = true; | ||
2108 | else | ||
2109 | { | ||
2110 | if (m_scene.AvatarFactory != null && !isHGTP) | ||
2111 | cachedbaked = m_scene.AvatarFactory.ValidateBakedTextureCache(this); | ||
2112 | |||
2113 | // not sure we need this | ||
2114 | if (!cachedbaked) | ||
2115 | { | ||
2116 | if (m_scene.AvatarFactory != null) | ||
2117 | m_scene.AvatarFactory.QueueAppearanceSave(UUID); | ||
2118 | } | ||
2119 | } | ||
2120 | m_log.DebugFormat("[CompleteMovement] Baked check: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | ||
2121 | } | ||
2066 | 2122 | ||
2067 | if(m_teleportFlags > 0) | 2123 | if(m_teleportFlags > 0) |
2068 | { | 2124 | { |
2069 | gotCrossUpdate = false; // sanity check | 2125 | gotCrossUpdate = false; // sanity check |
2070 | Thread.Sleep(500); // let viewers catch us | 2126 | if(Util.EnvironmentTickCountSubtract(delayctnr)< 500) |
2127 | Thread.Sleep(500); // let viewers catch us | ||
2071 | } | 2128 | } |
2072 | 2129 | ||
2073 | if(!gotCrossUpdate) | 2130 | if(!gotCrossUpdate) |
2074 | RotateToLookAt(look); | 2131 | RotateToLookAt(look); |
2075 | 2132 | ||
2076 | // HG | 2133 | // HG |
2077 | bool isHGTP = (m_teleportFlags & TeleportFlags.ViaHGLogin) != 0; | ||
2078 | if(isHGTP) | 2134 | if(isHGTP) |
2079 | { | 2135 | { |
2080 | // ControllingClient.SendNameReply(m_uuid, Firstname, Lastname); | 2136 | // ControllingClient.SendNameReply(m_uuid, Firstname, Lastname); |
@@ -2101,28 +2157,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
2101 | 2157 | ||
2102 | if (!IsChildAgent) | 2158 | if (!IsChildAgent) |
2103 | { | 2159 | { |
2104 | // verify baked textures and cache | ||
2105 | bool cachedbaked = false; | ||
2106 | |||
2107 | if (IsNPC) | ||
2108 | cachedbaked = true; | ||
2109 | else | ||
2110 | { | ||
2111 | if (m_scene.AvatarFactory != null && !isHGTP) | ||
2112 | cachedbaked = m_scene.AvatarFactory.ValidateBakedTextureCache(this); | ||
2113 | |||
2114 | // not sure we need this | ||
2115 | if (!cachedbaked) | ||
2116 | { | ||
2117 | if (m_scene.AvatarFactory != null) | ||
2118 | m_scene.AvatarFactory.QueueAppearanceSave(UUID); | ||
2119 | } | ||
2120 | } | ||
2121 | |||
2122 | List<ScenePresence> allpresences = m_scene.GetScenePresences(); | 2160 | List<ScenePresence> allpresences = m_scene.GetScenePresences(); |
2123 | 2161 | ||
2124 | // send avatar object to all presences including us, so they cross it into region | 2162 | // send avatar object to all presences including us, so they cross it into region |
2125 | // then hide if necessary | 2163 | // then hide if necessary |
2164 | |||
2126 | SendInitialAvatarDataToAllAgents(allpresences); | 2165 | SendInitialAvatarDataToAllAgents(allpresences); |
2127 | 2166 | ||
2128 | // send this look | 2167 | // send this look |
@@ -2230,13 +2269,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
2230 | m_lastChildAgentUpdateDrawDistance = DrawDistance; | 2269 | m_lastChildAgentUpdateDrawDistance = DrawDistance; |
2231 | m_lastChildAgentUpdatePosition = AbsolutePosition; | 2270 | m_lastChildAgentUpdatePosition = AbsolutePosition; |
2232 | m_childUpdatesBusy = false; // allow them | 2271 | m_childUpdatesBusy = false; // allow them |
2272 | |||
2273 | |||
2233 | } | 2274 | } |
2234 | 2275 | ||
2235 | m_log.DebugFormat("[CompleteMovement] openChildAgents: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2276 | m_log.DebugFormat("[CompleteMovement] openChildAgents: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
2236 | 2277 | ||
2278 | |||
2279 | |||
2237 | // send the rest of the world | 2280 | // send the rest of the world |
2238 | if (m_teleportFlags > 0 && !IsNPC || m_currentParcelHide) | 2281 | if (m_teleportFlags > 0 && !IsNPC || m_currentParcelHide) |
2239 | SendInitialDataToMe(); | 2282 | SendInitialDataToMe(); |
2283 | |||
2240 | 2284 | ||
2241 | // priority uses avatar position only | 2285 | // priority uses avatar position only |
2242 | // m_reprioritizationLastPosition = AbsolutePosition; | 2286 | // m_reprioritizationLastPosition = AbsolutePosition; |
@@ -3110,6 +3154,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3110 | 3154 | ||
3111 | Vector3 standPos = sitPartWorldPosition + adjustmentForSitPose; | 3155 | Vector3 standPos = sitPartWorldPosition + adjustmentForSitPose; |
3112 | m_pos = standPos; | 3156 | m_pos = standPos; |
3157 | |||
3113 | } | 3158 | } |
3114 | 3159 | ||
3115 | // We need to wait until we have calculated proper stand positions before sitting up the physical | 3160 | // We need to wait until we have calculated proper stand positions before sitting up the physical |
@@ -3124,6 +3169,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3124 | part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK); | 3169 | part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK); |
3125 | 3170 | ||
3126 | SendAvatarDataToAllAgents(); | 3171 | SendAvatarDataToAllAgents(); |
3172 | m_scene.EventManager.TriggerParcelPrimCountTainted(); // update select/ sat on | ||
3127 | } | 3173 | } |
3128 | 3174 | ||
3129 | // reset to default sitAnimation | 3175 | // reset to default sitAnimation |
@@ -3256,6 +3302,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3256 | // Moved here to avoid a race with default sit anim | 3302 | // Moved here to avoid a race with default sit anim |
3257 | // The script event needs to be raised after the default sit anim is set. | 3303 | // The script event needs to be raised after the default sit anim is set. |
3258 | part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK); | 3304 | part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK); |
3305 | m_scene.EventManager.TriggerParcelPrimCountTainted(); // update select/ sat on | ||
3259 | } | 3306 | } |
3260 | } | 3307 | } |
3261 | 3308 | ||
@@ -3405,6 +3452,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3405 | 3452 | ||
3406 | Animator.SetMovementAnimations("SIT"); | 3453 | Animator.SetMovementAnimations("SIT"); |
3407 | part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK); | 3454 | part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK); |
3455 | m_scene.EventManager.TriggerParcelPrimCountTainted(); // update select/ sat on | ||
3408 | } | 3456 | } |
3409 | 3457 | ||
3410 | public void HandleAgentSit(IClientAPI remoteClient, UUID agentID) | 3458 | public void HandleAgentSit(IClientAPI remoteClient, UUID agentID) |
@@ -3968,7 +4016,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3968 | int count = 0; | 4016 | int count = 0; |
3969 | foreach (ScenePresence p in presences) | 4017 | foreach (ScenePresence p in presences) |
3970 | { | 4018 | { |
3971 | p.ControllingClient.SendAvatarDataImmediate(this); | 4019 | p.ControllingClient.SendEntityFullUpdateImmediate(this); |
3972 | if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) | 4020 | if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) |
3973 | // either just kill the object | 4021 | // either just kill the object |
3974 | // p.ControllingClient.SendKillObject(new List<uint> {LocalId}); | 4022 | // p.ControllingClient.SendKillObject(new List<uint> {LocalId}); |
@@ -3981,7 +4029,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3981 | 4029 | ||
3982 | public void SendInitialAvatarDataToAgent(ScenePresence p) | 4030 | public void SendInitialAvatarDataToAgent(ScenePresence p) |
3983 | { | 4031 | { |
3984 | p.ControllingClient.SendAvatarDataImmediate(this); | 4032 | p.ControllingClient.SendEntityFullUpdateImmediate(this); |
3985 | if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) | 4033 | if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) |
3986 | // either just kill the object | 4034 | // either just kill the object |
3987 | // p.ControllingClient.SendKillObject(new List<uint> {LocalId}); | 4035 | // p.ControllingClient.SendKillObject(new List<uint> {LocalId}); |
@@ -3998,12 +4046,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
3998 | //m_log.DebugFormat("[SCENE PRESENCE] SendAvatarDataToAgent from {0} ({1}) to {2} ({3})", Name, UUID, avatar.Name, avatar.UUID); | 4046 | //m_log.DebugFormat("[SCENE PRESENCE] SendAvatarDataToAgent from {0} ({1}) to {2} ({3})", Name, UUID, avatar.Name, avatar.UUID); |
3999 | if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && !avatar.IsViewerUIGod) | 4047 | if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && !avatar.IsViewerUIGod) |
4000 | return; | 4048 | return; |
4001 | avatar.ControllingClient.SendAvatarDataImmediate(this); | 4049 | avatar.ControllingClient.SendEntityFullUpdateImmediate(this); |
4002 | } | 4050 | } |
4003 | 4051 | ||
4004 | public void SendAvatarDataToAgentNF(ScenePresence avatar) | 4052 | public void SendAvatarDataToAgentNF(ScenePresence avatar) |
4005 | { | 4053 | { |
4006 | avatar.ControllingClient.SendAvatarDataImmediate(this); | 4054 | avatar.ControllingClient.SendEntityFullUpdateImmediate(this); |
4007 | } | 4055 | } |
4008 | 4056 | ||
4009 | /// <summary> | 4057 | /// <summary> |
@@ -6440,7 +6488,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
6440 | if (check) | 6488 | if (check) |
6441 | { | 6489 | { |
6442 | // check is relative to current parcel only | 6490 | // check is relative to current parcel only |
6443 | if (currentParcelUUID == null || oldhide == currentParcelHide) | 6491 | if (oldhide == currentParcelHide) |
6444 | return; | 6492 | return; |
6445 | 6493 | ||
6446 | allpresences = m_scene.GetScenePresences(); | 6494 | allpresences = m_scene.GetScenePresences(); |