diff options
author | UbitUmarov | 2014-08-28 00:44:59 +0100 |
---|---|---|
committer | UbitUmarov | 2014-08-28 00:44:59 +0100 |
commit | 38fc1cc4452a29fe552efcfbda95cb0eabb0e082 (patch) | |
tree | fb0a89ab35ae83e51d9d373a5bbe328fd642b114 /OpenSim | |
parent | dont create a cadu that is not used. Add a root region global position (diff) | |
download | opensim-SC_OLD-38fc1cc4452a29fe552efcfbda95cb0eabb0e082.zip opensim-SC_OLD-38fc1cc4452a29fe552efcfbda95cb0eabb0e082.tar.gz opensim-SC_OLD-38fc1cc4452a29fe552efcfbda95cb0eabb0e082.tar.bz2 opensim-SC_OLD-38fc1cc4452a29fe552efcfbda95cb0eabb0e082.tar.xz |
try to make child presence know its root region. Incomplete, some paths dont send the information.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 12 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 46 |
2 files changed, 15 insertions, 43 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index b3e556f..4be265a 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -990,7 +990,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
990 | sp.HasMovedAway(nearRegion); | 990 | sp.HasMovedAway(nearRegion); |
991 | 991 | ||
992 | // Now let's make it officially a child agent | 992 | // Now let's make it officially a child agent |
993 | sp.MakeChildAgent(); | 993 | sp.MakeChildAgent(destinationHandle); |
994 | 994 | ||
995 | // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone | 995 | // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone |
996 | 996 | ||
@@ -1009,11 +1009,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1009 | 1009 | ||
1010 | sp.Scene.CloseAgent(sp.UUID, false); | 1010 | sp.Scene.CloseAgent(sp.UUID, false); |
1011 | } | 1011 | } |
1012 | /* | ||
1012 | else | 1013 | else |
1013 | { | 1014 | { |
1014 | // now we have a child agent in this region. | 1015 | // now we have a child agent in this region. |
1015 | sp.Reset(); | 1016 | sp.Reset(); |
1016 | } | 1017 | } |
1018 | */ | ||
1017 | } | 1019 | } |
1018 | 1020 | ||
1019 | private void TransferAgent_V2(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination, | 1021 | private void TransferAgent_V2(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination, |
@@ -1158,7 +1160,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1158 | // KillEntity(sp.Scene, sp.LocalId); | 1160 | // KillEntity(sp.Scene, sp.LocalId); |
1159 | 1161 | ||
1160 | // Now let's make it officially a child agent | 1162 | // Now let's make it officially a child agent |
1161 | sp.MakeChildAgent(); | 1163 | sp.MakeChildAgent(destinationHandle); |
1162 | 1164 | ||
1163 | // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone | 1165 | // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone |
1164 | if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) | 1166 | if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) |
@@ -1182,11 +1184,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1182 | 1184 | ||
1183 | sp.Scene.CloseAgent(sp.UUID, false); | 1185 | sp.Scene.CloseAgent(sp.UUID, false); |
1184 | } | 1186 | } |
1187 | /* | ||
1185 | else | 1188 | else |
1186 | { | 1189 | { |
1187 | // now we have a child agent in this region. | 1190 | // now we have a child agent in this region. |
1188 | sp.Reset(); | 1191 | sp.Reset(); |
1189 | } | 1192 | } |
1193 | */ | ||
1190 | } | 1194 | } |
1191 | 1195 | ||
1192 | /// <summary> | 1196 | /// <summary> |
@@ -1792,7 +1796,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1792 | 1796 | ||
1793 | // AgentHasMovedAway(agent, true); | 1797 | // AgentHasMovedAway(agent, true); |
1794 | 1798 | ||
1795 | agent.MakeChildAgent(); | 1799 | agent.MakeChildAgent(neighbourRegion.RegionHandle); |
1796 | 1800 | ||
1797 | // FIXME: Possibly this should occur lower down after other commands to close other agents, | 1801 | // FIXME: Possibly this should occur lower down after other commands to close other agents, |
1798 | // but not sure yet what the side effects would be. | 1802 | // but not sure yet what the side effects would be. |
@@ -1869,7 +1873,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1869 | AgentCircuitData agent = sp.ControllingClient.RequestClientInfo(); | 1873 | AgentCircuitData agent = sp.ControllingClient.RequestClientInfo(); |
1870 | agent.BaseFolder = UUID.Zero; | 1874 | agent.BaseFolder = UUID.Zero; |
1871 | agent.InventoryFolder = UUID.Zero; | 1875 | agent.InventoryFolder = UUID.Zero; |
1872 | agent.startpos = new Vector3(128, 128, 70); | 1876 | agent.startpos = sp.AbsolutePosition + CalculateOffset(sp, region); |
1873 | agent.child = true; | 1877 | agent.child = true; |
1874 | 1878 | ||
1875 | agent.Appearance = new AvatarAppearance(); | 1879 | agent.Appearance = new AvatarAppearance(); |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index f2353b9..47acb0b 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1162,45 +1162,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1162 | 1162 | ||
1163 | m_scene.EventManager.TriggerSetRootAgentScene(m_uuid, m_scene); | 1163 | m_scene.EventManager.TriggerSetRootAgentScene(m_uuid, m_scene); |
1164 | 1164 | ||
1165 | /* this should be done by groups module on TriggerOnMakeRootAgent(this) below | ||
1166 | at least XmlIRpcGroups | ||
1167 | UUID groupUUID = UUID.Zero; | ||
1168 | string GroupName = string.Empty; | ||
1169 | ulong groupPowers = 0; | ||
1170 | 1165 | ||
1171 | |||
1172 | |||
1173 | |||
1174 | // ---------------------------------- | ||
1175 | // Previous Agent Difference - AGNI sends an unsolicited AgentDataUpdate upon root agent status | ||
1176 | try | ||
1177 | { | ||
1178 | |||
1179 | if (gm != null) | ||
1180 | { | ||
1181 | groupUUID = ControllingClient.ActiveGroupId; | ||
1182 | GroupRecord record = gm.GetGroupRecord(groupUUID); | ||
1183 | if (record != null) | ||
1184 | GroupName = record.GroupName; | ||
1185 | GroupMembershipData groupMembershipData = gm.GetMembershipData(groupUUID, m_uuid); | ||
1186 | if (groupMembershipData != null) | ||
1187 | groupPowers = groupMembershipData.GroupPowers; | ||
1188 | } | ||
1189 | ControllingClient.SendAgentDataUpdate(m_uuid, groupUUID, Firstname, Lastname, groupPowers, GroupName, | ||
1190 | Grouptitle); | ||
1191 | } | ||
1192 | catch (Exception e) | ||
1193 | { | ||
1194 | m_log.Debug("[AGENTUPDATE]: " + e.ToString()); | ||
1195 | } | ||
1196 | // ------------------------------------ | ||
1197 | */ | ||
1198 | if (ParentID == 0) | 1166 | if (ParentID == 0) |
1199 | { | 1167 | { |
1200 | // Moved this from SendInitialData to ensure that Appearance is initialized | ||
1201 | // before the inventory is processed in MakeRootAgent. This fixes a race condition | ||
1202 | // related to the handling of attachments | ||
1203 | |||
1204 | if (m_scene.TestBorderCross(pos, Cardinals.E)) | 1168 | if (m_scene.TestBorderCross(pos, Cardinals.E)) |
1205 | { | 1169 | { |
1206 | Border crossedBorder = m_scene.GetCrossedBorder(pos, Cardinals.E); | 1170 | Border crossedBorder = m_scene.GetCrossedBorder(pos, Cardinals.E); |
@@ -1310,11 +1274,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1310 | /// It doesn't get called for a teleport. Reason being, an agent that | 1274 | /// It doesn't get called for a teleport. Reason being, an agent that |
1311 | /// teleports out may not end up anywhere near this region | 1275 | /// teleports out may not end up anywhere near this region |
1312 | /// </remarks> | 1276 | /// </remarks> |
1313 | public void MakeChildAgent() | 1277 | public void MakeChildAgent(ulong newRegionHandle) |
1314 | { | 1278 | { |
1315 | m_scene.EventManager.OnRegionHeartbeatEnd -= RegionHeartbeatEnd; | 1279 | m_scene.EventManager.OnRegionHeartbeatEnd -= RegionHeartbeatEnd; |
1316 | 1280 | ||
1317 | m_log.DebugFormat("[SCENE PRESENCE]: Making {0} a child agent in {1}", Name, Scene.RegionInfo.RegionName); | 1281 | RegionHandle = newRegionHandle; |
1282 | |||
1283 | m_log.DebugFormat("[SCENE PRESENCE]: Making {0} a child agent in {1} from root region {2}", | ||
1284 | Name, Scene.RegionInfo.RegionName, newRegionHandle); | ||
1318 | 1285 | ||
1319 | // Reset the m_originRegionID as it has dual use as a flag to signal that the UpdateAgent() call orignating | 1286 | // Reset the m_originRegionID as it has dual use as a flag to signal that the UpdateAgent() call orignating |
1320 | // from the source simulator has completed on a V2 teleport. | 1287 | // from the source simulator has completed on a V2 teleport. |
@@ -4023,6 +3990,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4023 | 3990 | ||
4024 | } | 3991 | } |
4025 | 3992 | ||
3993 | /* useless. Either use MakeChild or delete the presence | ||
4026 | public void Reset() | 3994 | public void Reset() |
4027 | { | 3995 | { |
4028 | // m_log.DebugFormat("[SCENE PRESENCE]: Resetting {0} in {1}", Name, Scene.RegionInfo.RegionName); | 3996 | // m_log.DebugFormat("[SCENE PRESENCE]: Resetting {0} in {1}", Name, Scene.RegionInfo.RegionName); |
@@ -4033,7 +4001,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4033 | 4001 | ||
4034 | Animator.ResetAnimations(); | 4002 | Animator.ResetAnimations(); |
4035 | } | 4003 | } |
4036 | 4004 | */ | |
4037 | /// <summary> | 4005 | /// <summary> |
4038 | /// Computes which child agents to close when the scene presence moves to another region. | 4006 | /// Computes which child agents to close when the scene presence moves to another region. |
4039 | /// Removes those regions from m_knownRegions. | 4007 | /// Removes those regions from m_knownRegions. |