aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs41
1 files changed, 41 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
index 53bd2e2..295ad64 100644
--- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
@@ -46,6 +46,8 @@ using log4net;
46using Nini.Config; 46using Nini.Config;
47using Mono.Addins; 47using Mono.Addins;
48 48
49using DirFindFlags = OpenMetaverse.DirectoryManager.DirFindFlags;
50
49namespace OpenSim.Region.CoreModules.Framework.UserManagement 51namespace 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")]
@@ -98,6 +100,8 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
98 scene.RegisterModuleInterface<IPeople>(this); 100 scene.RegisterModuleInterface<IPeople>(this);
99 scene.EventManager.OnNewClient += new EventManager.OnNewClientDelegate(EventManager_OnNewClient); 101 scene.EventManager.OnNewClient += new EventManager.OnNewClientDelegate(EventManager_OnNewClient);
100 scene.EventManager.OnPrimsLoaded += new EventManager.PrimsLoaded(EventManager_OnPrimsLoaded); 102 scene.EventManager.OnPrimsLoaded += new EventManager.PrimsLoaded(EventManager_OnPrimsLoaded);
103 scene.EventManager.OnMakeRootAgent += new Action<ScenePresence>(EventManager_OnMakeRootAgent);
104 scene.EventManager.OnMakeChildAgent += new EventManager.OnMakeChildAgentDelegate(EventManager_OnMakeChildAgent);
101 } 105 }
102 } 106 }
103 107
@@ -153,6 +157,43 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
153 client.OnAvatarPickerRequest -= new AvatarPickerRequest(HandleAvatarPickerRequest); 157 client.OnAvatarPickerRequest -= new AvatarPickerRequest(HandleAvatarPickerRequest);
154 } 158 }
155 159
160 void EventManager_OnMakeRootAgent(ScenePresence sp)
161 {
162 sp.ControllingClient.OnDirFindQuery += OnDirFindQuery;
163 }
164
165 void EventManager_OnMakeChildAgent(ScenePresence sp)
166 {
167 sp.ControllingClient.OnDirFindQuery -= OnDirFindQuery;
168 }
169
170 void OnDirFindQuery(IClientAPI remoteClient, UUID queryID, string queryText, uint queryFlags, int queryStart)
171 {
172 if (((DirFindFlags)queryFlags & DirFindFlags.People) == DirFindFlags.People)
173 {
174 if (string.IsNullOrEmpty(queryText))
175 remoteClient.SendDirPeopleReply(queryID, new DirPeopleReplyData[0]);
176
177 List<UserAccount> accounts = m_Scenes[0].UserAccountService.GetUserAccounts(m_Scenes[0].RegionInfo.ScopeID, queryText);
178 DirPeopleReplyData[] hits = new DirPeopleReplyData[accounts.Count];
179 int i = 0;
180 foreach (UserAccount acc in accounts)
181 {
182 DirPeopleReplyData d = new DirPeopleReplyData();
183 d.agentID = acc.PrincipalID;
184 d.firstName = acc.FirstName;
185 d.lastName = acc.LastName;
186 d.online = false;
187
188 hits[i++] = d;
189 }
190
191 // TODO: This currently ignores pretty much all the query flags including Mature and sort order
192 remoteClient.SendDirPeopleReply(queryID, hits);
193 }
194
195 }
196
156 void HandleUUIDNameRequest(UUID uuid, IClientAPI client) 197 void HandleUUIDNameRequest(UUID uuid, IClientAPI client)
157 { 198 {
158// m_log.DebugFormat( 199// m_log.DebugFormat(