diff options
author | UbitUmarov | 2019-03-30 12:07:49 +0000 |
---|---|---|
committer | UbitUmarov | 2019-03-30 12:07:49 +0000 |
commit | 6cf85a3db111c2f8e56dde8a05ff3cf13f5ecd14 (patch) | |
tree | 553b71ac6bc6bd451a8e733a3612f18f9f936d7e /OpenSim/Region/Framework/Scenes | |
parent | Yengine: fix scripts resume on attachments drop (diff) | |
download | opensim-SC-6cf85a3db111c2f8e56dde8a05ff3cf13f5ecd14.zip opensim-SC-6cf85a3db111c2f8e56dde8a05ff3cf13f5ecd14.tar.gz opensim-SC-6cf85a3db111c2f8e56dde8a05ff3cf13f5ecd14.tar.bz2 opensim-SC-6cf85a3db111c2f8e56dde8a05ff3cf13f5ecd14.tar.xz |
a few more changes on initial objects send
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 126 |
1 files changed, 68 insertions, 58 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index a95036c..123b605 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -99,6 +99,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
99 | public bool IsViewerUIGod { get; set; } | 99 | public bool IsViewerUIGod { get; set; } |
100 | public bool IsGod { get; set; } | 100 | public bool IsGod { get; set; } |
101 | 101 | ||
102 | private bool m_gotRegionHandShake = false; | ||
103 | |||
102 | private PresenceType m_presenceType; | 104 | private PresenceType m_presenceType; |
103 | public PresenceType PresenceType | 105 | public PresenceType PresenceType |
104 | { | 106 | { |
@@ -288,7 +290,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
288 | private Quaternion m_lastRotation; | 290 | private Quaternion m_lastRotation; |
289 | private Vector3 m_lastVelocity; | 291 | private Vector3 m_lastVelocity; |
290 | private Vector3 m_lastSize = new Vector3(0.45f,0.6f,1.9f); | 292 | private Vector3 m_lastSize = new Vector3(0.45f,0.6f,1.9f); |
291 | private bool SentInitialData = false; | 293 | private bool NeedInitialData = false; |
292 | 294 | ||
293 | private int m_userFlags; | 295 | private int m_userFlags; |
294 | public int UserFlags | 296 | public int UserFlags |
@@ -881,7 +883,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
881 | } | 883 | } |
882 | 884 | ||
883 | public bool IsChildAgent { get; set; } | 885 | public bool IsChildAgent { get; set; } |
884 | public bool IsLoggingIn { get; set; } | ||
885 | 886 | ||
886 | /// <summary> | 887 | /// <summary> |
887 | /// If the avatar is sitting, the local ID of the prim that it's sitting on. If not sitting then zero. | 888 | /// If the avatar is sitting, the local ID of the prim that it's sitting on. If not sitting then zero. |
@@ -1074,7 +1075,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1074 | AttachmentsSyncLock = new Object(); | 1075 | AttachmentsSyncLock = new Object(); |
1075 | AllowMovement = true; | 1076 | AllowMovement = true; |
1076 | IsChildAgent = true; | 1077 | IsChildAgent = true; |
1077 | IsLoggingIn = false; | ||
1078 | m_sendCoarseLocationsMethod = SendCoarseLocationsDefault; | 1078 | m_sendCoarseLocationsMethod = SendCoarseLocationsDefault; |
1079 | Animator = new ScenePresenceAnimator(this); | 1079 | Animator = new ScenePresenceAnimator(this); |
1080 | Overrides = new MovementAnimationOverrides(); | 1080 | Overrides = new MovementAnimationOverrides(); |
@@ -1307,7 +1307,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1307 | ParentPart = null; | 1307 | ParentPart = null; |
1308 | PrevSitOffset = Vector3.Zero; | 1308 | PrevSitOffset = Vector3.Zero; |
1309 | HandleForceReleaseControls(ControllingClient, UUID); // needs testing | 1309 | HandleForceReleaseControls(ControllingClient, UUID); // needs testing |
1310 | IsLoggingIn = false; | ||
1311 | } | 1310 | } |
1312 | else | 1311 | else |
1313 | { | 1312 | { |
@@ -1331,10 +1330,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1331 | } | 1330 | } |
1332 | ParentUUID = UUID.Zero; | 1331 | ParentUUID = UUID.Zero; |
1333 | } | 1332 | } |
1334 | else | ||
1335 | { | ||
1336 | IsLoggingIn = false; | ||
1337 | } | ||
1338 | 1333 | ||
1339 | IsChildAgent = false; | 1334 | IsChildAgent = false; |
1340 | } | 1335 | } |
@@ -2163,7 +2158,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2163 | //m_log.DebugFormat("[CompleteMovement] MoveAgentIntoRegion: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2158 | //m_log.DebugFormat("[CompleteMovement] MoveAgentIntoRegion: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
2164 | 2159 | ||
2165 | // recheck to reduce timing issues | 2160 | // recheck to reduce timing issues |
2166 | ControllingClient.CheckViewerCaps(); | 2161 | ControllingClient.GetViewerCaps(); |
2167 | 2162 | ||
2168 | bool isHGTP = (m_teleportFlags & TeleportFlags.ViaHGLogin) != 0; | 2163 | bool isHGTP = (m_teleportFlags & TeleportFlags.ViaHGLogin) != 0; |
2169 | 2164 | ||
@@ -2325,9 +2320,40 @@ namespace OpenSim.Region.Framework.Scenes | |||
2325 | } | 2320 | } |
2326 | } | 2321 | } |
2327 | } | 2322 | } |
2328 | if(!IsNPC) | 2323 | //m_log.DebugFormat("[CompleteMovement] attachments: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
2324 | if (!IsNPC) | ||
2329 | { | 2325 | { |
2330 | //m_log.DebugFormat("[CompleteMovement] attachments: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2326 | if (!string.IsNullOrEmpty(m_callbackURI)) |
2327 | { | ||
2328 | m_log.DebugFormat( | ||
2329 | "[SCENE PRESENCE]: Releasing {0} {1} with old callback to {2}", | ||
2330 | client.Name, client.AgentId, m_callbackURI); | ||
2331 | |||
2332 | UUID originID; | ||
2333 | |||
2334 | lock (m_originRegionIDAccessLock) | ||
2335 | originID = m_originRegionID; | ||
2336 | |||
2337 | Scene.SimulationService.ReleaseAgent(originID, UUID, m_callbackURI); | ||
2338 | m_callbackURI = null; | ||
2339 | //m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | ||
2340 | } | ||
2341 | else if (!string.IsNullOrEmpty(m_newCallbackURI)) | ||
2342 | { | ||
2343 | m_log.DebugFormat( | ||
2344 | "[SCENE PRESENCE]: Releasing {0} {1} with callback to {2}", | ||
2345 | client.Name, client.AgentId, m_newCallbackURI); | ||
2346 | |||
2347 | UUID originID; | ||
2348 | |||
2349 | lock (m_originRegionIDAccessLock) | ||
2350 | originID = m_originRegionID; | ||
2351 | |||
2352 | Scene.SimulationService.ReleaseAgent(originID, UUID, m_newCallbackURI); | ||
2353 | m_newCallbackURI = null; | ||
2354 | //m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | ||
2355 | } | ||
2356 | |||
2331 | if (openChildAgents) | 2357 | if (openChildAgents) |
2332 | { | 2358 | { |
2333 | // Create child agents in neighbouring regions | 2359 | // Create child agents in neighbouring regions |
@@ -2360,36 +2386,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2360 | 2386 | ||
2361 | //m_log.DebugFormat("[CompleteMovement] SendInitialDataToMe: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2387 | //m_log.DebugFormat("[CompleteMovement] SendInitialDataToMe: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
2362 | 2388 | ||
2363 | if (!string.IsNullOrEmpty(m_callbackURI)) | ||
2364 | { | ||
2365 | m_log.DebugFormat( | ||
2366 | "[SCENE PRESENCE]: Releasing {0} {1} with old callback to {2}", | ||
2367 | client.Name, client.AgentId, m_callbackURI); | ||
2368 | |||
2369 | UUID originID; | ||
2370 | |||
2371 | lock (m_originRegionIDAccessLock) | ||
2372 | originID = m_originRegionID; | ||
2373 | |||
2374 | Scene.SimulationService.ReleaseAgent(originID, UUID, m_callbackURI); | ||
2375 | m_callbackURI = null; | ||
2376 | //m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | ||
2377 | } | ||
2378 | else if (!string.IsNullOrEmpty(m_newCallbackURI)) | ||
2379 | { | ||
2380 | m_log.DebugFormat( | ||
2381 | "[SCENE PRESENCE]: Releasing {0} {1} with callback to {2}", | ||
2382 | client.Name, client.AgentId, m_newCallbackURI); | ||
2383 | |||
2384 | UUID originID; | ||
2385 | |||
2386 | lock (m_originRegionIDAccessLock) | ||
2387 | originID = m_originRegionID; | ||
2388 | |||
2389 | Scene.SimulationService.ReleaseAgent(originID, UUID, m_newCallbackURI); | ||
2390 | m_newCallbackURI = null; | ||
2391 | //m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | ||
2392 | } | ||
2393 | 2389 | ||
2394 | if (openChildAgents) | 2390 | if (openChildAgents) |
2395 | { | 2391 | { |
@@ -3850,15 +3846,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
3850 | 3846 | ||
3851 | public override void Update() | 3847 | public override void Update() |
3852 | { | 3848 | { |
3853 | if(IsChildAgent || IsDeleted) | 3849 | if (IsDeleted) |
3854 | return; | 3850 | return; |
3855 | 3851 | ||
3856 | CheckForBorderCrossing(); | 3852 | if (NeedInitialData) |
3853 | { | ||
3854 | SendInitialData(); | ||
3855 | return; | ||
3856 | } | ||
3857 | 3857 | ||
3858 | if (IsInTransit || IsLoggingIn) | 3858 | if (IsChildAgent || IsInTransit) |
3859 | return; | 3859 | return; |
3860 | 3860 | ||
3861 | if(m_movingToTarget) | 3861 | CheckForBorderCrossing(); |
3862 | |||
3863 | if (m_movingToTarget) | ||
3862 | { | 3864 | { |
3863 | m_delayedStop = -1; | 3865 | m_delayedStop = -1; |
3864 | Vector3 control = Vector3.Zero; | 3866 | Vector3 control = Vector3.Zero; |
@@ -4033,25 +4035,28 @@ namespace OpenSim.Region.Framework.Scenes | |||
4033 | ControllingClient.SendCoarseLocationUpdate(avatarUUIDs, coarseLocations); | 4035 | ControllingClient.SendCoarseLocationUpdate(avatarUUIDs, coarseLocations); |
4034 | } | 4036 | } |
4035 | 4037 | ||
4036 | public void RegionHandShakeReply (IClientAPI client, uint flags) | 4038 | public void RegionHandShakeReply (IClientAPI client) |
4037 | { | 4039 | { |
4038 | if(IsNPC) | 4040 | if(IsNPC) |
4039 | return; | 4041 | return; |
4040 | 4042 | ||
4041 | lock (m_completeMovementLock) | 4043 | lock (m_completeMovementLock) |
4042 | { | 4044 | { |
4043 | if (SentInitialData) | 4045 | if(m_gotRegionHandShake) |
4044 | return; | 4046 | return; |
4045 | SentInitialData = true; | 4047 | NeedInitialData = true; |
4046 | } | 4048 | } |
4049 | } | ||
4050 | |||
4051 | private void SendInitialData() | ||
4052 | { | ||
4053 | uint flags = ControllingClient.GetViewerCaps(); | ||
4054 | if((flags & 0x1000) == 0) // wait for seeds sending | ||
4055 | return; | ||
4056 | |||
4057 | NeedInitialData = false; | ||
4047 | 4058 | ||
4048 | bool selfappearance = (flags & 4) != 0; | 4059 | bool selfappearance = (flags & 4) != 0; |
4049 | bool cacheCulling = (flags & 1) != 0; | ||
4050 | bool cacheEmpty; | ||
4051 | if(cacheCulling) | ||
4052 | cacheEmpty = (flags & 2) != 0; | ||
4053 | else | ||
4054 | cacheEmpty = true; | ||
4055 | 4060 | ||
4056 | Util.FireAndForget(delegate | 4061 | Util.FireAndForget(delegate |
4057 | { | 4062 | { |
@@ -4066,9 +4071,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
4066 | SendOtherAgentsAvatarFullToMe(); | 4071 | SendOtherAgentsAvatarFullToMe(); |
4067 | } | 4072 | } |
4068 | 4073 | ||
4069 | // recheck to reduce timing issues | ||
4070 | ControllingClient.CheckViewerCaps(); | ||
4071 | |||
4072 | if (m_scene.ObjectsCullingByDistance) | 4074 | if (m_scene.ObjectsCullingByDistance) |
4073 | { | 4075 | { |
4074 | m_reprioritizationBusy = true; | 4076 | m_reprioritizationBusy = true; |
@@ -4081,6 +4083,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
4081 | return; | 4083 | return; |
4082 | } | 4084 | } |
4083 | 4085 | ||
4086 | bool cacheCulling = (flags & 1) != 0; | ||
4087 | bool cacheEmpty; | ||
4088 | if (cacheCulling) | ||
4089 | cacheEmpty = (flags & 2) != 0; | ||
4090 | else | ||
4091 | cacheEmpty = true; | ||
4092 | |||
4084 | EntityBase[] entities = Scene.Entities.GetEntities(); | 4093 | EntityBase[] entities = Scene.Entities.GetEntities(); |
4085 | if(cacheEmpty) | 4094 | if(cacheEmpty) |
4086 | { | 4095 | { |
@@ -6816,7 +6825,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
6816 | lock (m_completeMovementLock) | 6825 | lock (m_completeMovementLock) |
6817 | { | 6826 | { |
6818 | GodController.HasMovedAway(); | 6827 | GodController.HasMovedAway(); |
6819 | SentInitialData = false; | 6828 | NeedInitialData = false; |
6829 | m_gotRegionHandShake = false; | ||
6820 | } | 6830 | } |
6821 | 6831 | ||
6822 | List<ScenePresence> allpresences = m_scene.GetScenePresences(); | 6832 | List<ScenePresence> allpresences = m_scene.GetScenePresences(); |