diff options
author | UbitUmarov | 2019-03-23 02:18:32 +0000 |
---|---|---|
committer | UbitUmarov | 2019-03-23 02:18:32 +0000 |
commit | d0052c817486a1691fc4e2e7027ac41240b966aa (patch) | |
tree | 2308b3c6c3bd9dd6da9b18d7cca806cec05341b1 /OpenSim/Region/Framework/Scenes/ScenePresence.cs | |
parent | oops send flag PrimFlags.InventoryEmpty but do not override others (diff) | |
download | opensim-SC-d0052c817486a1691fc4e2e7027ac41240b966aa.zip opensim-SC-d0052c817486a1691fc4e2e7027ac41240b966aa.tar.gz opensim-SC-d0052c817486a1691fc4e2e7027ac41240b966aa.tar.bz2 opensim-SC-d0052c817486a1691fc4e2e7027ac41240b966aa.tar.xz |
add more test code to make usage od compressed updates etc. Should be disable, but well many things can go wrong.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 399 |
1 files changed, 246 insertions, 153 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index f010035..e635841 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1212,7 +1212,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1212 | ControllingClient.OnForceReleaseControls += HandleForceReleaseControls; | 1212 | ControllingClient.OnForceReleaseControls += HandleForceReleaseControls; |
1213 | ControllingClient.OnAutoPilotGo += MoveToTargetHandle; | 1213 | ControllingClient.OnAutoPilotGo += MoveToTargetHandle; |
1214 | ControllingClient.OnUpdateThrottles += RaiseUpdateThrottles; | 1214 | ControllingClient.OnUpdateThrottles += RaiseUpdateThrottles; |
1215 | // ControllingClient.OnAgentFOV += HandleAgentFOV; | 1215 | ControllingClient.OnRegionHandShakeReply += RegionHandShakeReply; |
1216 | |||
1217 | // ControllingClient.OnAgentFOV += HandleAgentFOV; | ||
1216 | 1218 | ||
1217 | // ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange); | 1219 | // ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange); |
1218 | // ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement); | 1220 | // ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement); |
@@ -1232,7 +1234,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1232 | ControllingClient.OnForceReleaseControls -= HandleForceReleaseControls; | 1234 | ControllingClient.OnForceReleaseControls -= HandleForceReleaseControls; |
1233 | ControllingClient.OnAutoPilotGo -= MoveToTargetHandle; | 1235 | ControllingClient.OnAutoPilotGo -= MoveToTargetHandle; |
1234 | ControllingClient.OnUpdateThrottles -= RaiseUpdateThrottles; | 1236 | ControllingClient.OnUpdateThrottles -= RaiseUpdateThrottles; |
1235 | // ControllingClient.OnAgentFOV += HandleAgentFOV; | 1237 | ControllingClient.OnRegionHandShakeReply -= RegionHandShakeReply; |
1238 | |||
1239 | // ControllingClient.OnAgentFOV += HandleAgentFOV; | ||
1236 | } | 1240 | } |
1237 | 1241 | ||
1238 | private void SetDirectionVectors() | 1242 | private void SetDirectionVectors() |
@@ -2126,56 +2130,54 @@ namespace OpenSim.Region.Framework.Scenes | |||
2126 | return; | 2130 | return; |
2127 | } | 2131 | } |
2128 | 2132 | ||
2129 | 2133 | if(IsChildAgent) | |
2134 | { | ||
2135 | return; // how? | ||
2136 | } | ||
2130 | //m_log.DebugFormat("[CompleteMovement] MakeRootAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2137 | //m_log.DebugFormat("[CompleteMovement] MakeRootAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
2131 | 2138 | ||
2132 | if(!haveGroupInformation && !IsChildAgent && !IsNPC) | 2139 | if (!IsNPC) |
2133 | { | 2140 | { |
2134 | IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); | 2141 | if (!haveGroupInformation && !IsNPC) |
2135 | if (gm != null) | 2142 | { |
2136 | Grouptitle = gm.GetGroupTitle(m_uuid); | 2143 | IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); |
2144 | if (gm != null) | ||
2145 | Grouptitle = gm.GetGroupTitle(m_uuid); | ||
2137 | 2146 | ||
2138 | //m_log.DebugFormat("[CompleteMovement] Missing Grouptitle: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2147 | //m_log.DebugFormat("[CompleteMovement] Missing Grouptitle: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
2139 | 2148 | ||
2140 | InventoryFolderBase cof = m_scene.InventoryService.GetFolderForType(client.AgentId, (FolderType)46); | 2149 | InventoryFolderBase cof = m_scene.InventoryService.GetFolderForType(client.AgentId, (FolderType)46); |
2141 | if (cof == null) | 2150 | if (cof == null) |
2142 | COF = UUID.Zero; | 2151 | COF = UUID.Zero; |
2143 | else | 2152 | else |
2144 | COF = cof.ID; | 2153 | COF = cof.ID; |
2145 | 2154 | ||
2146 | m_log.DebugFormat("[CompleteMovement]: Missing COF for {0} is {1}", client.AgentId, COF); | 2155 | m_log.DebugFormat("[CompleteMovement]: Missing COF for {0} is {1}", client.AgentId, COF); |
2147 | } | 2156 | } |
2148 | 2157 | ||
2149 | if (!string.IsNullOrEmpty(m_callbackURI)) | 2158 | if (!string.IsNullOrEmpty(m_callbackURI)) |
2150 | { | 2159 | { |
2151 | // We cannot sleep here since this would hold up the inbound packet processing thread, as | 2160 | // We cannot sleep here since this would hold up the inbound packet processing thread, as |
2152 | // CompleteMovement() is executed synchronously. However, it might be better to delay the release | 2161 | // CompleteMovement() is executed synchronously. However, it might be better to delay the release |
2153 | // here until we know for sure that the agent is active in this region. Sending AgentMovementComplete | 2162 | // here until we know for sure that the agent is active in this region. Sending AgentMovementComplete |
2154 | // is not enough for Imprudence clients - there appears to be a small delay (<200ms, <500ms) until they regard this | 2163 | // is not enough for Imprudence clients - there appears to be a small delay (<200ms, <500ms) until they regard this |
2155 | // region as the current region, meaning that a close sent before then will fail the teleport. | 2164 | // region as the current region, meaning that a close sent before then will fail the teleport. |
2156 | // System.Threading.Thread.Sleep(2000); | 2165 | // System.Threading.Thread.Sleep(2000); |
2157 | 2166 | ||
2158 | m_log.DebugFormat( | 2167 | m_log.DebugFormat( |
2159 | "[SCENE PRESENCE]: Releasing {0} {1} with callback to {2}", | 2168 | "[SCENE PRESENCE]: Releasing {0} {1} with callback to {2}", |
2160 | client.Name, client.AgentId, m_callbackURI); | 2169 | client.Name, client.AgentId, m_callbackURI); |
2161 | 2170 | ||
2162 | UUID originID; | 2171 | UUID originID; |
2163 | 2172 | ||
2164 | lock (m_originRegionIDAccessLock) | 2173 | lock (m_originRegionIDAccessLock) |
2165 | originID = m_originRegionID; | 2174 | originID = m_originRegionID; |
2166 | 2175 | ||
2167 | Scene.SimulationService.ReleaseAgent(originID, UUID, m_callbackURI); | 2176 | Scene.SimulationService.ReleaseAgent(originID, UUID, m_callbackURI); |
2168 | m_callbackURI = null; | 2177 | m_callbackURI = null; |
2169 | //m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2178 | //m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
2179 | } | ||
2170 | } | 2180 | } |
2171 | // else | ||
2172 | // { | ||
2173 | // m_log.DebugFormat( | ||
2174 | // "[SCENE PRESENCE]: No callback provided on CompleteMovement of {0} {1} to {2}", | ||
2175 | // client.Name, client.AgentId, m_scene.RegionInfo.RegionName); | ||
2176 | // } | ||
2177 | |||
2178 | |||
2179 | // Tell the client that we're totally ready | 2181 | // Tell the client that we're totally ready |
2180 | ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); | 2182 | ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); |
2181 | //m_log.DebugFormat("[CompleteMovement] MoveAgentIntoRegion: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2183 | //m_log.DebugFormat("[CompleteMovement] MoveAgentIntoRegion: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
@@ -2187,32 +2189,29 @@ namespace OpenSim.Region.Framework.Scenes | |||
2187 | 2189 | ||
2188 | int delayctnr = Util.EnvironmentTickCount(); | 2190 | int delayctnr = Util.EnvironmentTickCount(); |
2189 | 2191 | ||
2190 | if (!IsChildAgent) | 2192 | if( ParentPart != null && !IsNPC && (crossingFlags & 0x08) != 0) |
2191 | { | 2193 | { |
2192 | if( ParentPart != null && !IsNPC && (crossingFlags & 0x08) != 0) | 2194 | ParentPart.ParentGroup.SendFullAnimUpdateToClient(ControllingClient); |
2193 | { | 2195 | } |
2194 | ParentPart.ParentGroup.SendFullAnimUpdateToClient(ControllingClient); | ||
2195 | } | ||
2196 | 2196 | ||
2197 | // verify baked textures and cache | 2197 | // verify baked textures and cache |
2198 | bool cachedbaked = false; | 2198 | bool cachedbaked = false; |
2199 | 2199 | ||
2200 | if (IsNPC) | 2200 | if (IsNPC) |
2201 | cachedbaked = true; | 2201 | cachedbaked = true; |
2202 | else | 2202 | else |
2203 | { | 2203 | { |
2204 | if (m_scene.AvatarFactory != null && !isHGTP) | 2204 | if (m_scene.AvatarFactory != null && !isHGTP) |
2205 | cachedbaked = m_scene.AvatarFactory.ValidateBakedTextureCache(this); | 2205 | cachedbaked = m_scene.AvatarFactory.ValidateBakedTextureCache(this); |
2206 | 2206 | ||
2207 | // not sure we need this | 2207 | // not sure we need this |
2208 | if (!cachedbaked) | 2208 | if (!cachedbaked) |
2209 | { | 2209 | { |
2210 | if (m_scene.AvatarFactory != null) | 2210 | if (m_scene.AvatarFactory != null) |
2211 | m_scene.AvatarFactory.QueueAppearanceSave(UUID); | 2211 | m_scene.AvatarFactory.QueueAppearanceSave(UUID); |
2212 | } | ||
2213 | } | 2212 | } |
2214 | //m_log.DebugFormat("[CompleteMovement] Baked check: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | ||
2215 | } | 2213 | } |
2214 | //m_log.DebugFormat("[CompleteMovement] Baked check: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | ||
2216 | 2215 | ||
2217 | if(m_teleportFlags > 0) | 2216 | if(m_teleportFlags > 0) |
2218 | { | 2217 | { |
@@ -2251,104 +2250,103 @@ namespace OpenSim.Region.Framework.Scenes | |||
2251 | landch.sendClientInitialLandInfo(client, !gotCrossUpdate); | 2250 | landch.sendClientInitialLandInfo(client, !gotCrossUpdate); |
2252 | } | 2251 | } |
2253 | 2252 | ||
2254 | if (!IsChildAgent) | 2253 | List<ScenePresence> allpresences = m_scene.GetScenePresences(); |
2255 | { | ||
2256 | List<ScenePresence> allpresences = m_scene.GetScenePresences(); | ||
2257 | 2254 | ||
2258 | // send avatar object to all presences including us, so they cross it into region | 2255 | // send avatar object to all presences including us, so they cross it into region |
2259 | // then hide if necessary | 2256 | // then hide if necessary |
2260 | 2257 | ||
2261 | SendInitialAvatarDataToAllAgents(allpresences); | 2258 | SendInitialAvatarDataToAllAgents(allpresences); |
2262 | 2259 | ||
2263 | // send this look | 2260 | // send this look |
2264 | SendAppearanceToAgent(this); | 2261 | SendAppearanceToAgent(this); |
2265 | 2262 | ||
2266 | // send this animations | 2263 | // send this animations |
2267 | 2264 | ||
2268 | UUID[] animIDs = null; | 2265 | UUID[] animIDs = null; |
2269 | int[] animseqs = null; | 2266 | int[] animseqs = null; |
2270 | UUID[] animsobjs = null; | 2267 | UUID[] animsobjs = null; |
2271 | 2268 | ||
2272 | if (Animator != null) | 2269 | if (Animator != null) |
2273 | Animator.GetArrays(out animIDs, out animseqs, out animsobjs); | 2270 | Animator.GetArrays(out animIDs, out animseqs, out animsobjs); |
2274 | 2271 | ||
2275 | bool haveAnims = (animIDs != null && animseqs != null && animsobjs != null); | 2272 | bool haveAnims = (animIDs != null && animseqs != null && animsobjs != null); |
2276 | 2273 | ||
2277 | if (haveAnims) | 2274 | if (haveAnims) |
2278 | SendAnimPackToAgent(this, animIDs, animseqs, animsobjs); | 2275 | SendAnimPackToAgent(this, animIDs, animseqs, animsobjs); |
2279 | 2276 | ||
2280 | // we should be able to receive updates, etc | 2277 | // we should be able to receive updates, etc |
2281 | // so release them | 2278 | // so release them |
2282 | m_inTransit = false; | 2279 | m_inTransit = false; |
2283 | 2280 | ||
2284 | // send look and animations to others | 2281 | // send look and animations to others |
2285 | // if not cached we send greys | 2282 | // if not cached we send greys |
2286 | // uncomented if will wait till avatar does baking | 2283 | // uncomented if will wait till avatar does baking |
2287 | //if (cachedbaked) | 2284 | //if (cachedbaked) |
2285 | { | ||
2286 | foreach (ScenePresence p in allpresences) | ||
2288 | { | 2287 | { |
2289 | foreach (ScenePresence p in allpresences) | 2288 | if (p == this) |
2290 | { | 2289 | continue; |
2291 | if (p == this) | ||
2292 | continue; | ||
2293 | 2290 | ||
2294 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) | 2291 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) |
2295 | continue; | 2292 | continue; |
2296 | 2293 | ||
2297 | SendAppearanceToAgentNF(p); | 2294 | SendAppearanceToAgentNF(p); |
2298 | if (haveAnims) | 2295 | if (haveAnims) |
2299 | SendAnimPackToAgentNF(p, animIDs, animseqs, animsobjs); | 2296 | SendAnimPackToAgentNF(p, animIDs, animseqs, animsobjs); |
2300 | } | 2297 | } |
2301 | } // greys if | 2298 | } // greys if |
2302 | 2299 | ||
2303 | //m_log.DebugFormat("[CompleteMovement] ValidateAndSendAppearanceAndAgentData: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2300 | //m_log.DebugFormat("[CompleteMovement] ValidateAndSendAppearanceAndAgentData: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
2304 | 2301 | ||
2305 | // attachments | 2302 | // attachments |
2306 | if (IsNPC || IsRealLogin(m_teleportFlags)) | 2303 | if (IsNPC || IsRealLogin(m_teleportFlags)) |
2307 | { | 2304 | { |
2308 | if (Scene.AttachmentsModule != null) | 2305 | if (Scene.AttachmentsModule != null) |
2309 | // Util.FireAndForget( | 2306 | // Util.FireAndForget( |
2310 | // o => | 2307 | // o => |
2311 | // { | 2308 | // { |
2312 | 2309 | ||
2313 | if (!IsNPC) | 2310 | if (!IsNPC) |
2311 | Scene.AttachmentsModule.RezAttachments(this); | ||
2312 | else | ||
2313 | Util.FireAndForget(x => | ||
2314 | { | ||
2314 | Scene.AttachmentsModule.RezAttachments(this); | 2315 | Scene.AttachmentsModule.RezAttachments(this); |
2315 | else | 2316 | }); |
2316 | Util.FireAndForget(x => | ||
2317 | { | ||
2318 | Scene.AttachmentsModule.RezAttachments(this); | ||
2319 | }); | ||
2320 | 2317 | ||
2321 | // }); | 2318 | // }); |
2322 | } | 2319 | } |
2323 | else | 2320 | else |
2321 | { | ||
2322 | if (m_attachments.Count > 0) | ||
2324 | { | 2323 | { |
2325 | if (m_attachments.Count > 0) | ||
2326 | { | ||
2327 | // m_log.DebugFormat( | 2324 | // m_log.DebugFormat( |
2328 | // "[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name); | 2325 | // "[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name); |
2329 | 2326 | ||
2330 | foreach (SceneObjectGroup sog in m_attachments) | 2327 | foreach (SceneObjectGroup sog in m_attachments) |
2331 | { | 2328 | { |
2332 | sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); | 2329 | sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); |
2333 | sog.ResumeScripts(); | 2330 | sog.ResumeScripts(); |
2334 | } | 2331 | } |
2335 | 2332 | ||
2336 | foreach (ScenePresence p in allpresences) | 2333 | foreach (ScenePresence p in allpresences) |
2334 | { | ||
2335 | if (p == this) | ||
2337 | { | 2336 | { |
2338 | if (p == this) | 2337 | SendAttachmentsToAgentNF(this); |
2339 | { | 2338 | continue; |
2340 | SendAttachmentsToAgentNF(this); | 2339 | } |
2341 | continue; | ||
2342 | } | ||
2343 | 2340 | ||
2344 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) | 2341 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) |
2345 | continue; | 2342 | continue; |
2346 | 2343 | ||
2347 | SendAttachmentsToAgentNF(p); | 2344 | SendAttachmentsToAgentNF(p); |
2348 | } | ||
2349 | } | 2345 | } |
2350 | } | 2346 | } |
2351 | 2347 | } | |
2348 | if(!IsNPC) | ||
2349 | { | ||
2352 | //m_log.DebugFormat("[CompleteMovement] attachments: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2350 | //m_log.DebugFormat("[CompleteMovement] attachments: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
2353 | if (openChildAgents) | 2351 | if (openChildAgents) |
2354 | { | 2352 | { |
@@ -2366,34 +2364,33 @@ namespace OpenSim.Region.Framework.Scenes | |||
2366 | 2364 | ||
2367 | m_lastChildAgentUpdateGodLevel = GodController.ViwerUIGodLevel; | 2365 | m_lastChildAgentUpdateGodLevel = GodController.ViwerUIGodLevel; |
2368 | m_childUpdatesBusy = false; // allow them | 2366 | m_childUpdatesBusy = false; // allow them |
2369 | } | ||
2370 | 2367 | ||
2371 | //m_log.DebugFormat("[CompleteMovement] openChildAgents: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2368 | //m_log.DebugFormat("[CompleteMovement] openChildAgents: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
2372 | 2369 | ||
2373 | // send the rest of the world | 2370 | // send the rest of the world |
2374 | if (m_teleportFlags > 0 && !IsNPC || m_currentParcelHide) | 2371 | if (m_teleportFlags > 0 | m_currentParcelHide) |
2375 | SendInitialDataToMe(); | 2372 | SendInitialDataToMe(); |
2376 | 2373 | ||
2377 | // priority uses avatar position only | 2374 | // priority uses avatar position only |
2378 | // m_reprioritizationLastPosition = AbsolutePosition; | 2375 | // m_reprioritizationLastPosition = AbsolutePosition; |
2379 | // m_reprioritizationLastDrawDistance = DrawDistance; | 2376 | // m_reprioritizationLastDrawDistance = DrawDistance; |
2380 | // m_reprioritizationLastTime = Util.EnvironmentTickCount() + 15000; // delay it | 2377 | // m_reprioritizationLastTime = Util.EnvironmentTickCount() + 15000; // delay it |
2381 | // m_reprioritizationBusy = false; | 2378 | // m_reprioritizationBusy = false; |
2382 | 2379 | ||
2383 | //m_log.DebugFormat("[CompleteMovement] SendInitialDataToMe: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2380 | //m_log.DebugFormat("[CompleteMovement] SendInitialDataToMe: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
2384 | 2381 | ||
2385 | if (!IsChildAgent && openChildAgents) | 2382 | if (openChildAgents) |
2386 | { | ||
2387 | IFriendsModule friendsModule = m_scene.RequestModuleInterface<IFriendsModule>(); | ||
2388 | if (friendsModule != null) | ||
2389 | { | 2383 | { |
2390 | if(gotCrossUpdate) | 2384 | IFriendsModule friendsModule = m_scene.RequestModuleInterface<IFriendsModule>(); |
2391 | friendsModule.IsNowRoot(this); | 2385 | if (friendsModule != null) |
2392 | else | 2386 | { |
2393 | friendsModule.SendFriendsOnlineIfNeeded(ControllingClient); | 2387 | if(gotCrossUpdate) |
2388 | friendsModule.IsNowRoot(this); | ||
2389 | else | ||
2390 | friendsModule.SendFriendsOnlineIfNeeded(ControllingClient); | ||
2391 | } | ||
2392 | //m_log.DebugFormat("[CompleteMovement] friendsModule: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | ||
2394 | } | 2393 | } |
2395 | //m_log.DebugFormat("[CompleteMovement] friendsModule: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | ||
2396 | |||
2397 | } | 2394 | } |
2398 | } | 2395 | } |
2399 | finally | 2396 | finally |
@@ -4024,10 +4021,100 @@ namespace OpenSim.Region.Framework.Scenes | |||
4024 | ControllingClient.SendCoarseLocationUpdate(avatarUUIDs, coarseLocations); | 4021 | ControllingClient.SendCoarseLocationUpdate(avatarUUIDs, coarseLocations); |
4025 | } | 4022 | } |
4026 | 4023 | ||
4024 | |||
4025 | public void RegionHandShakeReply (IClientAPI client, uint flags) | ||
4026 | { | ||
4027 | if(IsNPC) | ||
4028 | return; | ||
4029 | |||
4030 | bool selfappearance = (flags & 4) != 0; | ||
4031 | bool cacheCulling = (flags & 1) != 0; | ||
4032 | bool cacheEmpty; | ||
4033 | if(cacheCulling) | ||
4034 | cacheEmpty = (flags & 2) != 0; | ||
4035 | else | ||
4036 | cacheEmpty = true; | ||
4037 | |||
4038 | if (m_teleportFlags > 0) // only doing for child for now | ||
4039 | return; | ||
4040 | |||
4041 | lock (m_completeMovementLock) | ||
4042 | { | ||
4043 | if (SentInitialData) | ||
4044 | return; | ||
4045 | SentInitialData = true; | ||
4046 | } | ||
4047 | |||
4048 | Util.FireAndForget(delegate | ||
4049 | { | ||
4050 | Scene.SendLayerData(ControllingClient); | ||
4051 | |||
4052 | ILandChannel landch = m_scene.LandChannel; | ||
4053 | if (landch != null) | ||
4054 | landch.sendClientInitialLandInfo(ControllingClient, true); | ||
4055 | |||
4056 | // recheck to reduce timing issues | ||
4057 | ControllingClient.CheckViewerCaps(); | ||
4058 | |||
4059 | SendOtherAgentsAvatarFullToMe(); | ||
4060 | /* | ||
4061 | if (m_scene.ObjectsCullingByDistance && cacheCulling) | ||
4062 | { | ||
4063 | m_reprioritizationBusy = true; | ||
4064 | m_reprioritizationLastPosition = AbsolutePosition; | ||
4065 | m_reprioritizationLastDrawDistance = DrawDistance; | ||
4066 | |||
4067 | ControllingClient.ReprioritizeUpdates(); | ||
4068 | m_reprioritizationLastTime = Util.EnvironmentTickCount(); | ||
4069 | m_reprioritizationBusy = false; | ||
4070 | return; | ||
4071 | } | ||
4072 | */ | ||
4073 | |||
4074 | EntityBase[] entities = Scene.Entities.GetEntities(); | ||
4075 | if(cacheEmpty) | ||
4076 | { | ||
4077 | foreach (EntityBase e in entities) | ||
4078 | { | ||
4079 | if (e != null && e is SceneObjectGroup && !((SceneObjectGroup)e).IsAttachment) | ||
4080 | ((SceneObjectGroup)e).SendFullAnimUpdateToClient(ControllingClient); | ||
4081 | } | ||
4082 | } | ||
4083 | else | ||
4084 | { | ||
4085 | foreach (EntityBase e in entities) | ||
4086 | { | ||
4087 | if (e != null && e is SceneObjectGroup && !((SceneObjectGroup)e).IsAttachment) | ||
4088 | { | ||
4089 | SceneObjectGroup grp = e as SceneObjectGroup; | ||
4090 | if(grp.IsViewerCachable) | ||
4091 | grp.SendUpdateProbes(ControllingClient); | ||
4092 | else | ||
4093 | grp.SendFullAnimUpdateToClient(ControllingClient); | ||
4094 | } | ||
4095 | } | ||
4096 | } | ||
4097 | |||
4098 | m_reprioritizationLastPosition = AbsolutePosition; | ||
4099 | m_reprioritizationLastDrawDistance = DrawDistance; | ||
4100 | m_reprioritizationLastTime = Util.EnvironmentTickCount() + 15000; // delay it | ||
4101 | |||
4102 | m_reprioritizationBusy = false; | ||
4103 | |||
4104 | }); | ||
4105 | |||
4106 | } | ||
4107 | |||
4027 | public void SendInitialDataToMe() | 4108 | public void SendInitialDataToMe() |
4028 | { | 4109 | { |
4029 | // Send all scene object to the new client | 4110 | // Send all scene object to the new client |
4030 | SentInitialData = true; | 4111 | lock (m_completeMovementLock) |
4112 | { | ||
4113 | if (SentInitialData) | ||
4114 | return; | ||
4115 | SentInitialData = true; | ||
4116 | } | ||
4117 | |||
4031 | Util.FireAndForget(delegate | 4118 | Util.FireAndForget(delegate |
4032 | { | 4119 | { |
4033 | // we created a new ScenePresence (a new child agent) in a fresh region. | 4120 | // we created a new ScenePresence (a new child agent) in a fresh region. |
@@ -4280,7 +4367,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
4280 | if(IsDeleted || !ControllingClient.IsActive) | 4367 | if(IsDeleted || !ControllingClient.IsActive) |
4281 | return; | 4368 | return; |
4282 | 4369 | ||
4283 | if(!SentInitialData) | 4370 | bool needsendinitial = false; |
4371 | lock(m_completeMovementLock) | ||
4372 | { | ||
4373 | needsendinitial = SentInitialData; | ||
4374 | } | ||
4375 | |||
4376 | if(!needsendinitial) | ||
4284 | { | 4377 | { |
4285 | SendInitialDataToMe(); | 4378 | SendInitialDataToMe(); |
4286 | return; | 4379 | return; |