diff options
author | Melanie | 2013-07-29 02:08:05 +0100 |
---|---|---|
committer | Melanie | 2013-07-29 02:08:05 +0100 |
commit | bf283208df4a6936de85b2746112bb568d9c9d25 (patch) | |
tree | dafe50ad8e55ac30c41f5e7ebd11992f2772c294 /OpenSim/Region/CoreModules/Framework | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Same issue. (diff) | |
download | opensim-SC_OLD-bf283208df4a6936de85b2746112bb568d9c9d25.zip opensim-SC_OLD-bf283208df4a6936de85b2746112bb568d9c9d25.tar.gz opensim-SC_OLD-bf283208df4a6936de85b2746112bb568d9c9d25.tar.bz2 opensim-SC_OLD-bf283208df4a6936de85b2746112bb568d9c9d25.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
OpenSim/Region/Framework/Scenes/Scene.cs
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework')
4 files changed, 229 insertions, 20 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs index 0c759df..de8925d 100644 --- a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs | |||
@@ -133,13 +133,9 @@ namespace OpenSim.Region.CoreModules.Framework | |||
133 | { | 133 | { |
134 | Caps oldCaps = m_capsObjects[circuitCode]; | 134 | Caps oldCaps = m_capsObjects[circuitCode]; |
135 | 135 | ||
136 | m_log.DebugFormat( | 136 | //m_log.WarnFormat( |
137 | "[CAPS]: Recreating caps for agent {0}. Old caps path {1}, new caps path {2}. ", | 137 | // "[CAPS]: Recreating caps for agent {0} in region {1}. Old caps path {2}, new caps path {3}. ", |
138 | agentId, oldCaps.CapsObjectPath, capsObjectPath); | 138 | // agentId, m_scene.RegionInfo.RegionName, oldCaps.CapsObjectPath, capsObjectPath); |
139 | // This should not happen. The caller code is confused. We need to fix that. | ||
140 | // CAPs can never be reregistered, or the client will be confused. | ||
141 | // Hence this return here. | ||
142 | //return; | ||
143 | } | 139 | } |
144 | 140 | ||
145 | caps = new Caps(MainServer.Instance, m_scene.RegionInfo.ExternalHostName, | 141 | caps = new Caps(MainServer.Instance, m_scene.RegionInfo.ExternalHostName, |
@@ -153,6 +149,7 @@ namespace OpenSim.Region.CoreModules.Framework | |||
153 | 149 | ||
154 | public void RemoveCaps(UUID agentId, uint circuitCode) | 150 | public void RemoveCaps(UUID agentId, uint circuitCode) |
155 | { | 151 | { |
152 | m_log.DebugFormat("[CAPS]: Remove caps for agent {0} in region {1}", agentId, m_scene.RegionInfo.RegionName); | ||
156 | lock (m_childrenSeeds) | 153 | lock (m_childrenSeeds) |
157 | { | 154 | { |
158 | if (m_childrenSeeds.ContainsKey(agentId)) | 155 | if (m_childrenSeeds.ContainsKey(agentId)) |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 29b4296..df95bf0 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -316,7 +316,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
316 | m_log.DebugFormat( | 316 | m_log.DebugFormat( |
317 | "[ENTITY TRANSFER MODULE]: Ignoring teleport request of {0} {1} to {2}@{3} - agent is already in transit.", | 317 | "[ENTITY TRANSFER MODULE]: Ignoring teleport request of {0} {1} to {2}@{3} - agent is already in transit.", |
318 | sp.Name, sp.UUID, position, regionHandle); | 318 | sp.Name, sp.UUID, position, regionHandle); |
319 | 319 | ||
320 | sp.ControllingClient.SendTeleportFailed("Slow down!"); | ||
320 | return; | 321 | return; |
321 | } | 322 | } |
322 | 323 | ||
@@ -921,13 +922,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
921 | 922 | ||
922 | if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) | 923 | if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) |
923 | { | 924 | { |
924 | // RED ALERT!!!! | 925 | // We need to delay here because Imprudence viewers, unlike v1 or v3, have a short (<200ms, <500ms) delay before |
925 | // PLEASE DO NOT DECREASE THIS WAIT TIME UNDER ANY CIRCUMSTANCES. | 926 | // they regard the new region as the current region after receiving the AgentMovementComplete |
926 | // THE VIEWERS SEEM TO NEED SOME TIME AFTER RECEIVING MoveAgentIntoRegion | 927 | // response. If close is sent before then, it will cause the viewer to quit instead. |
927 | // BEFORE THEY SETTLE IN THE NEW REGION. | 928 | // |
928 | // DECREASING THE WAIT TIME HERE WILL EITHER RESULT IN A VIEWER CRASH OR | 929 | // This sleep can be increased if necessary. However, whilst it's active, |
929 | // IN THE AVIE BEING PLACED IN INFINITY FOR A COUPLE OF SECONDS. | 930 | // an agent cannot teleport back to this region if it has teleported away. |
930 | Thread.Sleep(5000); | 931 | Thread.Sleep(2000); |
931 | 932 | ||
932 | sp.Scene.IncomingCloseAgent(sp.UUID, false); | 933 | sp.Scene.IncomingCloseAgent(sp.UUID, false); |
933 | } | 934 | } |
@@ -1045,21 +1046,33 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1045 | // Now let's make it officially a child agent | 1046 | // Now let's make it officially a child agent |
1046 | sp.MakeChildAgent(); | 1047 | sp.MakeChildAgent(); |
1047 | 1048 | ||
1048 | // OK, it got this agent. Let's close some child agents | ||
1049 | sp.CloseChildAgents(newRegionX, newRegionY); | ||
1050 | |||
1051 | // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone | 1049 | // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone |
1052 | 1050 | ||
1053 | if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) | 1051 | if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) |
1054 | { | 1052 | { |
1053 | sp.DoNotCloseAfterTeleport = false; | ||
1054 | |||
1055 | // RED ALERT!!!! | 1055 | // RED ALERT!!!! |
1056 | // PLEASE DO NOT DECREASE THIS WAIT TIME UNDER ANY CIRCUMSTANCES. | 1056 | // PLEASE DO NOT DECREASE THIS WAIT TIME UNDER ANY CIRCUMSTANCES. |
1057 | // THE VIEWERS SEEM TO NEED SOME TIME AFTER RECEIVING MoveAgentIntoRegion | 1057 | // THE VIEWERS SEEM TO NEED SOME TIME AFTER RECEIVING MoveAgentIntoRegion |
1058 | // BEFORE THEY SETTLE IN THE NEW REGION. | 1058 | // BEFORE THEY SETTLE IN THE NEW REGION. |
1059 | // DECREASING THE WAIT TIME HERE WILL EITHER RESULT IN A VIEWER CRASH OR | 1059 | // DECREASING THE WAIT TIME HERE WILL EITHER RESULT IN A VIEWER CRASH OR |
1060 | // IN THE AVIE BEING PLACED IN INFINITY FOR A COUPLE OF SECONDS. | 1060 | // IN THE AVIE BEING PLACED IN INFINITY FOR A COUPLE OF SECONDS. |
1061 | Thread.Sleep(5000); | 1061 | Thread.Sleep(15000); |
1062 | sp.Scene.IncomingCloseAgent(sp.UUID, false); | 1062 | |
1063 | if (!sp.DoNotCloseAfterTeleport) | ||
1064 | { | ||
1065 | // OK, it got this agent. Let's close everything | ||
1066 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Closing in agent {0} in region {1}", sp.Name, Scene.RegionInfo.RegionName); | ||
1067 | sp.CloseChildAgents(newRegionX, newRegionY); | ||
1068 | sp.Scene.IncomingCloseAgent(sp.UUID, false); | ||
1069 | |||
1070 | } | ||
1071 | else | ||
1072 | { | ||
1073 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Not closing agent {0}, user is back in {0}", sp.Name, Scene.RegionInfo.RegionName); | ||
1074 | sp.DoNotCloseAfterTeleport = false; | ||
1075 | } | ||
1063 | } | 1076 | } |
1064 | else | 1077 | else |
1065 | // now we have a child agent in this region. | 1078 | // now we have a child agent in this region. |
diff --git a/OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs b/OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs new file mode 100644 index 0000000..8838612 --- /dev/null +++ b/OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs | |||
@@ -0,0 +1,197 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | using System; | ||
28 | using System.Collections.Generic; | ||
29 | using System.IO; | ||
30 | using System.Reflection; | ||
31 | using System.Threading; | ||
32 | |||
33 | using OpenSim.Framework; | ||
34 | using OpenSim.Framework.Console; | ||
35 | using OpenSim.Framework.Monitoring; | ||
36 | using OpenSim.Region.ClientStack.LindenUDP; | ||
37 | using OpenSim.Region.Framework; | ||
38 | using OpenSim.Region.Framework.Interfaces; | ||
39 | using OpenSim.Region.Framework.Scenes; | ||
40 | using OpenSim.Services.Interfaces; | ||
41 | using OpenSim.Services.Connectors.Hypergrid; | ||
42 | |||
43 | using OpenMetaverse; | ||
44 | using OpenMetaverse.Packets; | ||
45 | using log4net; | ||
46 | using Nini.Config; | ||
47 | using Mono.Addins; | ||
48 | |||
49 | using DirFindFlags = OpenMetaverse.DirectoryManager.DirFindFlags; | ||
50 | |||
51 | namespace OpenSim.Region.CoreModules.Framework.Search | ||
52 | { | ||
53 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "BasicSearchModule")] | ||
54 | public class BasicSearchModule : ISharedRegionModule | ||
55 | { | ||
56 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
57 | |||
58 | protected bool m_Enabled; | ||
59 | protected List<Scene> m_Scenes = new List<Scene>(); | ||
60 | |||
61 | private IGroupsModule m_GroupsService = null; | ||
62 | |||
63 | #region ISharedRegionModule | ||
64 | |||
65 | public void Initialise(IConfigSource config) | ||
66 | { | ||
67 | string umanmod = config.Configs["Modules"].GetString("SearchModule", Name); | ||
68 | if (umanmod == Name) | ||
69 | { | ||
70 | m_Enabled = true; | ||
71 | m_log.DebugFormat("[BASIC SEARCH MODULE]: {0} is enabled", Name); | ||
72 | } | ||
73 | } | ||
74 | |||
75 | public bool IsSharedModule | ||
76 | { | ||
77 | get { return true; } | ||
78 | } | ||
79 | |||
80 | public virtual string Name | ||
81 | { | ||
82 | get { return "BasicSearchModule"; } | ||
83 | } | ||
84 | |||
85 | public Type ReplaceableInterface | ||
86 | { | ||
87 | get { return null; } | ||
88 | } | ||
89 | |||
90 | public void AddRegion(Scene scene) | ||
91 | { | ||
92 | if (m_Enabled) | ||
93 | { | ||
94 | m_Scenes.Add(scene); | ||
95 | |||
96 | scene.EventManager.OnMakeRootAgent += new Action<ScenePresence>(EventManager_OnMakeRootAgent); | ||
97 | scene.EventManager.OnMakeChildAgent += new EventManager.OnMakeChildAgentDelegate(EventManager_OnMakeChildAgent); | ||
98 | } | ||
99 | } | ||
100 | |||
101 | public void RemoveRegion(Scene scene) | ||
102 | { | ||
103 | if (m_Enabled) | ||
104 | { | ||
105 | m_Scenes.Remove(scene); | ||
106 | |||
107 | scene.EventManager.OnMakeRootAgent -= new Action<ScenePresence>(EventManager_OnMakeRootAgent); | ||
108 | scene.EventManager.OnMakeChildAgent -= new EventManager.OnMakeChildAgentDelegate(EventManager_OnMakeChildAgent); | ||
109 | } | ||
110 | } | ||
111 | |||
112 | public void RegionLoaded(Scene s) | ||
113 | { | ||
114 | if (!m_Enabled) | ||
115 | return; | ||
116 | |||
117 | if (m_GroupsService == null) | ||
118 | { | ||
119 | m_GroupsService = s.RequestModuleInterface<IGroupsModule>(); | ||
120 | |||
121 | // No Groups Service Connector, then group search won't work... | ||
122 | if (m_GroupsService == null) | ||
123 | m_log.Warn("[BASIC SEARCH MODULE]: Could not get IGroupsModule"); | ||
124 | } | ||
125 | } | ||
126 | |||
127 | public void PostInitialise() | ||
128 | { | ||
129 | } | ||
130 | |||
131 | public void Close() | ||
132 | { | ||
133 | m_Scenes.Clear(); | ||
134 | } | ||
135 | |||
136 | #endregion ISharedRegionModule | ||
137 | |||
138 | |||
139 | #region Event Handlers | ||
140 | |||
141 | void EventManager_OnMakeRootAgent(ScenePresence sp) | ||
142 | { | ||
143 | sp.ControllingClient.OnDirFindQuery += OnDirFindQuery; | ||
144 | } | ||
145 | |||
146 | void EventManager_OnMakeChildAgent(ScenePresence sp) | ||
147 | { | ||
148 | sp.ControllingClient.OnDirFindQuery -= OnDirFindQuery; | ||
149 | } | ||
150 | |||
151 | void OnDirFindQuery(IClientAPI remoteClient, UUID queryID, string queryText, uint queryFlags, int queryStart) | ||
152 | { | ||
153 | if (((DirFindFlags)queryFlags & DirFindFlags.People) == DirFindFlags.People) | ||
154 | { | ||
155 | if (string.IsNullOrEmpty(queryText)) | ||
156 | remoteClient.SendDirPeopleReply(queryID, new DirPeopleReplyData[0]); | ||
157 | |||
158 | List<UserAccount> accounts = m_Scenes[0].UserAccountService.GetUserAccounts(m_Scenes[0].RegionInfo.ScopeID, queryText); | ||
159 | DirPeopleReplyData[] hits = new DirPeopleReplyData[accounts.Count]; | ||
160 | int i = 0; | ||
161 | foreach (UserAccount acc in accounts) | ||
162 | { | ||
163 | DirPeopleReplyData d = new DirPeopleReplyData(); | ||
164 | d.agentID = acc.PrincipalID; | ||
165 | d.firstName = acc.FirstName; | ||
166 | d.lastName = acc.LastName; | ||
167 | d.online = false; | ||
168 | |||
169 | hits[i++] = d; | ||
170 | } | ||
171 | |||
172 | // TODO: This currently ignores pretty much all the query flags including Mature and sort order | ||
173 | remoteClient.SendDirPeopleReply(queryID, hits); | ||
174 | } | ||
175 | else if (((DirFindFlags)queryFlags & DirFindFlags.Groups) == DirFindFlags.Groups) | ||
176 | { | ||
177 | if (m_GroupsService == null) | ||
178 | { | ||
179 | m_log.Warn("[BASIC SEARCH MODULE]: Groups service is not available. Unable to search groups."); | ||
180 | remoteClient.SendAlertMessage("Groups search is not enabled"); | ||
181 | return; | ||
182 | } | ||
183 | |||
184 | if (string.IsNullOrEmpty(queryText)) | ||
185 | remoteClient.SendDirGroupsReply(queryID, new DirGroupsReplyData[0]); | ||
186 | |||
187 | // TODO: This currently ignores pretty much all the query flags including Mature and sort order | ||
188 | remoteClient.SendDirGroupsReply(queryID, m_GroupsService.FindGroups(remoteClient, queryText).ToArray()); | ||
189 | } | ||
190 | |||
191 | } | ||
192 | |||
193 | #endregion Event Handlers | ||
194 | |||
195 | } | ||
196 | |||
197 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index 53bd2e2..7adb203 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | |||
@@ -46,6 +46,8 @@ using log4net; | |||
46 | using Nini.Config; | 46 | using Nini.Config; |
47 | using Mono.Addins; | 47 | using Mono.Addins; |
48 | 48 | ||
49 | using DirFindFlags = OpenMetaverse.DirectoryManager.DirFindFlags; | ||
50 | |||
49 | namespace OpenSim.Region.CoreModules.Framework.UserManagement | 51 | namespace OpenSim.Region.CoreModules.Framework.UserManagement |
50 | { | 52 | { |
51 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "UserManagementModule")] | 53 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "UserManagementModule")] |