aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorDiva Canto2013-05-28 20:59:54 -0700
committerDiva Canto2013-05-28 20:59:54 -0700
commit233b9ec4d7739f324360366079469f2026c4ce41 (patch)
tree61266ac4ceffef23a74bad1dbd15bbe4fd103f82 /OpenSim/Region/CoreModules
parentFirst change in Vivox for ages! -- added a lock to serialize calls to vivox s... (diff)
parentBulletSim: don't zero motion when changing vehicle type. (diff)
downloadopensim-SC-233b9ec4d7739f324360366079469f2026c4ce41.zip
opensim-SC-233b9ec4d7739f324360366079469f2026c4ce41.tar.gz
opensim-SC-233b9ec4d7739f324360366079469f2026c4ce41.tar.bz2
opensim-SC-233b9ec4d7739f324360366079469f2026c4ce41.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs105
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs123
-rw-r--r--OpenSim/Region/CoreModules/World/Sound/SoundModule.cs9
6 files changed, 162 insertions, 83 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index b640b48..aea768e 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -147,7 +147,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
147 /// <param name="visualParam"></param> 147 /// <param name="visualParam"></param>
148 public void SetAppearance(IScenePresence sp, AvatarAppearance appearance) 148 public void SetAppearance(IScenePresence sp, AvatarAppearance appearance)
149 { 149 {
150 SetAppearance(sp, appearance.Texture, appearance.VisualParams); 150 DoSetAppearance(sp, appearance.Texture, appearance.VisualParams, new List<CachedTextureRequestArg>());
151 } 151 }
152 152
153 /// <summary> 153 /// <summary>
@@ -158,9 +158,20 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
158 /// <param name="visualParam"></param> 158 /// <param name="visualParam"></param>
159 public void SetAppearance(IScenePresence sp, Primitive.TextureEntry textureEntry, byte[] visualParams) 159 public void SetAppearance(IScenePresence sp, Primitive.TextureEntry textureEntry, byte[] visualParams)
160 { 160 {
161// m_log.DebugFormat( 161 DoSetAppearance(sp, textureEntry, visualParams, new List<CachedTextureRequestArg>());
162// "[AVFACTORY]: start SetAppearance for {0}, te {1}, visualParams {2}", 162 }
163// sp.Name, textureEntry, visualParams); 163
164 /// <summary>
165 /// Set appearance data (texture asset IDs and slider settings)
166 /// </summary>
167 /// <param name="sp"></param>
168 /// <param name="texture"></param>
169 /// <param name="visualParam"></param>
170 protected void DoSetAppearance(IScenePresence sp, Primitive.TextureEntry textureEntry, byte[] visualParams, List<CachedTextureRequestArg> hashes)
171 {
172 // m_log.DebugFormat(
173 // "[AVFACTORY]: start SetAppearance for {0}, te {1}, visualParams {2}",
174 // sp.Name, textureEntry, visualParams);
164 175
165 // TODO: This is probably not necessary any longer, just assume the 176 // TODO: This is probably not necessary any longer, just assume the
166 // textureEntry set implies that the appearance transaction is complete 177 // textureEntry set implies that the appearance transaction is complete
@@ -190,18 +201,25 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
190 // Process the baked texture array 201 // Process the baked texture array
191 if (textureEntry != null) 202 if (textureEntry != null)
192 { 203 {
193// m_log.DebugFormat("[AVFACTORY]: Received texture update for {0} {1}", sp.Name, sp.UUID); 204 // m_log.DebugFormat("[AVFACTORY]: Received texture update for {0} {1}", sp.Name, sp.UUID);
194 205 // WriteBakedTexturesReport(sp, m_log.DebugFormat);
195// WriteBakedTexturesReport(sp, m_log.DebugFormat);
196 206
197 changed = sp.Appearance.SetTextureEntries(textureEntry) || changed; 207 changed = sp.Appearance.SetTextureEntries(textureEntry) || changed;
198 208
199// WriteBakedTexturesReport(sp, m_log.DebugFormat); 209 // WriteBakedTexturesReport(sp, m_log.DebugFormat);
200 210
201 // If bake textures are missing and this is not an NPC, request a rebake from client 211 // If bake textures are missing and this is not an NPC, request a rebake from client
202 if (!ValidateBakedTextureCache(sp) && (((ScenePresence)sp).PresenceType != PresenceType.Npc)) 212 if (!ValidateBakedTextureCache(sp) && (((ScenePresence)sp).PresenceType != PresenceType.Npc))
203 RequestRebake(sp, true); 213 RequestRebake(sp, true);
204 214
215 // Save the wearble hashes in the appearance
216 sp.Appearance.ResetTextureHashes();
217 if (m_reusetextures)
218 {
219 foreach (CachedTextureRequestArg arg in hashes)
220 sp.Appearance.SetTextureHash(arg.BakedTextureIndex,arg.WearableHashID);
221 }
222
205 // This appears to be set only in the final stage of the appearance 223 // This appears to be set only in the final stage of the appearance
206 // update transaction. In theory, we should be able to do an immediate 224 // update transaction. In theory, we should be able to do an immediate
207 // appearance send and save here. 225 // appearance send and save here.
@@ -235,13 +253,13 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
235 253
236 public bool SendAppearance(UUID agentId) 254 public bool SendAppearance(UUID agentId)
237 { 255 {
238// m_log.DebugFormat("[AVFACTORY]: Sending appearance for {0}", agentId); 256 // m_log.DebugFormat("[AVFACTORY]: Sending appearance for {0}", agentId);
239 257
240 ScenePresence sp = m_scene.GetScenePresence(agentId); 258 ScenePresence sp = m_scene.GetScenePresence(agentId);
241 if (sp == null) 259 if (sp == null)
242 { 260 {
243 // This is expected if the user has gone away. 261 // This is expected if the user has gone away.
244// m_log.DebugFormat("[AVFACTORY]: Agent {0} no longer in the scene", agentId); 262 // m_log.DebugFormat("[AVFACTORY]: Agent {0} no longer in the scene", agentId);
245 return false; 263 return false;
246 } 264 }
247 265
@@ -318,7 +336,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
318 /// <param name="agentId"></param> 336 /// <param name="agentId"></param>
319 public void QueueAppearanceSend(UUID agentid) 337 public void QueueAppearanceSend(UUID agentid)
320 { 338 {
321// m_log.DebugFormat("[AVFACTORY]: Queue appearance send for {0}", agentid); 339 // m_log.DebugFormat("[AVFACTORY]: Queue appearance send for {0}", agentid);
322 340
323 // 10000 ticks per millisecond, 1000 milliseconds per second 341 // 10000 ticks per millisecond, 1000 milliseconds per second
324 long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_sendtime * 1000 * 10000); 342 long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_sendtime * 1000 * 10000);
@@ -331,7 +349,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
331 349
332 public void QueueAppearanceSave(UUID agentid) 350 public void QueueAppearanceSave(UUID agentid)
333 { 351 {
334// m_log.DebugFormat("[AVFACTORY]: Queueing appearance save for {0}", agentid); 352 // m_log.DebugFormat("[AVFACTORY]: Queueing appearance save for {0}", agentid);
335 353
336 // 10000 ticks per millisecond, 1000 milliseconds per second 354 // 10000 ticks per millisecond, 1000 milliseconds per second
337 long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_savetime * 1000 * 10000); 355 long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_savetime * 1000 * 10000);
@@ -356,9 +374,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
356 if (face == null) 374 if (face == null)
357 continue; 375 continue;
358 376
359// m_log.DebugFormat( 377 // m_log.DebugFormat(
360// "[AVFACTORY]: Looking for texture {0}, id {1} for {2} {3}", 378 // "[AVFACTORY]: Looking for texture {0}, id {1} for {2} {3}",
361// face.TextureID, idx, client.Name, client.AgentId); 379 // face.TextureID, idx, client.Name, client.AgentId);
362 380
363 // if the texture is one of the "defaults" then skip it 381 // if the texture is one of the "defaults" then skip it
364 // this should probably be more intelligent (skirt texture doesnt matter 382 // this should probably be more intelligent (skirt texture doesnt matter
@@ -373,7 +391,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
373 return false; 391 return false;
374 } 392 }
375 393
376// m_log.DebugFormat("[AVFACTORY]: Completed texture check for {0} {1}", sp.Name, sp.UUID); 394 // m_log.DebugFormat("[AVFACTORY]: Completed texture check for {0} {1}", sp.Name, sp.UUID);
377 395
378 // If we only found default textures, then the appearance is not cached 396 // If we only found default textures, then the appearance is not cached
379 return (defonly ? false : true); 397 return (defonly ? false : true);
@@ -392,9 +410,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
392 if (face == null) 410 if (face == null)
393 continue; 411 continue;
394 412
395// m_log.DebugFormat( 413 // m_log.DebugFormat(
396// "[AVFACTORY]: Looking for texture {0}, id {1} for {2} {3}", 414 // "[AVFACTORY]: Looking for texture {0}, id {1} for {2} {3}",
397// face.TextureID, idx, client.Name, client.AgentId); 415 // face.TextureID, idx, client.Name, client.AgentId);
398 416
399 // if the texture is one of the "defaults" then skip it 417 // if the texture is one of the "defaults" then skip it
400 // this should probably be more intelligent (skirt texture doesnt matter 418 // this should probably be more intelligent (skirt texture doesnt matter
@@ -458,9 +476,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
458 if (bakeType == BakeType.Unknown) 476 if (bakeType == BakeType.Unknown)
459 continue; 477 continue;
460 478
461// m_log.DebugFormat( 479 // m_log.DebugFormat(
462// "[AVFACTORY]: NPC avatar {0} has texture id {1} : {2}", 480 // "[AVFACTORY]: NPC avatar {0} has texture id {1} : {2}",
463// acd.AgentID, i, acd.Appearance.Texture.FaceTextures[i]); 481 // acd.AgentID, i, acd.Appearance.Texture.FaceTextures[i]);
464 482
465 int ftIndex = (int)AppearanceManager.BakeTypeToAgentTextureIndex(bakeType); 483 int ftIndex = (int)AppearanceManager.BakeTypeToAgentTextureIndex(bakeType);
466 Primitive.TextureEntryFace texture = faceTextures[ftIndex]; // this will be null if there's no such baked texture 484 Primitive.TextureEntryFace texture = faceTextures[ftIndex]; // this will be null if there's no such baked texture
@@ -484,7 +502,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
484 UUID avatarID = kvp.Key; 502 UUID avatarID = kvp.Key;
485 long sendTime = kvp.Value; 503 long sendTime = kvp.Value;
486 504
487// m_log.DebugFormat("[AVFACTORY]: Handling queued appearance updates for {0}, update delta to now is {1}", avatarID, sendTime - now); 505 // m_log.DebugFormat("[AVFACTORY]: Handling queued appearance updates for {0}, update delta to now is {1}", avatarID, sendTime - now);
488 506
489 if (sendTime < now) 507 if (sendTime < now)
490 { 508 {
@@ -530,11 +548,11 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
530 if (sp == null) 548 if (sp == null)
531 { 549 {
532 // This is expected if the user has gone away. 550 // This is expected if the user has gone away.
533// m_log.DebugFormat("[AVFACTORY]: Agent {0} no longer in the scene", agentid); 551 // m_log.DebugFormat("[AVFACTORY]: Agent {0} no longer in the scene", agentid);
534 return; 552 return;
535 } 553 }
536 554
537// m_log.DebugFormat("[AVFACTORY]: Saving appearance for avatar {0}", agentid); 555 // m_log.DebugFormat("[AVFACTORY]: Saving appearance for avatar {0}", agentid);
538 556
539 // This could take awhile since it needs to pull inventory 557 // This could take awhile since it needs to pull inventory
540 // We need to do it at the point of save so that there is a sufficient delay for any upload of new body part/shape 558 // We need to do it at the point of save so that there is a sufficient delay for any upload of new body part/shape
@@ -622,12 +640,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
622 /// <param name="client"></param> 640 /// <param name="client"></param>
623 /// <param name="texture"></param> 641 /// <param name="texture"></param>
624 /// <param name="visualParam"></param> 642 /// <param name="visualParam"></param>
625 private void Client_OnSetAppearance(IClientAPI client, Primitive.TextureEntry textureEntry, byte[] visualParams) 643 private void Client_OnSetAppearance(IClientAPI client, Primitive.TextureEntry textureEntry, byte[] visualParams, List<CachedTextureRequestArg> hashes)
626 { 644 {
627 // m_log.WarnFormat("[AVFACTORY]: Client_OnSetAppearance called for {0} ({1})", client.Name, client.AgentId); 645 // m_log.WarnFormat("[AVFACTORY]: Client_OnSetAppearance called for {0} ({1})", client.Name, client.AgentId);
628 ScenePresence sp = m_scene.GetScenePresence(client.AgentId); 646 ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
629 if (sp != null) 647 if (sp != null)
630 SetAppearance(sp, textureEntry, visualParams); 648 DoSetAppearance(sp, textureEntry, visualParams, hashes);
631 else 649 else
632 m_log.WarnFormat("[AVFACTORY]: Client_OnSetAppearance unable to find presence for {0}", client.AgentId); 650 m_log.WarnFormat("[AVFACTORY]: Client_OnSetAppearance unable to find presence for {0}", client.AgentId);
633 } 651 }
@@ -684,7 +702,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
684 /// <param name="cachedTextureRequest"></param> 702 /// <param name="cachedTextureRequest"></param>
685 private void Client_OnCachedTextureRequest(IClientAPI client, int serial, List<CachedTextureRequestArg> cachedTextureRequest) 703 private void Client_OnCachedTextureRequest(IClientAPI client, int serial, List<CachedTextureRequestArg> cachedTextureRequest)
686 { 704 {
687 // m_log.WarnFormat("[AVFACTORY]: Client_OnCachedTextureRequest called for {0} ({1})", client.Name, client.AgentId); 705 // m_log.DebugFormat("[AVFACTORY]: Client_OnCachedTextureRequest called for {0} ({1})", client.Name, client.AgentId);
688 ScenePresence sp = m_scene.GetScenePresence(client.AgentId); 706 ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
689 707
690 List<CachedTextureResponseArg> cachedTextureResponse = new List<CachedTextureResponseArg>(); 708 List<CachedTextureResponseArg> cachedTextureResponse = new List<CachedTextureResponseArg>();
@@ -695,23 +713,20 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
695 713
696 if (m_reusetextures) 714 if (m_reusetextures)
697 { 715 {
698 // this is the most insanely dumb way to do this... however it seems to 716 if (sp.Appearance.GetTextureHash(index) == request.WearableHashID)
699 // actually work. if the appearance has been reset because wearables have 717 {
700 // changed then the texture entries are zero'd out until the bakes are 718 Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[index];
701 // uploaded. on login, if the textures exist in the cache (eg if you logged 719 if (face != null)
702 // into the simulator recently, then the appearance will pull those and send 720 texture = face.TextureID;
703 // them back in the packet and you won't have to rebake. if the textures aren't 721 }
704 // in the cache then the intial makeroot() call in scenepresence will zero 722 else
705 // them out. 723 {
706 // 724 // We know that that hash is wrong, null it out
707 // a better solution (though how much better is an open question) is to 725 // and wait for the setappearance call
708 // store the hashes in the appearance and compare them. Thats's coming. 726 sp.Appearance.SetTextureHash(index,UUID.Zero);
709 727 }
710 Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[index]; 728
711 if (face != null) 729 // m_log.WarnFormat("[AVFACTORY]: use texture {0} for index {1}; hash={2}",texture,index,request.WearableHashID);
712 texture = face.TextureID;
713
714 // m_log.WarnFormat("[AVFACTORY]: reuse texture {0} for index {1}",texture,index);
715 } 730 }
716 731
717 CachedTextureResponseArg response = new CachedTextureResponseArg(); 732 CachedTextureResponseArg response = new CachedTextureResponseArg();
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
index 8056030..4613344 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
@@ -371,7 +371,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
371 foreach (string fid in outstanding) 371 foreach (string fid in outstanding)
372 { 372 {
373 UUID fromAgentID; 373 UUID fromAgentID;
374 string firstname = "Unknown", lastname = "User"; 374 string firstname = "Unknown", lastname = "UserFMSFOIN";
375 if (!GetAgentInfo(client.Scene.RegionInfo.ScopeID, fid, out fromAgentID, out firstname, out lastname)) 375 if (!GetAgentInfo(client.Scene.RegionInfo.ScopeID, fid, out fromAgentID, out firstname, out lastname))
376 { 376 {
377 m_log.DebugFormat("[FRIENDS MODULE]: skipping malformed friend {0}", fid); 377 m_log.DebugFormat("[FRIENDS MODULE]: skipping malformed friend {0}", fid);
@@ -397,7 +397,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
397 397
398 protected virtual bool GetAgentInfo(UUID scopeID, string fid, out UUID agentID, out string first, out string last) 398 protected virtual bool GetAgentInfo(UUID scopeID, string fid, out UUID agentID, out string first, out string last)
399 { 399 {
400 first = "Unknown"; last = "User"; 400 first = "Unknown"; last = "UserFMGAI";
401 if (!UUID.TryParse(fid, out agentID)) 401 if (!UUID.TryParse(fid, out agentID))
402 return false; 402 return false;
403 403
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
index bf5c0bb..b3e3aa2 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
@@ -293,7 +293,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
293 293
294 protected override bool GetAgentInfo(UUID scopeID, string fid, out UUID agentID, out string first, out string last) 294 protected override bool GetAgentInfo(UUID scopeID, string fid, out UUID agentID, out string first, out string last)
295 { 295 {
296 first = "Unknown"; last = "User"; 296 first = "Unknown"; last = "UserHGGAI";
297 if (base.GetAgentInfo(scopeID, fid, out agentID, out first, out last)) 297 if (base.GetAgentInfo(scopeID, fid, out agentID, out first, out last))
298 return true; 298 return true;
299 299
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs
index fac93e6..ad3cf15 100644
--- a/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs
@@ -54,7 +54,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
54 54
55 public new void Initialise(IConfigSource config) 55 public new void Initialise(IConfigSource config)
56 { 56 {
57 string umanmod = config.Configs["Modules"].GetString("UserManagementModule", Name); 57 string umanmod = config.Configs["Modules"].GetString("UserManagementModule", null);
58 if (umanmod == Name) 58 if (umanmod == Name)
59 { 59 {
60 m_Enabled = true; 60 m_Enabled = true;
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
index 6847e57..a720d7b 100644
--- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
@@ -157,13 +157,16 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
157 } 157 }
158 else 158 else
159 { 159 {
160 string[] names = GetUserNames(uuid); 160 string[] names;
161 bool foundRealName = TryGetUserNames(uuid, out names);
162
161 if (names.Length == 2) 163 if (names.Length == 2)
162 { 164 {
163 //m_log.DebugFormat("[XXX] HandleUUIDNameRequest {0} is {1} {2}", uuid, names[0], names[1]); 165 if (!foundRealName)
166 m_log.DebugFormat("[USER MANAGEMENT MODULE]: Sending {0} {1} for {2} to {3} since no bound name found", names[0], names[1], uuid, remote_client.Name);
167
164 remote_client.SendNameReply(uuid, names[0], names[1]); 168 remote_client.SendNameReply(uuid, names[0], names[1]);
165 } 169 }
166
167 } 170 }
168 } 171 }
169 172
@@ -246,10 +249,15 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
246 } 249 }
247 250
248 // search the local cache 251 // search the local cache
249 foreach (UserData data in m_UserCache.Values) 252 lock (m_UserCache)
250 if (users.Find(delegate(UserData d) { return d.Id == data.Id; }) == null && 253 {
251 (data.FirstName.ToLower().StartsWith(query.ToLower()) || data.LastName.ToLower().StartsWith(query.ToLower()))) 254 foreach (UserData data in m_UserCache.Values)
252 users.Add(data); 255 {
256 if (users.Find(delegate(UserData d) { return d.Id == data.Id; }) == null &&
257 (data.FirstName.ToLower().StartsWith(query.ToLower()) || data.LastName.ToLower().StartsWith(query.ToLower())))
258 users.Add(data);
259 }
260 }
253 261
254 AddAdditionalUsers(query, users); 262 AddAdditionalUsers(query, users);
255 263
@@ -272,17 +280,24 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
272 } 280 }
273 } 281 }
274 282
275 private string[] GetUserNames(UUID uuid) 283 /// <summary>
284 /// Try to get the names bound to the given uuid.
285 /// </summary>
286 /// <returns>True if the name was found, false if not.</returns>
287 /// <param name='uuid'></param>
288 /// <param name='names'>The array of names if found. If not found, then names[0] = "Unknown" and names[1] = "User"</param>
289 private bool TryGetUserNames(UUID uuid, out string[] names)
276 { 290 {
277 string[] returnstring = new string[2]; 291 names = new string[2];
278 292
279 lock (m_UserCache) 293 lock (m_UserCache)
280 { 294 {
281 if (m_UserCache.ContainsKey(uuid)) 295 if (m_UserCache.ContainsKey(uuid))
282 { 296 {
283 returnstring[0] = m_UserCache[uuid].FirstName; 297 names[0] = m_UserCache[uuid].FirstName;
284 returnstring[1] = m_UserCache[uuid].LastName; 298 names[1] = m_UserCache[uuid].LastName;
285 return returnstring; 299
300 return true;
286 } 301 }
287 } 302 }
288 303
@@ -290,8 +305,8 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
290 305
291 if (account != null) 306 if (account != null)
292 { 307 {
293 returnstring[0] = account.FirstName; 308 names[0] = account.FirstName;
294 returnstring[1] = account.LastName; 309 names[1] = account.LastName;
295 310
296 UserData user = new UserData(); 311 UserData user = new UserData();
297 user.FirstName = account.FirstName; 312 user.FirstName = account.FirstName;
@@ -299,14 +314,16 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
299 314
300 lock (m_UserCache) 315 lock (m_UserCache)
301 m_UserCache[uuid] = user; 316 m_UserCache[uuid] = user;
317
318 return true;
302 } 319 }
303 else 320 else
304 { 321 {
305 returnstring[0] = "Unknown"; 322 names[0] = "Unknown";
306 returnstring[1] = "User"; 323 names[1] = "UserUMMTGUN";
307 }
308 324
309 return returnstring; 325 return false;
326 }
310 } 327 }
311 328
312 #region IUserManagement 329 #region IUserManagement
@@ -342,15 +359,17 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
342 359
343 public string GetUserName(UUID uuid) 360 public string GetUserName(UUID uuid)
344 { 361 {
345 string[] names = GetUserNames(uuid); 362 string[] names;
363 TryGetUserNames(uuid, out names);
364
346 if (names.Length == 2) 365 if (names.Length == 2)
347 { 366 {
348 string firstname = names[0]; 367 string firstname = names[0];
349 string lastname = names[1]; 368 string lastname = names[1];
350 369
351 return firstname + " " + lastname; 370 return firstname + " " + lastname;
352
353 } 371 }
372
354 return "(hippos)"; 373 return "(hippos)";
355 } 374 }
356 375
@@ -466,12 +485,13 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
466 //ignore updates without creator data 485 //ignore updates without creator data
467 return; 486 return;
468 } 487 }
488
469 //try update unknown users 489 //try update unknown users
470 //and creator's home URL's 490 //and creator's home URL's
471 if ((oldUser.FirstName == "Unknown" && !creatorData.Contains ("Unknown")) || (oldUser.HomeURL != null && !creatorData.StartsWith (oldUser.HomeURL))) 491 if ((oldUser.FirstName == "Unknown" && !creatorData.Contains ("Unknown")) || (oldUser.HomeURL != null && !creatorData.StartsWith (oldUser.HomeURL)))
472 { 492 {
473 m_UserCache.Remove (id); 493 m_UserCache.Remove (id);
474// m_log.DebugFormat("[USER MANAGEMENT MODULE]: Re-adding user with id {0}, creatorData [{1}] and old HomeURL {2}", id, creatorData,oldUser.HomeURL); 494 m_log.DebugFormat("[USER MANAGEMENT MODULE]: Re-adding user with id {0}, creatorData [{1}] and old HomeURL {2}", id, creatorData, oldUser.HomeURL);
475 } 495 }
476 else 496 else
477 { 497 {
@@ -516,7 +536,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
516 else 536 else
517 { 537 {
518 user.FirstName = "Unknown"; 538 user.FirstName = "Unknown";
519 user.LastName = "User"; 539 user.LastName = "UserUMMAU";
520 } 540 }
521 541
522 AddUserInternal (user); 542 AddUserInternal (user);
@@ -548,6 +568,13 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
548 protected void RegisterConsoleCmds() 568 protected void RegisterConsoleCmds()
549 { 569 {
550 MainConsole.Instance.Commands.AddCommand("Users", true, 570 MainConsole.Instance.Commands.AddCommand("Users", true,
571 "show name",
572 "show name <uuid>",
573 "Show the bindings between a single user UUID and a user name",
574 String.Empty,
575 HandleShowUser);
576
577 MainConsole.Instance.Commands.AddCommand("Users", true,
551 "show names", 578 "show names",
552 "show names", 579 "show names",
553 "Show the bindings between user UUIDs and user names", 580 "Show the bindings between user UUIDs and user names",
@@ -555,26 +582,54 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
555 HandleShowUsers); 582 HandleShowUsers);
556 } 583 }
557 584
558 private void HandleShowUsers(string module, string[] cmd) 585 private void HandleShowUser(string module, string[] cmd)
559 { 586 {
587 if (cmd.Length < 3)
588 {
589 MainConsole.Instance.OutputFormat("Usage: show name <uuid>");
590 return;
591 }
592
593 UUID userId;
594 if (!ConsoleUtil.TryParseConsoleUuid(MainConsole.Instance, cmd[2], out userId))
595 return;
596
597 string[] names;
598
599 UserData ud;
600
560 lock (m_UserCache) 601 lock (m_UserCache)
561 { 602 {
562 if (m_UserCache.Count == 0) 603 if (!m_UserCache.TryGetValue(userId, out ud))
563 { 604 {
564 MainConsole.Instance.Output("No users found"); 605 MainConsole.Instance.OutputFormat("No name known for user with id {0}", userId);
565 return; 606 return;
566 } 607 }
567 608 }
568 MainConsole.Instance.Output("UUID User Name"); 609
569 MainConsole.Instance.Output("-----------------------------------------------------------------------------"); 610 ConsoleDisplayTable cdt = new ConsoleDisplayTable();
611 cdt.AddColumn("UUID", 36);
612 cdt.AddColumn("Name", 30);
613 cdt.AddColumn("HomeURL", 40);
614 cdt.AddRow(userId, string.Format("{0} {1}", ud.FirstName, ud.LastName), ud.HomeURL);
615
616 MainConsole.Instance.Output(cdt.ToString());
617 }
618
619 private void HandleShowUsers(string module, string[] cmd)
620 {
621 ConsoleDisplayTable cdt = new ConsoleDisplayTable();
622 cdt.AddColumn("UUID", 36);
623 cdt.AddColumn("Name", 30);
624 cdt.AddColumn("HomeURL", 40);
625
626 lock (m_UserCache)
627 {
570 foreach (KeyValuePair<UUID, UserData> kvp in m_UserCache) 628 foreach (KeyValuePair<UUID, UserData> kvp in m_UserCache)
571 { 629 cdt.AddRow(kvp.Key, string.Format("{0} {1}", kvp.Value.FirstName, kvp.Value.LastName), kvp.Value.HomeURL);
572 MainConsole.Instance.Output(String.Format("{0} {1} {2} ({3})",
573 kvp.Key, kvp.Value.FirstName, kvp.Value.LastName, kvp.Value.HomeURL));
574 }
575
576 return;
577 } 630 }
631
632 MainConsole.Instance.Output(cdt.ToString());
578 } 633 }
579 } 634 }
580} \ No newline at end of file 635} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
index 883045a..d093224 100644
--- a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
+++ b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
@@ -369,6 +369,15 @@ namespace OpenSim.Region.CoreModules.World.Sound
369 }); 369 });
370 } 370 }
371 371
372 public void SetSoundQueueing(UUID objectID, bool shouldQueue)
373 {
374 SceneObjectPart part;
375 if (!m_scene.TryGetSceneObjectPart(objectID, out part))
376 return;
377
378 part.SoundQueueing = shouldQueue;
379 }
380
372 #endregion 381 #endregion
373 } 382 }
374} 383}