diff options
author | Justin Clark-Casey (justincc) | 2011-08-09 23:11:07 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-08-09 23:11:07 +0100 |
commit | 92e96d394a1712ed16b0a7835dd2ccfde01f3fee (patch) | |
tree | 434727add1ec2fb9806297027bba5a3dbcede4c3 /OpenSim/Region | |
parent | Add osOwnerSaveAppearance() to help with setting up NPC appearances. Not yet... (diff) | |
download | opensim-SC_OLD-92e96d394a1712ed16b0a7835dd2ccfde01f3fee.zip opensim-SC_OLD-92e96d394a1712ed16b0a7835dd2ccfde01f3fee.tar.gz opensim-SC_OLD-92e96d394a1712ed16b0a7835dd2ccfde01f3fee.tar.bz2 opensim-SC_OLD-92e96d394a1712ed16b0a7835dd2ccfde01f3fee.tar.xz |
When an NPC is created, stop telling neighbouring regions to expect a child agent
Diffstat (limited to 'OpenSim/Region')
7 files changed, 23 insertions, 25 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 4a36b5d..46d7f78 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -90,7 +90,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
90 | public event ObjectAttach OnObjectAttach; | 90 | public event ObjectAttach OnObjectAttach; |
91 | public event ObjectDeselect OnObjectDetach; | 91 | public event ObjectDeselect OnObjectDetach; |
92 | public event ObjectDrop OnObjectDrop; | 92 | public event ObjectDrop OnObjectDrop; |
93 | public event GenericCall1 OnCompleteMovementToRegion; | 93 | public event Action<IClientAPI, bool> OnCompleteMovementToRegion; |
94 | public event UpdateAgent OnPreAgentUpdate; | 94 | public event UpdateAgent OnPreAgentUpdate; |
95 | public event UpdateAgent OnAgentUpdate; | 95 | public event UpdateAgent OnAgentUpdate; |
96 | public event AgentRequestSit OnAgentRequestSit; | 96 | public event AgentRequestSit OnAgentRequestSit; |
@@ -6195,10 +6195,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6195 | 6195 | ||
6196 | private bool HandleCompleteAgentMovement(IClientAPI sender, Packet Pack) | 6196 | private bool HandleCompleteAgentMovement(IClientAPI sender, Packet Pack) |
6197 | { | 6197 | { |
6198 | GenericCall1 handlerCompleteMovementToRegion = OnCompleteMovementToRegion; | 6198 | Action<IClientAPI, bool> handlerCompleteMovementToRegion = OnCompleteMovementToRegion; |
6199 | if (handlerCompleteMovementToRegion != null) | 6199 | if (handlerCompleteMovementToRegion != null) |
6200 | { | 6200 | { |
6201 | handlerCompleteMovementToRegion(sender); | 6201 | handlerCompleteMovementToRegion(sender, true); |
6202 | } | 6202 | } |
6203 | handlerCompleteMovementToRegion = null; | 6203 | handlerCompleteMovementToRegion = null; |
6204 | 6204 | ||
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 457ee33..f5d49c5 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -1065,10 +1065,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1065 | #endregion | 1065 | #endregion |
1066 | 1066 | ||
1067 | #region Enable Child Agent | 1067 | #region Enable Child Agent |
1068 | |||
1068 | /// <summary> | 1069 | /// <summary> |
1069 | /// This informs a single neighbouring region about agent "avatar". | 1070 | /// This informs a single neighbouring region about agent "avatar". |
1070 | /// Calls an asynchronous method to do so.. so it doesn't lag the sim. | 1071 | /// Calls an asynchronous method to do so.. so it doesn't lag the sim. |
1071 | /// </summary> | 1072 | /// </summary> |
1073 | /// <param name="sp"></param> | ||
1074 | /// <param name="region"></param> | ||
1072 | public void EnableChildAgent(ScenePresence sp, GridRegion region) | 1075 | public void EnableChildAgent(ScenePresence sp, GridRegion region) |
1073 | { | 1076 | { |
1074 | m_log.DebugFormat("[ENTITY TRANSFER]: Enabling child agent in new neighbour {0}", region.RegionName); | 1077 | m_log.DebugFormat("[ENTITY TRANSFER]: Enabling child agent in new neighbour {0}", region.RegionName); |
@@ -1126,6 +1129,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1126 | /// This informs all neighbouring regions about agent "avatar". | 1129 | /// This informs all neighbouring regions about agent "avatar". |
1127 | /// Calls an asynchronous method to do so.. so it doesn't lag the sim. | 1130 | /// Calls an asynchronous method to do so.. so it doesn't lag the sim. |
1128 | /// </summary> | 1131 | /// </summary> |
1132 | /// <param name="sp"></param> | ||
1129 | public void EnableChildAgents(ScenePresence sp) | 1133 | public void EnableChildAgents(ScenePresence sp) |
1130 | { | 1134 | { |
1131 | List<GridRegion> neighbours = new List<GridRegion>(); | 1135 | List<GridRegion> neighbours = new List<GridRegion>(); |
@@ -1312,7 +1316,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1312 | Utils.LongToUInts(reg.RegionHandle, out x, out y); | 1316 | Utils.LongToUInts(reg.RegionHandle, out x, out y); |
1313 | x = x / Constants.RegionSize; | 1317 | x = x / Constants.RegionSize; |
1314 | y = y / Constants.RegionSize; | 1318 | y = y / Constants.RegionSize; |
1315 | m_log.Debug("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint.ToString() + ")"); | 1319 | m_log.Debug("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint + ")"); |
1316 | 1320 | ||
1317 | string capsPath = reg.ServerURI + CapsUtil.GetCapsSeedPath(a.CapsPath); | 1321 | string capsPath = reg.ServerURI + CapsUtil.GetCapsSeedPath(a.CapsPath); |
1318 | 1322 | ||
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 4f58ab0..08023b8 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | |||
@@ -83,7 +83,7 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
83 | public event DeRezObject OnDeRezObject; | 83 | public event DeRezObject OnDeRezObject; |
84 | public event Action<IClientAPI> OnRegionHandShakeReply; | 84 | public event Action<IClientAPI> OnRegionHandShakeReply; |
85 | public event GenericCall1 OnRequestWearables; | 85 | public event GenericCall1 OnRequestWearables; |
86 | public event GenericCall1 OnCompleteMovementToRegion; | 86 | public event Action<IClientAPI, bool> OnCompleteMovementToRegion; |
87 | public event UpdateAgent OnPreAgentUpdate; | 87 | public event UpdateAgent OnPreAgentUpdate; |
88 | public event UpdateAgent OnAgentUpdate; | 88 | public event UpdateAgent OnAgentUpdate; |
89 | public event AgentRequestSit OnAgentRequestSit; | 89 | public event AgentRequestSit OnAgentRequestSit; |
@@ -663,7 +663,7 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
663 | 663 | ||
664 | if (OnCompleteMovementToRegion != null) | 664 | if (OnCompleteMovementToRegion != null) |
665 | { | 665 | { |
666 | OnCompleteMovementToRegion(this); | 666 | OnCompleteMovementToRegion(this, true); |
667 | } | 667 | } |
668 | } | 668 | } |
669 | public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID) | 669 | public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID) |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index cd5228d..af28dd9 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1144,10 +1144,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1144 | 1144 | ||
1145 | /// <summary> | 1145 | /// <summary> |
1146 | /// Complete Avatar's movement into the region. | 1146 | /// Complete Avatar's movement into the region. |
1147 | /// This is called upon a very important packet sent from the client, | ||
1148 | /// so it's client-controlled. Never call this method directly. | ||
1149 | /// </summary> | 1147 | /// </summary> |
1150 | public void CompleteMovement(IClientAPI client) | 1148 | /// <param name="client"></param> |
1149 | /// <param name="enableNeighbourChildAgents"> | ||
1150 | /// If true, send notification to neighbour regions to expect | ||
1151 | /// a child agent from the client. These neighbours can be some distance away, depending right now on the | ||
1152 | /// configuration of DefaultDrawDistance in the [Startup] section of config | ||
1153 | /// </param> | ||
1154 | public void CompleteMovement(IClientAPI client, bool enableNeighbourChildAgents) | ||
1151 | { | 1155 | { |
1152 | // DateTime startTime = DateTime.Now; | 1156 | // DateTime startTime = DateTime.Now; |
1153 | 1157 | ||
@@ -1188,7 +1192,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1188 | SendInitialData(); | 1192 | SendInitialData(); |
1189 | 1193 | ||
1190 | // Create child agents in neighbouring regions | 1194 | // Create child agents in neighbouring regions |
1191 | if (!m_isChildAgent) | 1195 | if (enableNeighbourChildAgents && !m_isChildAgent) |
1192 | { | 1196 | { |
1193 | IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>(); | 1197 | IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>(); |
1194 | if (m_agentTransfer != null) | 1198 | if (m_agentTransfer != null) |
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index a0c1ab1..8ebf9cb 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs | |||
@@ -677,7 +677,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
677 | public event DeRezObject OnDeRezObject; | 677 | public event DeRezObject OnDeRezObject; |
678 | public event Action<IClientAPI> OnRegionHandShakeReply; | 678 | public event Action<IClientAPI> OnRegionHandShakeReply; |
679 | public event GenericCall1 OnRequestWearables; | 679 | public event GenericCall1 OnRequestWearables; |
680 | public event GenericCall1 OnCompleteMovementToRegion; | 680 | public event Action<IClientAPI, bool> OnCompleteMovementToRegion; |
681 | public event UpdateAgent OnPreAgentUpdate; | 681 | public event UpdateAgent OnPreAgentUpdate; |
682 | public event UpdateAgent OnAgentUpdate; | 682 | public event UpdateAgent OnAgentUpdate; |
683 | public event AgentRequestSit OnAgentRequestSit; | 683 | public event AgentRequestSit OnAgentRequestSit; |
@@ -913,7 +913,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
913 | 913 | ||
914 | if (OnCompleteMovementToRegion != null) | 914 | if (OnCompleteMovementToRegion != null) |
915 | { | 915 | { |
916 | OnCompleteMovementToRegion(this); | 916 | OnCompleteMovementToRegion(this, true); |
917 | } | 917 | } |
918 | } | 918 | } |
919 | 919 | ||
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index dfc624d..b3e2495 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -190,7 +190,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
190 | public event DeRezObject OnDeRezObject; | 190 | public event DeRezObject OnDeRezObject; |
191 | public event Action<IClientAPI> OnRegionHandShakeReply; | 191 | public event Action<IClientAPI> OnRegionHandShakeReply; |
192 | public event GenericCall1 OnRequestWearables; | 192 | public event GenericCall1 OnRequestWearables; |
193 | public event GenericCall1 OnCompleteMovementToRegion; | 193 | public event Action<IClientAPI, bool> OnCompleteMovementToRegion; |
194 | public event UpdateAgent OnPreAgentUpdate; | 194 | public event UpdateAgent OnPreAgentUpdate; |
195 | public event UpdateAgent OnAgentUpdate; | 195 | public event UpdateAgent OnAgentUpdate; |
196 | public event AgentRequestSit OnAgentRequestSit; | 196 | public event AgentRequestSit OnAgentRequestSit; |
@@ -745,12 +745,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
745 | { | 745 | { |
746 | OnRegionHandShakeReply(this); | 746 | OnRegionHandShakeReply(this); |
747 | } | 747 | } |
748 | |||
749 | if (OnCompleteMovementToRegion != null) | ||
750 | { | ||
751 | OnCompleteMovementToRegion(this); | ||
752 | } | ||
753 | } | 748 | } |
749 | |||
754 | public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID) | 750 | public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID) |
755 | { | 751 | { |
756 | } | 752 | } |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index d966345..88867f2 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | |||
@@ -201,13 +201,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
201 | m_log.DebugFormat( | 201 | m_log.DebugFormat( |
202 | "[NPC MODULE]: Successfully retrieved scene presence for NPC {0} {1}", sp.Name, sp.UUID); | 202 | "[NPC MODULE]: Successfully retrieved scene presence for NPC {0} {1}", sp.Name, sp.UUID); |
203 | 203 | ||
204 | // Shouldn't call this - temporary. | 204 | sp.CompleteMovement(npcAvatar, false); |
205 | sp.CompleteMovement(npcAvatar); | ||
206 | |||
207 | // sp.SendAppearanceToAllOtherAgents(); | ||
208 | // | ||
209 | // // Send animations back to the avatar as well | ||
210 | // sp.Animator.SendAnimPack(); | ||
211 | } | 205 | } |
212 | else | 206 | else |
213 | { | 207 | { |