diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 138 |
1 files changed, 40 insertions, 98 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 123b605..2f26320 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -2130,11 +2130,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2130 | { | 2130 | { |
2131 | return; // how? | 2131 | return; // how? |
2132 | } | 2132 | } |
2133 | |||
2133 | //m_log.DebugFormat("[CompleteMovement] MakeRootAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2134 | //m_log.DebugFormat("[CompleteMovement] MakeRootAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
2134 | 2135 | ||
2135 | if (!IsNPC) | 2136 | if (!IsNPC) |
2136 | { | 2137 | { |
2137 | if (!haveGroupInformation && !IsNPC) | 2138 | if (!haveGroupInformation) |
2138 | { | 2139 | { |
2139 | IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); | 2140 | IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); |
2140 | if (gm != null) | 2141 | if (gm != null) |
@@ -2150,53 +2151,45 @@ namespace OpenSim.Region.Framework.Scenes | |||
2150 | 2151 | ||
2151 | m_log.DebugFormat("[CompleteMovement]: Missing COF for {0} is {1}", client.AgentId, COF); | 2152 | m_log.DebugFormat("[CompleteMovement]: Missing COF for {0} is {1}", client.AgentId, COF); |
2152 | } | 2153 | } |
2153 | |||
2154 | } | 2154 | } |
2155 | // Tell the client that we're totally ready | ||
2156 | ControllingClient.SendRegionHandshake(); | ||
2157 | ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); | ||
2158 | //m_log.DebugFormat("[CompleteMovement] MoveAgentIntoRegion: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | ||
2159 | 2155 | ||
2160 | // recheck to reduce timing issues | 2156 | if (m_teleportFlags > 0) |
2161 | ControllingClient.GetViewerCaps(); | 2157 | gotCrossUpdate = false; // sanity check |
2162 | 2158 | ||
2163 | bool isHGTP = (m_teleportFlags & TeleportFlags.ViaHGLogin) != 0; | 2159 | if (!gotCrossUpdate) |
2160 | RotateToLookAt(look); | ||
2164 | 2161 | ||
2165 | int delayctnr = Util.EnvironmentTickCount(); | 2162 | m_previusParcelHide = false; |
2163 | m_previusParcelUUID = UUID.Zero; | ||
2164 | m_currentParcelHide = false; | ||
2165 | m_currentParcelUUID = UUID.Zero; | ||
2166 | ParcelDwellTickMS = Util.GetTimeStampMS(); | ||
2166 | 2167 | ||
2167 | if( ParentPart != null && !IsNPC && (crossingFlags & 0x08) != 0) | 2168 | m_inTransit = false; |
2168 | { | ||
2169 | ParentPart.ParentGroup.SendFullAnimUpdateToClient(ControllingClient); | ||
2170 | } | ||
2171 | 2169 | ||
2172 | // verify baked textures and cache | 2170 | // Tell the client that we're ready to send rest |
2173 | bool cachedbaked = false; | 2171 | ControllingClient.SendRegionHandshake(); |
2174 | 2172 | ||
2175 | if (IsNPC) | 2173 | ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); |
2176 | cachedbaked = true; | 2174 | |
2177 | else | 2175 | bool isHGTP = (m_teleportFlags & TeleportFlags.ViaHGLogin) != 0; |
2176 | |||
2177 | if(!IsNPC) | ||
2178 | { | 2178 | { |
2179 | if (m_scene.AvatarFactory != null && !isHGTP) | 2179 | if( ParentPart != null && (crossingFlags & 0x08) != 0) |
2180 | cachedbaked = m_scene.AvatarFactory.ValidateBakedTextureCache(this); | 2180 | { |
2181 | ParentPart.ParentGroup.SendFullAnimUpdateToClient(ControllingClient); | ||
2182 | } | ||
2181 | 2183 | ||
2182 | // not sure we need this | 2184 | // verify baked textures and cache |
2183 | if (!cachedbaked) | 2185 | if (m_scene.AvatarFactory != null && !isHGTP) |
2184 | { | 2186 | { |
2185 | if (m_scene.AvatarFactory != null) | 2187 | if (!m_scene.AvatarFactory.ValidateBakedTextureCache(this)) |
2186 | m_scene.AvatarFactory.QueueAppearanceSave(UUID); | 2188 | m_scene.AvatarFactory.QueueAppearanceSave(UUID); |
2187 | } | 2189 | } |
2188 | } | 2190 | } |
2189 | //m_log.DebugFormat("[CompleteMovement] Baked check: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | ||
2190 | |||
2191 | if(m_teleportFlags > 0) | ||
2192 | { | ||
2193 | gotCrossUpdate = false; // sanity check | ||
2194 | if(Util.EnvironmentTickCountSubtract(delayctnr)< 500) | ||
2195 | Thread.Sleep(500); // let viewers catch us | ||
2196 | } | ||
2197 | 2191 | ||
2198 | if(!gotCrossUpdate) | 2192 | //m_log.DebugFormat("[CompleteMovement] Baked check: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
2199 | RotateToLookAt(look); | ||
2200 | 2193 | ||
2201 | // HG | 2194 | // HG |
2202 | if(isHGTP) | 2195 | if(isHGTP) |
@@ -2205,16 +2198,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2205 | m_log.DebugFormat("[CompleteMovement] HG"); | 2198 | m_log.DebugFormat("[CompleteMovement] HG"); |
2206 | } | 2199 | } |
2207 | 2200 | ||
2208 | m_previusParcelHide = false; | 2201 | if (!IsNPC) |
2209 | m_previusParcelUUID = UUID.Zero; | ||
2210 | m_currentParcelHide = false; | ||
2211 | m_currentParcelUUID = UUID.Zero; | ||
2212 | ParcelDwellTickMS = Util.GetTimeStampMS(); | ||
2213 | |||
2214 | if(!IsNPC) | ||
2215 | { | 2202 | { |
2216 | GodController.SyncViewerState(); | 2203 | GodController.SyncViewerState(); |
2217 | 2204 | ||
2218 | // start sending terrain patchs | 2205 | // start sending terrain patchs |
2219 | if (!gotCrossUpdate) | 2206 | if (!gotCrossUpdate) |
2220 | Scene.SendLayerData(ControllingClient); | 2207 | Scene.SendLayerData(ControllingClient); |
@@ -2229,11 +2216,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
2229 | 2216 | ||
2230 | // send avatar object to all presences including us, so they cross it into region | 2217 | // send avatar object to all presences including us, so they cross it into region |
2231 | // then hide if necessary | 2218 | // then hide if necessary |
2232 | |||
2233 | SendInitialAvatarDataToAllAgents(allpresences); | 2219 | SendInitialAvatarDataToAllAgents(allpresences); |
2234 | 2220 | ||
2235 | // send this look | 2221 | // send this look |
2236 | SendAppearanceToAgent(this); | 2222 | if (!IsNPC) |
2223 | SendAppearanceToAgent(this); | ||
2237 | 2224 | ||
2238 | // send this animations | 2225 | // send this animations |
2239 | 2226 | ||
@@ -2246,13 +2233,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2246 | 2233 | ||
2247 | bool haveAnims = (animIDs != null && animseqs != null && animsobjs != null); | 2234 | bool haveAnims = (animIDs != null && animseqs != null && animsobjs != null); |
2248 | 2235 | ||
2249 | if (haveAnims) | 2236 | if (!IsNPC && haveAnims) |
2250 | SendAnimPackToAgent(this, animIDs, animseqs, animsobjs); | 2237 | SendAnimPackToAgent(this, animIDs, animseqs, animsobjs); |
2251 | 2238 | ||
2252 | // we should be able to receive updates, etc | ||
2253 | // so release them | ||
2254 | m_inTransit = false; | ||
2255 | |||
2256 | // send look and animations to others | 2239 | // send look and animations to others |
2257 | // if not cached we send greys | 2240 | // if not cached we send greys |
2258 | // uncomented if will wait till avatar does baking | 2241 | // uncomented if will wait till avatar does baking |
@@ -2272,33 +2255,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
2272 | } | 2255 | } |
2273 | } // greys if | 2256 | } // greys if |
2274 | 2257 | ||
2275 | //m_log.DebugFormat("[CompleteMovement] ValidateAndSendAppearanceAndAgentData: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | ||
2276 | |||
2277 | // attachments | 2258 | // attachments |
2278 | if (IsNPC || IsRealLogin(m_teleportFlags)) | 2259 | if (IsNPC || IsRealLogin(m_teleportFlags)) |
2279 | { | 2260 | { |
2280 | if (Scene.AttachmentsModule != null) | 2261 | if (Scene.AttachmentsModule != null) |
2281 | // Util.FireAndForget( | 2262 | Scene.AttachmentsModule.RezAttachments(this); |
2282 | // o => | ||
2283 | // { | ||
2284 | |||
2285 | if (!IsNPC) | ||
2286 | Scene.AttachmentsModule.RezAttachments(this); | ||
2287 | else | ||
2288 | Util.FireAndForget(x => | ||
2289 | { | ||
2290 | Scene.AttachmentsModule.RezAttachments(this); | ||
2291 | }); | ||
2292 | |||
2293 | // }); | ||
2294 | } | 2263 | } |
2295 | else | 2264 | else |
2296 | { | 2265 | { |
2297 | if (m_attachments.Count > 0) | 2266 | if (m_attachments.Count > 0) |
2298 | { | 2267 | { |
2299 | // m_log.DebugFormat( | ||
2300 | // "[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name); | ||
2301 | |||
2302 | foreach (SceneObjectGroup sog in m_attachments) | 2268 | foreach (SceneObjectGroup sog in m_attachments) |
2303 | { | 2269 | { |
2304 | sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); | 2270 | sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); |
@@ -2320,7 +2286,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2320 | } | 2286 | } |
2321 | } | 2287 | } |
2322 | } | 2288 | } |
2323 | //m_log.DebugFormat("[CompleteMovement] attachments: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2289 | |
2324 | if (!IsNPC) | 2290 | if (!IsNPC) |
2325 | { | 2291 | { |
2326 | if (!string.IsNullOrEmpty(m_callbackURI)) | 2292 | if (!string.IsNullOrEmpty(m_callbackURI)) |
@@ -2371,8 +2337,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2371 | m_lastChildAgentUpdateGodLevel = GodController.ViwerUIGodLevel; | 2337 | m_lastChildAgentUpdateGodLevel = GodController.ViwerUIGodLevel; |
2372 | m_childUpdatesBusy = false; // allow them | 2338 | m_childUpdatesBusy = false; // allow them |
2373 | 2339 | ||
2374 | //m_log.DebugFormat("[CompleteMovement] openChildAgents: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | ||
2375 | |||
2376 | // send the rest of the world | 2340 | // send the rest of the world |
2377 | if (m_teleportFlags > 0 || m_currentParcelHide) | 2341 | if (m_teleportFlags > 0 || m_currentParcelHide) |
2378 | //SendInitialDataToMe(); | 2342 | //SendInitialDataToMe(); |
@@ -2384,9 +2348,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2384 | // m_reprioritizationLastTime = Util.EnvironmentTickCount() + 15000; // delay it | 2348 | // m_reprioritizationLastTime = Util.EnvironmentTickCount() + 15000; // delay it |
2385 | // m_reprioritizationBusy = false; | 2349 | // m_reprioritizationBusy = false; |
2386 | 2350 | ||
2387 | //m_log.DebugFormat("[CompleteMovement] SendInitialDataToMe: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | ||
2388 | |||
2389 | |||
2390 | if (openChildAgents) | 2351 | if (openChildAgents) |
2391 | { | 2352 | { |
2392 | IFriendsModule friendsModule = m_scene.RequestModuleInterface<IFriendsModule>(); | 2353 | IFriendsModule friendsModule = m_scene.RequestModuleInterface<IFriendsModule>(); |
@@ -3718,10 +3679,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3718 | if (IsChildAgent) | 3679 | if (IsChildAgent) |
3719 | return; | 3680 | return; |
3720 | 3681 | ||
3721 | // m_updateCount = 0; // Kill animation update burst so that the SIT_G.. will stick.. | ||
3722 | sitAnimation = "SIT_GROUND_CONSTRAINED"; | 3682 | sitAnimation = "SIT_GROUND_CONSTRAINED"; |
3723 | // Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED"); | ||
3724 | // TriggerScenePresenceUpdated(); | ||
3725 | SitGround = true; | 3683 | SitGround = true; |
3726 | RemoveFromPhysicalScene(); | 3684 | RemoveFromPhysicalScene(); |
3727 | 3685 | ||
@@ -3822,14 +3780,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3822 | direc.Z = 0; | 3780 | direc.Z = 0; |
3823 | } | 3781 | } |
3824 | 3782 | ||
3825 | // m_log.DebugFormat("[SCENE PRESENCE]: Setting force to apply to {0} for {1}", direc, Name); | ||
3826 | /* | ||
3827 | lock(m_forceToApplyLock) | ||
3828 | { | ||
3829 | m_forceToApply = direc; | ||
3830 | m_forceToApplyValid = true; | ||
3831 | } | ||
3832 | */ | ||
3833 | TargetVelocity = direc; | 3783 | TargetVelocity = direc; |
3834 | Animator.UpdateMovementAnimations(); | 3784 | Animator.UpdateMovementAnimations(); |
3835 | } | 3785 | } |
@@ -4054,7 +4004,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
4054 | if((flags & 0x1000) == 0) // wait for seeds sending | 4004 | if((flags & 0x1000) == 0) // wait for seeds sending |
4055 | return; | 4005 | return; |
4056 | 4006 | ||
4057 | NeedInitialData = false; | 4007 | lock (m_completeMovementLock) |
4008 | { | ||
4009 | if(!NeedInitialData) | ||
4010 | return; | ||
4011 | NeedInitialData = false; | ||
4012 | } | ||
4058 | 4013 | ||
4059 | bool selfappearance = (flags & 4) != 0; | 4014 | bool selfappearance = (flags & 4) != 0; |
4060 | 4015 | ||
@@ -4327,19 +4282,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
4327 | if(IsDeleted || !ControllingClient.IsActive) | 4282 | if(IsDeleted || !ControllingClient.IsActive) |
4328 | return; | 4283 | return; |
4329 | 4284 | ||
4330 | /* | ||
4331 | bool needsendinitial = false; | ||
4332 | lock(m_completeMovementLock) | ||
4333 | { | ||
4334 | needsendinitial = SentInitialData; | ||
4335 | } | ||
4336 | |||
4337 | if(needsendinitial) | ||
4338 | { | ||
4339 | SendInitialDataToMe(); | ||
4340 | return; | ||
4341 | } | ||
4342 | */ | ||
4343 | if(m_reprioritizationBusy) | 4285 | if(m_reprioritizationBusy) |
4344 | return; | 4286 | return; |
4345 | 4287 | ||