cosmetics

This commit is contained in:
UbitUmarov
2022-09-24 17:14:46 +01:00
parent 8fd4781c02
commit 5ef7878613
18 changed files with 123 additions and 85 deletions

View File

@@ -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,

View File

@@ -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);

View File

@@ -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,

View File

@@ -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;

View File

@@ -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;

View File

@@ -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<UUID, sbyte> ids = new Dictionary<UUID, sbyte>();
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)
{

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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<UUID, Scene> regions = new Dictionary<UUID, Scene>();

View File

@@ -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}",

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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;

View File

@@ -355,7 +355,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
return;
Predicate<SceneObjectGroup> 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);
});

View File

@@ -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;
}

View File

@@ -1218,13 +1218,14 @@ namespace OpenSim.Region.CoreModules.World.Terrain
}
private List<PatchesToSend> GetModifiedPatchesInViewDistance(PatchUpdates pups)
{
{
List<PatchesToSend> ret = new List<PatchesToSend>();
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;
}
}
}