From 5ef787861396846a261708485c0fd35a342e85bc Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 24 Sep 2022 17:14:46 +0100 Subject: [PATCH] cosmetics --- .../AssetTransactionModule.cs | 3 +- .../AssetTransaction/AssetXferUploader.cs | 37 ++++++------ .../Avatar/Attachments/AttachmentsModule.cs | 2 +- .../Avatar/UserProfiles/UserProfileModule.cs | 3 +- .../EntityTransfer/EntityTransferModule.cs | 25 ++++++-- .../EntityTransfer/HGEntityTransferModule.cs | 58 ++++++++++++++----- .../HGInventoryAccessModule.cs | 2 +- .../InventoryAccess/InventoryAccessModule.cs | 23 +++----- .../LocalUserProfilesServiceConnector.cs | 4 +- .../LocalAuthorizationServiceConnector.cs | 6 +- .../CoreModules/World/Estate/EstateModule.cs | 2 +- .../World/Land/LandManagementModule.cs | 16 +++-- .../CoreModules/World/Land/PrimCountModule.cs | 2 +- .../Objects/Commands/ObjectCommandsModule.cs | 4 +- .../World/Permissions/PermissionsModule.cs | 2 +- .../World/Terrain/TerrainModule.cs | 15 +++-- .../Freeswitch/FreeswitchServerConnector.cs | 2 +- .../Handlers/Friends/FriendServerConnector.cs | 2 +- 18 files changed, 123 insertions(+), 85 deletions(-) diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs index 7d9f3b375f..81ed3ca89e 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs @@ -166,8 +166,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction // m_log.DebugFormat( // "[TRANSACTIONS MANAGER] Called HandleItemCreationFromTransaction with item {0}", name); - AgentAssetTransactions transactions = - GetUserTransactions(remoteClient.AgentId); + AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId); return transactions.RequestCreateInventoryItem(remoteClient, transactionID, folderID, callbackID, description, name, invType, type, diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs index 5f18a8555a..e438990146 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs @@ -477,24 +477,25 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction m_Scene.AssetService.Store(m_asset); - InventoryItemBase item = new InventoryItemBase(); - item.Owner = ourClient.AgentId; - item.CreatorId = ourClient.AgentId.ToString(); - item.ID = UUID.Random(); - item.AssetID = m_asset.FullID; - item.Description = m_description; - item.Name = m_name; - item.AssetType = type; - item.InvType = invType; - item.Folder = InventFolder; - item.BasePermissions = (uint)(PermissionMask.All | PermissionMask.Export); - item.CurrentPermissions = item.BasePermissions; - item.GroupPermissions=0; - item.EveryOnePermissions=0; - item.NextPermissions = nextPerm; - item.Flags = (uint) wearableType; - item.CreationDate = Util.UnixTimeSinceEpoch(); - + InventoryItemBase item = new InventoryItemBase + { + Owner = ourClient.AgentId, + CreatorId = ourClient.AgentId.ToString(), + ID = UUID.Random(), + AssetID = m_asset.FullID, + Description = m_description, + Name = m_name, + AssetType = type, + InvType = invType, + Folder = InventFolder, + BasePermissions = (uint)(PermissionMask.All | PermissionMask.Export), + CurrentPermissions = (uint)(PermissionMask.All | PermissionMask.Export), + GroupPermissions =0, + EveryOnePermissions=0, + NextPermissions = nextPerm, + Flags = wearableType, + CreationDate = Util.UnixTimeSinceEpoch() + }; m_log.DebugFormat("[XFER]: Created item {0} with asset {1}", item.ID, item.AssetID); diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 80fbf1e55f..117427fc48 100755 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -1260,7 +1260,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments return null; } - bool ItemIDNotZero = !itemID.IsZero(); + bool ItemIDNotZero = itemID.IsNotZero(); if (ItemIDNotZero) objatt = m_invAccessModule.RezObject(sp.ControllingClient, diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index 44c1437335..10f88a4225 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs @@ -1687,10 +1687,9 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles } // flush cache - UserProfileCacheEntry uce = null; lock(m_profilesCache) { - if(m_profilesCache.TryGetValue(remoteClient.AgentId, out uce) && uce != null) + if(m_profilesCache.TryGetValue(remoteClient.AgentId, out UserProfileCacheEntry uce) && uce != null) { uce.props = null; uce.ClientsWaitingProps = null; diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 2455f07393..f13decbbf6 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -2774,18 +2774,35 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer public virtual bool HandleIncomingSceneObject(SceneObjectGroup so, Vector3 newPosition) { + if (so.OwnerID.IsZero()) + { + m_log.DebugFormat( + "[ENTITY TRANSFER MODULE]: Denied object {0}({1}) entry into {2} because ownerID is zero", + so.Name, so.UUID, m_sceneName); + return false; + } + // If the user is banned, we won't let any of their objects // enter. Period. - // if (m_sceneRegionInfo.EstateSettings.IsBanned(so.OwnerID)) { m_log.DebugFormat( - "[ENTITY TRANSFER MODULE]: Denied prim crossing of {0} {1} into {2} for banned avatar {3}", - so.Name, so.UUID, m_sceneName, so.OwnerID); - + "[ENTITY TRANSFER MODULE]: Denied {0} {1} into {2} of banned owner {3}", + so.Name, so.UUID, m_sceneName, so.OwnerID); return false; } + if(so.IsAttachmentCheckFull()) + { + if(m_scene.GetScenePresence(so.OwnerID) == null) + { + m_log.DebugFormat( + "[ENTITY TRANSFER MODULE]: Denied attachment {0}({1}) owner {2} not in region {3}", + so.Name, so.UUID, so.OwnerID, m_sceneName); + return false; + } + } + if (!newPosition.IsZero()) so.RootPart.GroupPosition = newPosition; diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index 9fd5fe9cde..7ae5ee04ba 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs @@ -289,6 +289,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer }; bool success = connector.LoginAgentToGrid(source, agentCircuit, reg, finalDestination, false, out reason); + //logout = success & !isLocal; // flag for later logout from this grid; this is an HG TP logout = success; // flag for later logout from this grid; this is an HG TP if (success) @@ -647,6 +648,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer public override bool HandleIncomingSceneObject(SceneObjectGroup so, Vector3 newPosition) { UUID OwnerID = so.OwnerID; + if (OwnerID.IsZero()) + { + m_log.DebugFormat( + "[HG TRANSFER MODULE]: Denied object {0}({1}) entry into {2} because ownerID is zero", + so.Name, so.UUID, m_sceneName); + return false; + } + if (m_sceneRegionInfo.EstateSettings.IsBanned(OwnerID)) { m_log.DebugFormat( @@ -661,9 +670,25 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer return base.HandleIncomingSceneObject(so, newPosition); // Equally, we can't use so.AttachedAvatar here. - if (OwnerID.IsZero() || m_scene.UserManagementModule.IsLocalGridUser(OwnerID)) + if (m_scene.UserManagementModule.IsLocalGridUser(OwnerID)) return base.HandleIncomingSceneObject(so, newPosition); + if (m_scene.GetScenePresence(OwnerID) == null) + { + m_log.DebugFormat( + "[HG TRANSFER MODULE]: Denied attachment {0}({1}) owner {2} not in region {3}", + so.Name, so.UUID, OwnerID, m_sceneName); + return false; + } + + if (!m_scene.AddSceneObject(so)) + { + m_log.DebugFormat( + "[ENTITY TRANSFER MODULE]: Problem adding scene object {0} {1} into {2} ", + so.Name, so.UUID, m_sceneName); + return false; + } + // foreign user AgentCircuitData aCircuit = m_scene.AuthenticateHandler.GetAgentCircuitData(OwnerID); if (aCircuit != null) @@ -683,9 +708,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer () => { string url = aCircuit.ServiceURLs["AssetServerURI"].ToString(); - // m_log.DebugFormat( - // "[HG ENTITY TRANSFER MODULE]: Incoming attachment {0} for HG user {1} with asset service {2}", - // so.Name, so.AttachedAvatar, url); + //m_log.DebugFormat( + // "[HG ENTITY TRANSFER MODULE]: Incoming attachment {0} for HG user {1} with asset service {2}", + // so.Name, so.AttachedAvatar, url); IDictionary ids = new Dictionary(); HGUuidGatherer uuidGatherer = new HGUuidGatherer(m_scene.AssetService, url, ids); @@ -696,9 +721,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer int tickStart = Util.EnvironmentTickCount(); uuidGatherer.GatherNext(); - // m_log.DebugFormat( - // "[HG ENTITY TRANSFER]: Gathered attachment asset uuid {0} for object {1} for HG user {2} took {3} ms with asset service {4}", - // nextUuid, so.Name, so.OwnerID, Util.EnvironmentTickCountSubtract(tickStart), url); + //m_log.DebugFormat( + // "[HG ENTITY TRANSFER]: Gathered attachment asset uuid {0} for object {1} for HG user {2} took {3} ms with asset service {4}", + // nextUuid, so.Name, so.OwnerID, Util.EnvironmentTickCountSubtract(tickStart), url); int ticksElapsed = Util.EnvironmentTickCountSubtract(tickStart); @@ -713,9 +738,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer } } - // m_log.DebugFormat( - // "[HG ENTITY TRANSFER]: Fetching {0} assets for attachment {1} for HG user {2} with asset service {3}", - // ids.Count, so.Name, so.OwnerID, url); + //m_log.DebugFormat( + // "[HG ENTITY TRANSFER]: Fetching {0} assets for attachment {1} for HG user {2} with asset service {3}", + // ids.Count, so.Name, so.OwnerID, url); foreach (UUID id in ids.Keys) { @@ -742,9 +767,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer aCircuit = null; uuidGatherer = null; - // m_log.DebugFormat( - // "[HG ENTITY TRANSFER MODULE]: Completed incoming attachment {0} for HG user {1} with asset server {2}", - // so.Name, so.OwnerID, url); + //m_log.DebugFormat( + // "[HG ENTITY TRANSFER MODULE]: Completed incoming attachment {0} for HG user {1} with asset server {2}", + // so.Name, so.OwnerID, url); }, OwnerID.ToString()); } @@ -792,6 +817,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer foreach (SceneObjectGroup defso in deftatt) { + if(defso.OwnerID.NotEqual(defsp.UUID)) + { + m_log.ErrorFormat( + "[HG TRANSFER MODULE] attachment {0}({1} owner {2} does not match HG avatarID {3}", + defso.Name, defso.UUID, defso.OwnerID, defsp.UUID); + continue; + } uuidGatherer.AddForInspection(defso); while (!uuidGatherer.Complete) { diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs index da2f4815f2..cd8e96457e 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs @@ -521,7 +521,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess if (!m_OutboundPermission && !UserManagementModule.IsLocalGridUser(sp.UUID)) { - if (sog.OwnerID == sp.UUID) + if (sog.OwnerID.Equals(sp.UUID)) return true; return false; } diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index fa25d67b0f..772e432314 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -993,25 +993,18 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess byte bRayEndIsIntersection = (byte)(RayEndIsIntersection ? 1 : 0); Vector3 pos; - bool single - = m_Scene.GetObjectsToRez( + bool single = m_Scene.GetObjectsToRez( rezAsset.Data, attachment, out objlist, out veclist, out bbox, out offsetHeight); + pos = m_Scene.GetNewRezLocation(RayStart, RayEnd, + RayTargetID, Quaternion.Identity, + BypassRayCast, bRayEndIsIntersection, true, + bbox, false); + if (single) - { - pos = m_Scene.GetNewRezLocation( - RayStart, RayEnd, RayTargetID, Quaternion.Identity, - BypassRayCast, bRayEndIsIntersection, true, bbox, false); pos.Z += offsetHeight; - } else - { - pos = m_Scene.GetNewRezLocation(RayStart, RayEnd, - RayTargetID, Quaternion.Identity, - BypassRayCast, bRayEndIsIntersection, true, - bbox, false); pos -= bbox / 2; - } int primcount = 0; if(attachment) @@ -1037,7 +1030,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess primcount += g.PrimCount; } - if (!m_Scene.Permissions.CanRezObject( primcount, remoteClient.AgentId, pos) && !attachment) @@ -1046,13 +1038,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess // have already removed the item from the folder // if it's no copy. // Put it back if it's not an attachment - // + if (item != null) { if (((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) && (!attachment)) remoteClient.SendBulkUpdateInventory(item); } - return null; } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/UserProfiles/LocalUserProfilesServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/UserProfiles/LocalUserProfilesServiceConnector.cs index b43d918aba..6c51362a74 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/UserProfiles/LocalUserProfilesServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/UserProfiles/LocalUserProfilesServiceConnector.cs @@ -49,9 +49,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Profile [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LocalUserProfilesServicesConnector")] public class LocalUserProfilesServicesConnector : ISharedRegionModule { - private static readonly ILog m_log = - LogManager.GetLogger( - MethodBase.GetCurrentMethod().DeclaringType); + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private Dictionary regions = new Dictionary(); diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs index 0be0676cdc..78abe33c20 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs @@ -43,9 +43,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LocalAuthorizationServicesConnector")] public class LocalAuthorizationServicesConnector : INonSharedRegionModule, IAuthorizationService { - private static readonly ILog m_log = - LogManager.GetLogger( - MethodBase.GetCurrentMethod().DeclaringType); + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private IAuthorizationService m_AuthorizationService; private Scene m_Scene; @@ -106,7 +104,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization if (!m_Enabled) return; - m_AuthorizationService = new AuthorizationService(m_AuthorizationConfig, m_Scene); + m_AuthorizationService = new AuthorizationService(m_AuthorizationConfig, scene); m_log.InfoFormat( "[AUTHORIZATION CONNECTOR]: Enabled local authorization for region {0}", diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateModule.cs index 890556c396..c5bdefaf6c 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateModule.cs @@ -152,7 +152,7 @@ namespace OpenSim.Region.CoreModules.World.Estate { foreach (Scene s in m_Scenes) { - if (s.RegionInfo.RegionID == RegionID) + if (s.RegionInfo.RegionID.Equals(RegionID)) return s; } diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 3332417978..904eae206f 100755 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -1424,24 +1424,28 @@ namespace OpenSim.Region.CoreModules.World.Land if (currentParcel == null) continue; + LandData currentParcelLandData = currentParcel.LandData; + if (currentParcelLandData == null) + continue; + // types - if (currentParcel.LandData.OwnerID.Equals(remote_client.AgentId)) + if (currentParcelLandData.OwnerID.Equals(remote_client.AgentId)) { //Owner Flag curByte = LandChannel.LAND_TYPE_OWNED_BY_REQUESTER; } - else if (currentParcel.LandData.IsGroupOwned && remote_client.IsGroupMember(currentParcel.LandData.GroupID)) + else if (currentParcelLandData.IsGroupOwned && remote_client.IsGroupMember(currentParcelLandData.GroupID)) { curByte = LandChannel.LAND_TYPE_OWNED_BY_GROUP; } - else if (currentParcel.LandData.SalePrice > 0 && - (currentParcel.LandData.AuthBuyerID.IsZero() || - currentParcel.LandData.AuthBuyerID.Equals(remote_client.AgentId))) + else if (currentParcelLandData.SalePrice > 0 && + (currentParcelLandData.AuthBuyerID.IsZero() || + currentParcelLandData.AuthBuyerID.Equals(remote_client.AgentId))) { //Sale type curByte = LandChannel.LAND_TYPE_IS_FOR_SALE; } - else if (currentParcel.LandData.OwnerID.IsZero()) + else if (currentParcelLandData.OwnerID.IsZero()) { //Public type curByte = LandChannel.LAND_TYPE_PUBLIC; // this does nothing, its zero diff --git a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs index a6e603e855..50d4123cf0 100644 --- a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs @@ -216,7 +216,7 @@ namespace OpenSim.Region.CoreModules.World.Land if (obj.IsSelected || obj.GetSittingAvatarsCount() > 0) parcelCounts.Selected += partCount; - if (obj.OwnerID == landData.OwnerID) + if (obj.OwnerID.Equals(landData.OwnerID)) parcelCounts.Owner += partCount; else if (!landData.GroupID.IsZero() && obj.GroupID.Equals(landData.GroupID)) parcelCounts.Group += partCount; diff --git a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs index 04eacbc9cf..612be55198 100755 --- a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs @@ -355,7 +355,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands return; Predicate searchPredicate - = so => so.OwnerID == ownerID && !so.IsAttachment; + = so => so.OwnerID.Equals(ownerID) && !so.IsAttachment; OutputSogsToConsole(searchPredicate, showFull); } @@ -762,7 +762,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands m_scene.ForEachSOG(delegate (SceneObjectGroup g) { - if (g.OwnerID == match && !g.IsAttachment) + if (g.OwnerID.Equals(match) && !g.IsAttachment) deletes.Add(g); }); diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index dde3b05e3a..34b5f40f9c 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -2060,7 +2060,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions return false; } - if(sog.OwnerID != sp.UUID && (perms & (uint)PermissionMask.Transfer) == 0) + if(sog.OwnerID.NotEqual(sp.UUID) && (perms & (uint)PermissionMask.Transfer) == 0) return false; return true; } diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index 5ea8027aad..df54111c0b 100755 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs @@ -1218,13 +1218,14 @@ namespace OpenSim.Region.CoreModules.World.Terrain } private List GetModifiedPatchesInViewDistance(PatchUpdates pups) - { + + { List ret = new List(); if (!pups.HasUpdates()) return ret; ScenePresence presence = pups.Presence; - if (presence == null) + if (presence == null || presence.IsDeleted) return ret; float minz = presence.AbsolutePosition.Z; @@ -1235,9 +1236,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain if (minz > 1500f) return ret; - int DrawDistance = (int)presence.DrawDistance; - - DrawDistance = DrawDistance / Constants.TerrainPatchSize; + int DrawDistance = (int)presence.DrawDistance / Constants.TerrainPatchSize; int testposX; int testposY; @@ -1253,8 +1252,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain testposX = (int)presence.AbsolutePosition.X / Constants.TerrainPatchSize; testposY = (int)presence.AbsolutePosition.Y / Constants.TerrainPatchSize; } - int limitX = (int)m_scene.RegionInfo.RegionSizeX / Constants.TerrainPatchSize; - int limitY = (int)m_scene.RegionInfo.RegionSizeY / Constants.TerrainPatchSize; + int limitX = pups.xsize; + int limitY = pups.ysize; // Compute the area of patches within our draw distance int startX = testposX - DrawDistance; @@ -1307,7 +1306,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain if (npatchs++ > 1024) { y = endY; - x = endX; + break; } } } diff --git a/OpenSim/Server/Handlers/Freeswitch/FreeswitchServerConnector.cs b/OpenSim/Server/Handlers/Freeswitch/FreeswitchServerConnector.cs index da56b8778d..0037c313b4 100644 --- a/OpenSim/Server/Handlers/Freeswitch/FreeswitchServerConnector.cs +++ b/OpenSim/Server/Handlers/Freeswitch/FreeswitchServerConnector.cs @@ -61,7 +61,7 @@ namespace OpenSim.Server.Handlers.Freeswitch string freeswitchService = serverConfig.GetString("LocalServiceModule", String.Empty); - if (freeswitchService == String.Empty) + if (freeswitchService.Length == 0) throw new Exception("No LocalServiceModule in config file"); Object[] args = new Object[] { config }; diff --git a/OpenSim/Server/Handlers/Friends/FriendServerConnector.cs b/OpenSim/Server/Handlers/Friends/FriendServerConnector.cs index b0e6c7dea3..75c4c7e5e9 100644 --- a/OpenSim/Server/Handlers/Friends/FriendServerConnector.cs +++ b/OpenSim/Server/Handlers/Friends/FriendServerConnector.cs @@ -50,7 +50,7 @@ namespace OpenSim.Server.Handlers.Friends string theService = serverConfig.GetString("LocalServiceModule", String.Empty); - if (theService == String.Empty) + if (theService.Length == 0) throw new Exception("No LocalServiceModule in config file"); Object[] args = new Object[] { config };