From 859bc717a4fe4cd5810ad9889cfb9b1e7f5c2046 Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Fri, 19 Mar 2010 05:51:16 -0700 Subject: Cleaned up access to scenepresences in scenegraph. GetScenePresences and GetAvatars have been removed to consolidate locking and iteration within SceneGraph. All callers which used these to then iterate over presences have been refactored to instead pass their delegates to Scene.ForEachScenePresence(Action). --- .../World/Estate/EstateManagementModule.cs | 31 +++----- .../CoreModules/World/Land/LandManagementModule.cs | 39 +++++----- .../Region/CoreModules/World/Land/LandObject.cs | 26 ++++--- .../Region/CoreModules/World/Sound/SoundModule.cs | 34 +++++---- OpenSim/Region/CoreModules/World/Sun/SunModule.cs | 9 +-- .../Region/CoreModules/World/Wind/WindModule.cs | 12 ++- .../CoreModules/World/WorldMap/WorldMapModule.cs | 87 ++++++---------------- 7 files changed, 94 insertions(+), 144 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 464d922..91d40ab 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs @@ -468,26 +468,20 @@ namespace OpenSim.Region.CoreModules.World.Estate private void handleEstateTeleportAllUsersHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID) { - // Get a fresh list that will not change as people get teleported away - List presences = m_scene.GetScenePresences(); - - foreach(ScenePresence p in presences) + m_scene.ForEachScenePresence(delegate(ScenePresence sp) { - if (p.UUID != senderID) + if (sp.UUID != senderID) { + ScenePresence p = m_scene.GetScenePresence(sp.UUID); // make sure they are still there, we could be working down a long list - ScenePresence s = m_scene.GetScenePresence(p.UUID); - if (s != null) + // Also make sure they are actually in the region + if (p != null && !p.IsChildAgent) { - // Also make sure they are actually in the region - if (!s.IsChildAgent) - { - s.ControllingClient.SendTeleportLocationStart(); - m_scene.TeleportClientHome(s.UUID, s.ControllingClient); - } + p.ControllingClient.SendTeleportLocationStart(); + m_scene.TeleportClientHome(p.UUID, p.ControllingClient); } } - } + }); } private void AbortTerrainXferHandler(IClientAPI remoteClient, ulong XferID) { @@ -765,12 +759,11 @@ namespace OpenSim.Region.CoreModules.World.Estate public void sendRegionInfoPacketToAll() { - List avatars = m_scene.GetAvatars(); - - for (int i = 0; i < avatars.Count; i++) + m_scene.ForEachScenePresence(delegate(ScenePresence sp) { - HandleRegionInfoRequest(avatars[i].ControllingClient); - } + if (!sp.IsChildAgent) + HandleRegionInfoRequest(sp.ControllingClient); + }); } public void sendRegionHandshake(IClientAPI remoteClient) diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 1279ac1..5750aa4 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -191,9 +191,9 @@ namespace OpenSim.Region.CoreModules.World.Land forcedPosition = null; } //if we are far away, teleport - else if (Vector3.Distance(clientAvatar.AbsolutePosition,forcedPosition.Value) > 3) + else if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition.Value) > 3) { - Debug.WriteLine(string.Format("Teleporting out because {0} is too far from avatar position {1}",forcedPosition.Value,clientAvatar.AbsolutePosition)); + Debug.WriteLine(string.Format("Teleporting out because {0} is too far from avatar position {1}", forcedPosition.Value, clientAvatar.AbsolutePosition)); clientAvatar.Teleport(forcedPosition.Value); forcedPosition = null; } @@ -374,30 +374,27 @@ namespace OpenSim.Region.CoreModules.World.Land } } - public void SendOutNearestBanLine(IClientAPI avatar) + public void SendOutNearestBanLine(IClientAPI client) { - List avatars = m_scene.GetAvatars(); - foreach (ScenePresence presence in avatars) + ScenePresence sp = m_scene.GetScenePresence(client.AgentId); + if (sp == null || sp.IsChildAgent) + return; + + List checkLandParcels = ParcelsNearPoint(sp.AbsolutePosition); + foreach (ILandObject checkBan in checkLandParcels) { - if (presence.UUID == avatar.AgentId) + if (checkBan.IsBannedFromLand(client.AgentId)) { - List checkLandParcels = ParcelsNearPoint(presence.AbsolutePosition); - foreach (ILandObject checkBan in checkLandParcels) - { - if (checkBan.IsBannedFromLand(avatar.AgentId)) - { - checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionBanned, false, (int)ParcelResult.Single, avatar); - return; //Only send one - } - if (checkBan.IsRestrictedFromLand(avatar.AgentId)) - { - checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionNotOnAccessList, false, (int)ParcelResult.Single, avatar); - return; //Only send one - } - } - return; + checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionBanned, false, (int)ParcelResult.Single, client); + return; //Only send one + } + if (checkBan.IsRestrictedFromLand(client.AgentId)) + { + checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionNotOnAccessList, false, (int)ParcelResult.Single, client); + return; //Only send one } } + return; } public void SendLandUpdate(ScenePresence avatar, bool force) diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index e85136a..b2d9b66 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -332,36 +332,38 @@ namespace OpenSim.Region.CoreModules.World.Land public void SendLandUpdateToAvatarsOverMe(bool snap_selection) { - List avatars = m_scene.GetAvatars(); - ILandObject over = null; - for (int i = 0; i < avatars.Count; i++) + m_scene.ForEachScenePresence(delegate(ScenePresence avatar) { + if (avatar.IsChildAgent) + return; + + ILandObject over = null; try { over = - m_scene.LandChannel.GetLandObject(Util.Clamp((int)Math.Round(avatars[i].AbsolutePosition.X), 0, ((int)Constants.RegionSize - 1)), - Util.Clamp((int)Math.Round(avatars[i].AbsolutePosition.Y), 0, ((int)Constants.RegionSize - 1))); + m_scene.LandChannel.GetLandObject(Util.Clamp((int)Math.Round(avatar.AbsolutePosition.X), 0, ((int)Constants.RegionSize - 1)), + Util.Clamp((int)Math.Round(avatar.AbsolutePosition.Y), 0, ((int)Constants.RegionSize - 1))); } catch (Exception) { - m_log.Warn("[LAND]: " + "unable to get land at x: " + Math.Round(avatars[i].AbsolutePosition.X) + " y: " + - Math.Round(avatars[i].AbsolutePosition.Y)); + m_log.Warn("[LAND]: " + "unable to get land at x: " + Math.Round(avatar.AbsolutePosition.X) + " y: " + + Math.Round(avatar.AbsolutePosition.Y)); } if (over != null) { if (over.LandData.LocalID == LandData.LocalID) { - if (((over.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0) && + if (((over.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0) && m_scene.RegionInfo.RegionSettings.AllowDamage) - avatars[i].Invulnerable = false; + avatar.Invulnerable = false; else - avatars[i].Invulnerable = true; + avatar.Invulnerable = true; - SendLandUpdateToClient(snap_selection, avatars[i].ControllingClient); + SendLandUpdateToClient(snap_selection, avatar.ControllingClient); } } - } + }); } #endregion diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs index 1f5a4ff..a52fea4 100644 --- a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs +++ b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs @@ -62,40 +62,46 @@ namespace OpenSim.Region.CoreModules.World.Sound public virtual void PlayAttachedSound( UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags, float radius) { - foreach (ScenePresence p in m_scene.GetAvatars()) + m_scene.ForEachScenePresence(delegate(ScenePresence sp) { - double dis = Util.GetDistanceTo(p.AbsolutePosition, position); + if (sp.IsChildAgent) + return; + + double dis = Util.GetDistanceTo(sp.AbsolutePosition, position); if (dis > 100.0) // Max audio distance - continue; - + return; + // Scale by distance if (radius == 0) gain = (float)((double)gain * ((100.0 - dis) / 100.0)); else gain = (float)((double)gain * ((radius - dis) / radius)); - - p.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, (float)gain, flags); - } + + sp.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, (float)gain, flags); + }); } public virtual void TriggerSound( UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle, float radius) { - foreach (ScenePresence p in m_scene.GetAvatars()) + m_scene.ForEachScenePresence(delegate(ScenePresence sp) { - double dis = Util.GetDistanceTo(p.AbsolutePosition, position); + if (sp.IsChildAgent) + return; + + double dis = Util.GetDistanceTo(sp.AbsolutePosition, position); if (dis > 100.0) // Max audio distance - continue; - + return; + // Scale by distance if (radius == 0) gain = (float)((double)gain * ((100.0 - dis) / 100.0)); else gain = (float)((double)gain * ((radius - dis) / radius)); - - p.ControllingClient.SendTriggeredSound( + + sp.ControllingClient.SendTriggeredSound( soundId, ownerID, objectID, parentID, handle, position, (float)gain); - } + }); } } } diff --git a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs index 0712a7f..a6dc2ec 100644 --- a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs +++ b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs @@ -509,14 +509,13 @@ namespace OpenSim.Region.CoreModules private void SunUpdateToAllClients() { - List avatars = m_scene.GetAvatars(); - foreach (ScenePresence avatar in avatars) + m_scene.ForEachScenePresence(delegate(ScenePresence sp) { - if (!avatar.IsChildAgent) + if (!sp.IsChildAgent) { - SunToClient(avatar.ControllingClient); + SunToClient(sp.ControllingClient); } - } + }); } #region ISunModule Members diff --git a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs index 3283c1f..9736b73 100644 --- a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs +++ b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs @@ -425,9 +425,7 @@ namespace OpenSim.Region.CoreModules { if (m_ready) { - List avatars = m_scene.GetAvatars(); - - if (avatars.Count > 0) + if(m_scene.GetRootAgentCount() > 0) { // Ask wind plugin to generate a LL wind array to be cached locally // Try not to update this too often, as it may involve array copies @@ -437,11 +435,11 @@ namespace OpenSim.Region.CoreModules m_frameLastUpdateClientArray = m_frame; } - foreach (ScenePresence avatar in avatars) + m_scene.ForEachScenePresence(delegate(ScenePresence sp) { - if (!avatar.IsChildAgent) - avatar.ControllingClient.SendWindData(windSpeeds); - } + if (!sp.IsChildAgent) + sp.ControllingClient.SendWindData(windSpeeds); + }); } } } diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index b63d014..f1cc0dd 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -304,25 +304,11 @@ namespace OpenSim.Region.CoreModules.World.WorldMap /// AgentID that logged out private void ClientLoggedOut(UUID AgentId, Scene scene) { - List presences = m_scene.GetAvatars(); - int rootcount = 0; - for (int i=0;i avatars = m_scene.GetAvatars(); int tc = Environment.TickCount; List mapitems = new List(); mapItemReply mapitem = new mapItemReply(); - if (avatars.Count == 0 || avatars.Count == 1) + if (m_scene.GetRootAgentCount() <= 1) { mapitem = new mapItemReply(); mapitem.x = (uint)(xstart + 1); @@ -392,21 +377,21 @@ namespace OpenSim.Region.CoreModules.World.WorldMap } else { - foreach (ScenePresence av in avatars) + m_scene.ForEachScenePresence(delegate(ScenePresence sp) { // Don't send a green dot for yourself - if (av.UUID != remoteClient.AgentId) + if (!sp.IsChildAgent && sp.UUID != remoteClient.AgentId) { mapitem = new mapItemReply(); - mapitem.x = (uint)(xstart + av.AbsolutePosition.X); - mapitem.y = (uint)(ystart + av.AbsolutePosition.Y); + mapitem.x = (uint)(xstart + sp.AbsolutePosition.X); + mapitem.y = (uint)(ystart + sp.AbsolutePosition.Y); mapitem.id = UUID.Zero; mapitem.name = Util.Md5Hash(m_scene.RegionInfo.RegionName + tc.ToString()); mapitem.Extra = 1; mapitem.Extra2 = 0; mapitems.Add(mapitem); } - } + }); } remoteClient.SendMapItemReply(mapitems.ToArray(), itemtype, flags); } @@ -981,51 +966,35 @@ namespace OpenSim.Region.CoreModules.World.WorldMap Utils.LongToUInts(m_scene.RegionInfo.RegionHandle,out xstart,out ystart); OSDMap responsemap = new OSDMap(); - List avatars = m_scene.GetAvatars(); - OSDArray responsearr = new OSDArray(avatars.Count); - OSDMap responsemapdata = new OSDMap(); int tc = Environment.TickCount; - /* - foreach (ScenePresence av in avatars) - { - responsemapdata = new OSDMap(); - responsemapdata["X"] = OSD.FromInteger((int)(xstart + av.AbsolutePosition.X)); - responsemapdata["Y"] = OSD.FromInteger((int)(ystart + av.AbsolutePosition.Y)); - responsemapdata["ID"] = OSD.FromUUID(UUID.Zero); - responsemapdata["Name"] = OSD.FromString("TH"); - responsemapdata["Extra"] = OSD.FromInteger(0); - responsemapdata["Extra2"] = OSD.FromInteger(0); - responsearr.Add(responsemapdata); - } - responsemap["1"] = responsearr; - */ - if (avatars.Count == 0) + if (m_scene.GetRootAgentCount() == 0) { - responsemapdata = new OSDMap(); + OSDMap responsemapdata = new OSDMap(); responsemapdata["X"] = OSD.FromInteger((int)(xstart + 1)); responsemapdata["Y"] = OSD.FromInteger((int)(ystart + 1)); responsemapdata["ID"] = OSD.FromUUID(UUID.Zero); responsemapdata["Name"] = OSD.FromString(Util.Md5Hash(m_scene.RegionInfo.RegionName + tc.ToString())); responsemapdata["Extra"] = OSD.FromInteger(0); responsemapdata["Extra2"] = OSD.FromInteger(0); + OSDArray responsearr = new OSDArray(); responsearr.Add(responsemapdata); responsemap["6"] = responsearr; } else { - responsearr = new OSDArray(avatars.Count); - foreach (ScenePresence av in avatars) + OSDArray responsearr = new OSDArray(m_scene.GetRootAgentCount()); + m_scene.ForEachScenePresence(delegate(ScenePresence sp) { - responsemapdata = new OSDMap(); - responsemapdata["X"] = OSD.FromInteger((int)(xstart + av.AbsolutePosition.X)); - responsemapdata["Y"] = OSD.FromInteger((int)(ystart + av.AbsolutePosition.Y)); + OSDMap responsemapdata = new OSDMap(); + responsemapdata["X"] = OSD.FromInteger((int)(xstart + sp.AbsolutePosition.X)); + responsemapdata["Y"] = OSD.FromInteger((int)(ystart + sp.AbsolutePosition.Y)); responsemapdata["ID"] = OSD.FromUUID(UUID.Zero); responsemapdata["Name"] = OSD.FromString(Util.Md5Hash(m_scene.RegionInfo.RegionName + tc.ToString())); responsemapdata["Extra"] = OSD.FromInteger(1); responsemapdata["Extra2"] = OSD.FromInteger(0); responsearr.Add(responsemapdata); - } + }); responsemap["6"] = responsearr; } return responsemap; @@ -1107,25 +1076,11 @@ namespace OpenSim.Region.CoreModules.World.WorldMap private void MakeChildAgent(ScenePresence avatar) { - List presences = m_scene.GetAvatars(); - int rootcount = 0; - for (int i = 0; i < presences.Count; i++) - { - if (presences[i] != null) - { - if (!presences[i].IsChildAgent) - rootcount++; - } - } - if (rootcount <= 1) - StopThread(); - lock (m_rootAgents) { - if (m_rootAgents.Contains(avatar.UUID)) - { - m_rootAgents.Remove(avatar.UUID); - } + m_rootAgents.Remove(avatar.UUID); + if (m_rootAgents.Count == 0) + StopThread(); } } -- cgit v1.1 From 62e0b53ca4697a852ee1e36e86da6a32e93bd55e Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Fri, 19 Mar 2010 05:58:34 -0700 Subject: Renamed TryGetAvatar to TryGetScenePresence on SceneManager, SceneBase, Scene and SceneGraph. This was the only change in this patch to keep it isolated from other recent changes to the same set of files. --- .../Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 8 ++++---- .../Avatar/Inventory/Transfer/InventoryTransferModule.cs | 2 +- OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs | 2 +- .../Framework/InventoryAccess/HGInventoryAccessModule.cs | 2 +- OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs | 2 +- .../ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | 4 ++-- .../CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs | 2 +- .../CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs | 2 +- OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index f54e41a..23828ef 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -86,7 +86,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments // Save avatar attachment information ScenePresence presence; - if (m_scene.AvatarFactory != null && m_scene.TryGetAvatar(remoteClient.AgentId, out presence)) + if (m_scene.AvatarFactory != null && m_scene.TryGetScenePresence(remoteClient.AgentId, out presence)) { m_log.Info( "[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId @@ -255,7 +255,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments AttachmentPt = att.RootPart.AttachmentPoint; ScenePresence presence; - if (m_scene.TryGetAvatar(remoteClient.AgentId, out presence)) + if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence)) { InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); item = m_scene.InventoryService.GetItem(item); @@ -299,7 +299,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments } ScenePresence presence; - if (m_scene.TryGetAvatar(remoteClient.AgentId, out presence)) + if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence)) { // XXYY!! InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); @@ -314,7 +314,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments public void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient) { ScenePresence presence; - if (m_scene.TryGetAvatar(remoteClient.AgentId, out presence)) + if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence)) { presence.Appearance.DetachAttachment(itemID); diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 4f03b0e..be89740 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs @@ -358,7 +358,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer { ScenePresence presence; - if (s.TryGetAvatar(agentID, out presence)) + if (s.TryGetScenePresence(agentID, out presence)) { // If the agent is in this scene, then we // are being called twice in a single diff --git a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs index 63a93aa..c011776 100644 --- a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs +++ b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs @@ -82,7 +82,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps responsedata["str_response_string"] = "Request wasn't what was expected"; ScenePresence avatar; - if (!m_scene.TryGetAvatar(AgentId, out avatar)) + if (!m_scene.TryGetScenePresence(AgentId, out avatar)) return responsedata; diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs index 25f5154..93aeb94 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs @@ -190,7 +190,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess if (account == null) // foreign { ScenePresence sp = null; - if (m_Scene.TryGetAvatar(userID, out sp)) + if (m_Scene.TryGetScenePresence(userID, out sp)) { AgentCircuitData aCircuit = m_Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); if (aCircuit.ServiceURLs.ContainsKey("AssetServerURI")) diff --git a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs index 8cf4619..e95d2f8 100644 --- a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs +++ b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs @@ -1206,7 +1206,7 @@ namespace OpenSim.Region.CoreModules.InterGrid { Scene homeScene = GetRootScene(); ScenePresence avatar = null; - if (homeScene.TryGetAvatar(avatarId,out avatar)) + if (homeScene.TryGetScenePresence(avatarId,out avatar)) { KillAUser ku = new KillAUser(avatar,mod); Watchdog.StartThread(ku.ShutdownNoLogout, "OGPShutdown", ThreadPriority.Normal, true); diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index c6312e0..54508cc 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs @@ -502,7 +502,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory private UUID GetSessionID(UUID userID) { ScenePresence sp = null; - if (m_Scene.TryGetAvatar(userID, out sp)) + if (m_Scene.TryGetScenePresence(userID, out sp)) { return sp.ControllingClient.SessionId; } @@ -521,7 +521,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory if (account == null) // foreign user { ScenePresence sp = null; - m_Scene.TryGetAvatar(userID, out sp); + m_Scene.TryGetScenePresence(userID, out sp); if (sp != null) { AgentCircuitData aCircuit = m_Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs index 3c3534f..5e06580 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs @@ -100,7 +100,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory ScenePresence sp = null; foreach (Scene s in m_Scenes) { - s.TryGetAvatar(clientID, out sp); + s.TryGetScenePresence(clientID, out sp); if ((sp != null) && !sp.IsChildAgent && (s != scene)) { m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, but user {1} still in sim. Keeping system folders in cache", diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs index e98df28..7a75a89 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs @@ -88,7 +88,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence Vector3 position = new Vector3(128, 128, 0); Vector3 lookat = new Vector3(0, 1, 0); - if (client.Scene.TryGetAvatar(client.AgentId, out sp)) + if (client.Scene.TryGetScenePresence(client.AgentId, out sp)) { if (sp is ScenePresence) { diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index f1cc0dd..2b0e83f 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -210,7 +210,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap // this is here because CAPS map requests work even beyond the 10,000 limit. ScenePresence avatarPresence = null; - m_scene.TryGetAvatar(agentID, out avatarPresence); + m_scene.TryGetScenePresence(agentID, out avatarPresence); if (avatarPresence != null) { @@ -489,7 +489,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap if (mrs.agentID != UUID.Zero) { ScenePresence av = null; - m_scene.TryGetAvatar(mrs.agentID, out av); + m_scene.TryGetScenePresence(mrs.agentID, out av); if (av != null) { if (response.ContainsKey(mrs.itemtype.ToString())) -- cgit v1.1 From f020bd3206c653d7b03f5fbc66ca5ef864fc95e8 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 20 Mar 2010 15:49:39 +0000 Subject: Fix a nullref in permissions when returning objects via right-click --- OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 4dbdb01..0f830e1 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -1324,9 +1324,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions // Group voodoo // - if (land.LandData.IsGroupOwned) + if (l.LandData.IsGroupOwned) { - powers = (GroupPowers)client.GetGroupPowers(land.LandData.GroupID); + powers = (GroupPowers)client.GetGroupPowers(l.LandData.GroupID); // Not a group member, or no rights at all // if (powers == (GroupPowers)0) -- cgit v1.1 From bfbf25c542ac13b3056261064e14c15844bf94fe Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 25 Mar 2010 21:36:57 +0000 Subject: minor: Print out port that http servers are using do this in callers so that we know who is setting up these things --- OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs index 27b64bf..40ffcb4 100644 --- a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs @@ -131,8 +131,8 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC { // Start http server // Attach xmlrpc handlers - m_log.Info("[REMOTE_DATA]: " + - "Starting XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands."); + m_log.Info("[XML RPC MODULE]: " + + "Starting up XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands."); BaseHttpServer httpServer = new BaseHttpServer((uint) m_remoteDataPort); httpServer.AddXmlRPCHandler("llRemoteData", XmlRpcRemoteData); httpServer.Start(); @@ -192,7 +192,7 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC // This should no longer happen, but the check is reasonable anyway if (null == m_openChannels) { - m_log.Warn("[RemoteDataReply] Attempt to open channel before initialization is complete"); + m_log.Warn("[XML RPC MODULE]: Attempt to open channel before initialization is complete"); return newChannel; } @@ -279,7 +279,7 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC } else { - m_log.Warn("[RemoteDataReply]: Channel or message_id not found"); + m_log.Warn("[XML RPC MODULE]: Channel or message_id not found"); } } @@ -340,7 +340,7 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC } else { - m_log.Error("UNABLE TO REMOVE COMPLETED REQUEST"); + m_log.Error("[XML RPC MODULE]: UNABLE TO REMOVE COMPLETED REQUEST"); } } } @@ -728,4 +728,4 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC return ReqID; } } -} +} \ No newline at end of file -- cgit v1.1 From efc0916a017b0b1ddbbf226e4b3d3f3e2a1df908 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 27 Mar 2010 22:48:15 -0700 Subject: May fix mantis #4613 --- .../CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index 71b3062..f570999 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs @@ -388,7 +388,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver try { - if (m_aScene.AuthenticationService.Authenticate(account.PrincipalID, pass, 1) != string.Empty) + string encpass = Util.Md5Hash(pass); + if (m_aScene.AuthenticationService.Authenticate(account.PrincipalID, encpass, 1) != string.Empty) { return account; } -- cgit v1.1