aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorUbitUmarov2015-09-12 14:37:07 +0100
committerUbitUmarov2015-09-12 14:37:07 +0100
commitdfc142a50f482a134aa280482c8d93a2394a1430 (patch)
tree55afbf16cdfefb1706023ce952dce102c7f16345 /OpenSim/Region
parent revert validating Library textures. Those need to be on a grid assets or wil... (diff)
downloadopensim-SC_OLD-dfc142a50f482a134aa280482c8d93a2394a1430.zip
opensim-SC_OLD-dfc142a50f482a134aa280482c8d93a2394a1430.tar.gz
opensim-SC_OLD-dfc142a50f482a134aa280482c8d93a2394a1430.tar.bz2
opensim-SC_OLD-dfc142a50f482a134aa280482c8d93a2394a1430.tar.xz
try to be more friendly to HG
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs41
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs10
2 files changed, 30 insertions, 21 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 3cbde62..97d417f 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -1093,16 +1093,19 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1093 // Well, this is it. The agent is over there. 1093 // Well, this is it. The agent is over there.
1094// KillEntity(sp.Scene, sp.LocalId); 1094// KillEntity(sp.Scene, sp.LocalId);
1095 1095
1096 sp.HasMovedAway(!OutSideViewRange); 1096 sp.HasMovedAway(!(OutSideViewRange || logout));
1097
1098 // call HG hook
1099 AgentHasMovedAway(sp, logout);
1097 1100
1098 sp.CloseChildAgents(destinationHandle,finalDestination.RegionSizeX,finalDestination.RegionSizeY); 1101 sp.CloseChildAgents(logout, destinationHandle, finalDestination.RegionSizeX, finalDestination.RegionSizeY);
1099 1102
1100 // Now let's make it officially a child agent 1103 // Now let's make it officially a child agent
1101 sp.MakeChildAgent(destinationHandle); 1104 sp.MakeChildAgent(destinationHandle);
1102 1105
1103 // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone 1106 // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
1104 1107
1105 if (OutSideViewRange) 1108 if (NeedsClosing(reg, OutSideViewRange))
1106 { 1109 {
1107 if (!sp.Scene.IncomingPreCloseClient(sp)) 1110 if (!sp.Scene.IncomingPreCloseClient(sp))
1108 return; 1111 return;
@@ -1227,7 +1230,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1227 1230
1228 m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp); 1231 m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp);
1229 1232
1230 sp.HasMovedAway(!OutSideViewRange); 1233 sp.HasMovedAway(!(OutSideViewRange || logout));
1231 1234
1232 // Need to signal neighbours whether child agents may need closing irrespective of whether this 1235 // Need to signal neighbours whether child agents may need closing irrespective of whether this
1233 // one needed closing. We also need to close child agents as quickly as possible to avoid complicated 1236 // one needed closing. We also need to close child agents as quickly as possible to avoid complicated
@@ -1235,7 +1238,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1235 // to a neighbour A2 then off to a non-neighbour C). Closing child agents any later requires complex 1238 // to a neighbour A2 then off to a non-neighbour C). Closing child agents any later requires complex
1236 // distributed checks to avoid problems in rapid reteleporting scenarios and where child agents are 1239 // distributed checks to avoid problems in rapid reteleporting scenarios and where child agents are
1237 // abandoned without proper close by viewer but then re-used by an incoming connection. 1240 // abandoned without proper close by viewer but then re-used by an incoming connection.
1238 sp.CloseChildAgents(destinationHandle, finalDestination.RegionSizeX, finalDestination.RegionSizeY); 1241 sp.CloseChildAgents(logout, destinationHandle, finalDestination.RegionSizeX, finalDestination.RegionSizeY);
1239 1242
1240// AgentHasMovedAway(sp, true); 1243// AgentHasMovedAway(sp, true);
1241 // Well, this is it. The agent is over there. 1244 // Well, this is it. The agent is over there.
@@ -1244,8 +1247,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1244 // Now let's make it officially a child agent 1247 // Now let's make it officially a child agent
1245 sp.MakeChildAgent(destinationHandle); 1248 sp.MakeChildAgent(destinationHandle);
1246 1249
1250 //HG hook
1251 AgentHasMovedAway(sp, logout);
1252
1247 // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone 1253 // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
1248 if (OutSideViewRange) 1254 // go by HG hook
1255 if (NeedsClosing(reg, OutSideViewRange))
1249 { 1256 {
1250 if (!sp.Scene.IncomingPreCloseClient(sp)) 1257 if (!sp.Scene.IncomingPreCloseClient(sp))
1251 return; 1258 return;
@@ -1353,10 +1360,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1353 /// </summary> 1360 /// </summary>
1354 /// <param name='sp'></param> 1361 /// <param name='sp'></param>
1355 /// <param name='logout'></param> 1362 /// <param name='logout'></param>
1363 ///
1364 /// now just a HG hook
1356 protected virtual void AgentHasMovedAway(ScenePresence sp, bool logout) 1365 protected virtual void AgentHasMovedAway(ScenePresence sp, bool logout)
1357 { 1366 {
1358 if (sp.Scene.AttachmentsModule != null) 1367// if (sp.Scene.AttachmentsModule != null)
1359 sp.Scene.AttachmentsModule.DeleteAttachmentsFromScene(sp, logout); 1368// sp.Scene.AttachmentsModule.DeleteAttachmentsFromScene(sp, logout);
1360 } 1369 }
1361 1370
1362 protected void KillEntity(Scene scene, uint localID) 1371 protected void KillEntity(Scene scene, uint localID)
@@ -1364,6 +1373,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1364 scene.SendKillObject(new List<uint> { localID }); 1373 scene.SendKillObject(new List<uint> { localID });
1365 } 1374 }
1366 1375
1376 // HG hook
1367 protected virtual GridRegion GetFinalDestination(GridRegion region, UUID agentID, string agentHomeURI, out string message) 1377 protected virtual GridRegion GetFinalDestination(GridRegion region, UUID agentID, string agentHomeURI, out string message)
1368 { 1378 {
1369 message = null; 1379 message = null;
@@ -1391,15 +1401,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1391 return Util.IsOutsideView(drawdist, oldRegionX, newRegionX, oldRegionY, newRegionY, 1401 return Util.IsOutsideView(drawdist, oldRegionX, newRegionX, oldRegionY, newRegionY,
1392 oldsizeX, oldsizeY, newsizeX, newsizeY); 1402 oldsizeX, oldsizeY, newsizeX, newsizeY);
1393 } 1403 }
1394/*
1395 protected virtual bool NeedsClosing(float drawdist, uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY,
1396 uint oldsizeX, uint oldsizeY, uint newsizeX, uint newsizeY, GridRegion reg)
1397 {
1398 1404
1399 return Util.IsOutsideView(drawdist, oldRegionX, newRegionX, oldRegionY, newRegionY, 1405 // HG Hook
1400 oldsizeX, oldsizeY, newsizeX, newsizeY); 1406 protected virtual bool NeedsClosing(GridRegion reg, bool OutViewRange)
1407
1408 {
1409 return OutViewRange;
1401 } 1410 }
1402*/ 1411
1403 #endregion 1412 #endregion
1404 1413
1405 #region Landmark Teleport 1414 #region Landmark Teleport
@@ -1877,7 +1886,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1877 // but not sure yet what the side effects would be. 1886 // but not sure yet what the side effects would be.
1878 m_entityTransferStateMachine.ResetFromTransit(agent.UUID); 1887 m_entityTransferStateMachine.ResetFromTransit(agent.UUID);
1879 1888
1880 agent.CloseChildAgents(neighbourRegion.RegionHandle, neighbourRegion.RegionSizeX, neighbourRegion.RegionSizeY); 1889 agent.CloseChildAgents(false, neighbourRegion.RegionHandle, neighbourRegion.RegionSizeX, neighbourRegion.RegionSizeY);
1881 1890
1882 1891
1883 // the user may change their profile information in other region, 1892 // the user may change their profile information in other region,
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index 5ec688c..dcc4746 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -238,19 +238,19 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
238 238
239 return region; 239 return region;
240 } 240 }
241/* NEEDFIX 241
242 protected override bool NeedsClosing(float drawdist, uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, GridRegion reg) 242 protected override bool NeedsClosing(GridRegion reg, bool OutViewRange)
243 { 243 {
244 if (base.NeedsClosing(drawdist, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) 244 if (OutViewRange)
245 return true; 245 return true;
246 246
247 int flags = Scene.GridService.GetRegionFlags(Scene.RegionInfo.ScopeID, reg.RegionID); 247 int flags = Scene.GridService.GetRegionFlags(Scene.RegionInfo.ScopeID, reg.RegionID);
248 if (flags == -1 || (flags & (int)OpenSim.Framework.RegionFlags.Hyperlink) != 0) 248 if (flags == -1 || (flags & (int)OpenSim.Framework.RegionFlags.Hyperlink) != 0)
249 return true; 249 return true;
250 250
251 return false; 251 return false;
252 } 252 }
253*/ 253
254 protected override void AgentHasMovedAway(ScenePresence sp, bool logout) 254 protected override void AgentHasMovedAway(ScenePresence sp, bool logout)
255 { 255 {
256 base.AgentHasMovedAway(sp, logout); 256 base.AgentHasMovedAway(sp, logout);