本文整理汇总了C#中OpenSim.Region.Framework.Scenes.Scene.GetSceneObjectPart方法的典型用法代码示例。如果您正苦于以下问题:C# Scene.GetSceneObjectPart方法的具体用法?C# Scene.GetSceneObjectPart怎么用?C# Scene.GetSceneObjectPart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Region.Framework.Scenes.Scene
的用法示例。
在下文中一共展示了Scene.GetSceneObjectPart方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CanViewNotecard
/// <summary>
/// Check whether the specified user can view the given notecard
/// </summary>
/// <param name="script"></param>
/// <param name="objectID"></param>
/// <param name="user"></param>
/// <param name="scene"></param>
/// <returns></returns>
private bool CanViewNotecard(UUID notecard, UUID objectID, UUID user, Scene scene)
{
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
if (objectID == UUID.Zero) // User inventory
{
CachedUserInfo userInfo =
scene.CommsManager.UserService.GetUserDetails(user);
if (userInfo == null)
{
m_log.ErrorFormat("[PERMISSIONS]: Could not find user {0} for view notecard check", user);
return false;
}
InventoryItemBase assetRequestItem = userInfo.FindItem(notecard);
if (assetRequestItem == null) // Library item
{
assetRequestItem = m_scene.CommsManager.LibraryRoot.FindItem(notecard);
if (assetRequestItem != null) // Implicitly readable
return true;
}
// Notecards are always readable unless no copy
//
if ((assetRequestItem.CurrentPermissions &
(uint)PermissionMask.Copy) !=
(uint)PermissionMask.Copy)
return false;
}
else // Prim inventory
{
SceneObjectPart part = scene.GetSceneObjectPart(objectID);
if (part == null)
return false;
if (part.OwnerID != user)
{
if (part.GroupID == UUID.Zero)
return false;
if( !IsAgentInGroupRole(part.GroupID, user, 0) )
return false;
}
if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
return false;
TaskInventoryItem ti = part.Inventory.GetInventoryItem(notecard);
if (ti == null)
return false;
if (ti.OwnerID != user)
{
if (ti.GroupID == UUID.Zero)
return false;
if( !IsAgentInGroupRole(ti.GroupID, user, 0) )
return false;
}
// Notecards are always readable unless no copy
//
if ((ti.CurrentPermissions &
(uint)PermissionMask.Copy) !=
(uint)PermissionMask.Copy)
return false;
}
return true;
}
示例2: CanMoveObject
private bool CanMoveObject(UUID objectID, UUID moverID, Scene scene)
{
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions)
{
SceneObjectPart part = scene.GetSceneObjectPart(objectID);
if (part.OwnerID != moverID)
{
if (part.ParentGroup != null && !part.ParentGroup.IsDeleted)
{
if (part.ParentGroup.IsAttachment)
return false;
}
}
return m_bypassPermissionsValue;
}
bool permission = GenericObjectPermission(moverID, objectID, true, (uint)PermissionMask.Move).Success;
if (!permission)
{
if (!m_scene.Entities.ContainsKey(objectID))
{
return false;
}
// The client
// may request to edit linked parts, and therefore, it needs
// to also check for SceneObjectPart
// If it's not an object, we cant edit it.
if ((!(m_scene.Entities[objectID] is SceneObjectGroup)))
{
return false;
}
SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objectID];
if (m_scene.RegionInfo.Product == ProductRulesUse.PlusUse)
{
// On a Plus region, only the EO (InWorldz Mainland) can move objects owned by that EO.
if (task.OwnerID == moverID)
return true;
if (m_scene.IsEstateOwner(task.OwnerID))
return false;
}
// Estate managers and land owners
if (m_scene.IsLandOwner(moverID, task.AbsolutePosition))
{
permission = true;
}
// Note: ObjectManipulate has *nothing* to do with the current parcel.
// ObjectManipulate refers to the current object, and if it is DEEDED to this group.
// It means you can manipulate GROUP-OWNED objects.
if ((task.OwnerID == task.GroupID) && IsAgentInGroupRole(task.GroupID, moverID, (ulong)GroupPowers.ObjectManipulate))
{
permission = true;
}
// Anyone can move
if ((task.RootPart.EveryoneMask & PERM_MOVE) != 0)
permission = true;
// Locked
if ((task.RootPart.OwnerMask & PERM_LOCKED) == 0)
permission = false;
}
else
{
bool locked = false;
if (!m_scene.Entities.ContainsKey(objectID))
{
return false;
}
// If it's not an object, we cant edit it.
if ((!(m_scene.Entities[objectID] is SceneObjectGroup)))
{
return false;
}
SceneObjectGroup group = (SceneObjectGroup)m_scene.Entities[objectID];
UUID objectOwner = group.OwnerID;
locked = ((group.RootPart.OwnerMask & PERM_LOCKED) == 0);
// This is an exception to the generic object permission.
// Administrators who lock their objects should not be able to move them,
// however generic object permission should return true.
// This keeps locked objects from being affected by random click + drag actions by accident
// and allows the administrator to grab or delete a locked object.
// Administrators and estate managers are still able to click+grab locked objects not
// owned by them in the scene
// This is by design.
if (locked && (moverID == objectOwner))
return false;
//.........这里部分代码省略.........
示例3: CanViewScript
/// <summary>
/// Check whether the specified user can view the given script
/// </summary>
/// <param name="script"></param>
/// <param name="objectID"></param>
/// <param name="user"></param>
/// <param name="scene"></param>
/// <returns></returns>
private bool CanViewScript(UUID script, UUID objectID, UUID user, Scene scene)
{
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
if (objectID == UUID.Zero) // User inventory
{
CachedUserInfo userInfo =
scene.CommsManager.UserService.GetUserDetails(user);
if (userInfo == null)
{
m_log.ErrorFormat("[PERMISSIONS]: Could not find user {0} for administrator check", user);
return false;
}
InventoryItemBase assetRequestItem = userInfo.FindItem(script);
if (assetRequestItem == null) // Library item
{
assetRequestItem = m_scene.CommsManager.LibraryRoot.FindItem(script);
if (assetRequestItem != null) // Implicitly readable
return true;
}
// SL is rather harebrained here. In SL, a script you
// have mod/copy no trans is readable. This subverts
// permissions, but is used in some products, most
// notably Hippo door plugin and HippoRent 5 networked
// prim counter.
// To enable this broken SL-ism, remove Transfer from
// the below expressions.
// Trying to improve on SL perms by making a script
// readable only if it's really full perms
//
if ((assetRequestItem.CurrentPermissions &
((uint)PermissionMask.Modify |
(uint)PermissionMask.Copy |
(uint)PermissionMask.Transfer)) !=
((uint)PermissionMask.Modify |
(uint)PermissionMask.Copy |
(uint)PermissionMask.Transfer))
return false;
}
else // Prim inventory
{
SceneObjectPart part = scene.GetSceneObjectPart(objectID);
if (part == null)
return false;
if (part.OwnerID != user)
{
if (part.GroupID == UUID.Zero)
return false;
if( !IsAgentInGroupRole(part.GroupID, user, 0) )
return false;
if ((part.GroupMask & (uint)PermissionMask.Modify) == 0)
return false;
} else {
if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
return false;
}
TaskInventoryItem ti = part.Inventory.GetInventoryItem(script);
if (ti == null)
return false;
if (ti.OwnerID != user)
{
if (ti.GroupID == UUID.Zero)
return false;
if( !IsAgentInGroupRole(ti.GroupID, user, 0) )
return false;
}
// Require full perms
if ((ti.CurrentPermissions &
((uint)PermissionMask.Modify |
(uint)PermissionMask.Copy |
(uint)PermissionMask.Transfer)) !=
((uint)PermissionMask.Modify |
(uint)PermissionMask.Copy |
(uint)PermissionMask.Transfer))
return false;
}
return true;
//.........这里部分代码省略.........
示例4: Populate
public void Populate(Scene scene)
{
SceneObjectPart part = scene.GetSceneObjectPart(Key);
if (part == null) // Avatar, maybe?
{
ScenePresence presence = scene.GetScenePresence(Key);
if (presence == null)
return;
Name = presence.Firstname + " " + presence.Lastname;
Owner = Key;
Position = new LSL_Types.Vector3(
presence.AbsolutePosition.X,
presence.AbsolutePosition.Y,
presence.AbsolutePosition.Z);
Rotation = new LSL_Types.Quaternion(
presence.Rotation.X,
presence.Rotation.Y,
presence.Rotation.Z,
presence.Rotation.W);
Velocity = new LSL_Types.Vector3(
presence.Velocity.X,
presence.Velocity.Y,
presence.Velocity.Z);
Type = 0x01; // Avatar
if (presence.Velocity != Vector3.Zero)
Type |= 0x02; // Active
Group = presence.ControllingClient.ActiveGroupId;
return;
}
part=part.ParentGroup.RootPart; // We detect objects only
LinkNum = 0; // Not relevant
Group = part.GroupID;
Name = part.Name;
Owner = part.OwnerID;
if (part.Velocity == Vector3.Zero)
Type = 0x04; // Passive
else
Type = 0x02; // Passive
foreach (SceneObjectPart p in part.ParentGroup.ChildrenList)
{
if (p.Inventory.ContainsScripts())
{
Type |= 0x08; // Scripted
break;
}
}
Position = new LSL_Types.Vector3(part.AbsolutePosition.X,
part.AbsolutePosition.Y,
part.AbsolutePosition.Z);
Quaternion wr = part.ParentGroup.GroupRotation;
Rotation = new LSL_Types.Quaternion(wr.X, wr.Y, wr.Z, wr.W);
Velocity = new LSL_Types.Vector3(part.Velocity.X,
part.Velocity.Y,
part.Velocity.Z);
}
示例5: CanObjectEnter
private bool CanObjectEnter(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene)
{
if (newPoint.X < -1f || newPoint.X > (scene.RegionInfo.RegionSizeX + 1) ||
newPoint.Y < -1f || newPoint.Y > (scene.RegionInfo.RegionSizeY) )
return true;
SceneObjectPart obj = scene.GetSceneObjectPart(objectID);
if (obj == null)
return false;
// Prim counts are determined by the location of the root prim. if we're
// moving a child prim, just let it pass
if (!obj.IsRoot)
{
return true;
}
ILandObject newParcel = scene.LandChannel.GetLandObject(newPoint.X, newPoint.Y);
if (newParcel == null)
return true;
Vector3 oldPoint = obj.GroupPosition;
ILandObject oldParcel = scene.LandChannel.GetLandObject(oldPoint.X, oldPoint.Y);
// The prim hasn't crossed a region boundry so we don't need to worry
// about prim counts here
if(oldParcel != null && oldParcel.Equals(newParcel))
{
return true;
}
int objectCount = obj.ParentGroup.PrimCount;
int usedPrims = newParcel.PrimCounts.Total;
int simulatorCapacity = newParcel.GetSimulatorMaxPrimCount();
// TODO: Add Special Case here for temporary prims
string response = DoCommonChecks(objectCount, obj.OwnerID, newParcel, scene);
if (response != null)
{
m_dialogModule.SendAlertToUser(obj.OwnerID, response);
return false;
}
return true;
}
示例6: CanMoveObject
private bool CanMoveObject(UUID objectID, UUID moverID, Scene scene)
{
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions)
{
SceneObjectPart part = scene.GetSceneObjectPart(objectID);
if (part.OwnerID != moverID)
{
if (!part.ParentGroup.IsDeleted)
{
if (part.ParentGroup.IsAttachment)
return false;
}
}
return m_bypassPermissionsValue;
}
bool permission = GenericObjectPermission(moverID, objectID, true);
if (!permission)
{
if (!m_scene.Entities.ContainsKey(objectID))
{
return false;
}
// The client
// may request to edit linked parts, and therefore, it needs
// to also check for SceneObjectPart
// If it's not an object, we cant edit it.
if ((!(m_scene.Entities[objectID] is SceneObjectGroup)))
{
return false;
}
SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objectID];
// UUID taskOwner = null;
// Added this because at this point in time it wouldn't be wise for
// the administrator object permissions to take effect.
// UUID objectOwner = task.OwnerID;
// Anyone can move
if ((task.RootPart.EveryoneMask & PERM_MOVE) != 0)
permission = true;
// Locked
if ((task.RootPart.OwnerMask & PERM_LOCKED) == 0)
permission = false;
}
else
{
bool locked = false;
if (!m_scene.Entities.ContainsKey(objectID))
{
return false;
}
// If it's not an object, we cant edit it.
if ((!(m_scene.Entities[objectID] is SceneObjectGroup)))
{
return false;
}
SceneObjectGroup group = (SceneObjectGroup)m_scene.Entities[objectID];
UUID objectOwner = group.OwnerID;
locked = ((group.RootPart.OwnerMask & PERM_LOCKED) == 0);
// This is an exception to the generic object permission.
// Administrators who lock their objects should not be able to move them,
// however generic object permission should return true.
// This keeps locked objects from being affected by random click + drag actions by accident
// and allows the administrator to grab or delete a locked object.
// Administrators and estate managers are still able to click+grab locked objects not
// owned by them in the scene
// This is by design.
if (locked && (moverID == objectOwner))
return false;
}
return permission;
}
示例7: CanViewNotecard
/// <summary>
/// Check whether the specified user can view the given notecard
/// </summary>
/// <param name="script"></param>
/// <param name="objectID"></param>
/// <param name="user"></param>
/// <param name="scene"></param>
/// <returns></returns>
private bool CanViewNotecard(UUID notecard, UUID objectID, UUID user, Scene scene)
{
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
if (objectID == UUID.Zero) // User inventory
{
IInventoryService invService = m_scene.InventoryService;
InventoryItemBase assetRequestItem = new InventoryItemBase(notecard, user);
assetRequestItem = invService.GetItem(assetRequestItem);
if (assetRequestItem == null && LibraryRootFolder != null) // Library item
{
assetRequestItem = LibraryRootFolder.FindItem(notecard);
if (assetRequestItem != null) // Implicitly readable
return true;
}
// Notecards are always readable unless no copy
//
if ((assetRequestItem.CurrentPermissions &
(uint)PermissionMask.Copy) !=
(uint)PermissionMask.Copy)
return false;
}
else // Prim inventory
{
SceneObjectPart part = scene.GetSceneObjectPart(objectID);
if (part == null)
return false;
if (part.OwnerID != user)
{
if (part.GroupID == UUID.Zero)
return false;
if (!IsGroupMember(part.GroupID, user, 0))
return false;
}
if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
return false;
TaskInventoryItem ti = part.Inventory.GetInventoryItem(notecard);
if (ti == null)
return false;
if (ti.OwnerID != user)
{
if (ti.GroupID == UUID.Zero)
return false;
if (!IsGroupMember(ti.GroupID, user, 0))
return false;
}
// Notecards are always readable unless no copy
//
if ((ti.CurrentPermissions &
(uint)PermissionMask.Copy) !=
(uint)PermissionMask.Copy)
return false;
}
return true;
}
示例8: CanRunScript
private bool CanRunScript(UUID script, UUID objectID, UUID user, Scene scene)
{
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
SceneObjectPart part = scene.GetSceneObjectPart(objectID);
if (part == null)
return false;
ILandObject parcel = scene.LandChannel.GetLandObject(part.AbsolutePosition.X, part.AbsolutePosition.Y);
if (parcel == null)
return false;
if ((parcel.LandData.Flags & (int)ParcelFlags.AllowOtherScripts) != 0)
return true;
if ((parcel.LandData.Flags & (int)ParcelFlags.AllowGroupScripts) == 0)
{
//Only owner can run then
return GenericParcelOwnerPermission(user, parcel, 0);
}
return GenericParcelOwnerPermission(user, parcel, (ulong)GroupPowers.None);
}
示例9: CanObjectEnter
private bool CanObjectEnter(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene)
{
SceneObjectPart obj = scene.GetSceneObjectPart(objectID);
Vector3 oldPoint = obj.GroupPosition;
int objectCount = obj.ParentGroup.PrimCount;
ILandObject oldParcel = scene.LandChannel.GetLandObject(oldPoint.X, oldPoint.Y);
ILandObject newParcel = scene.LandChannel.GetLandObject(newPoint.X, newPoint.Y);
// newParcel will be null only if it outside of our current region. If this is the case, then the
// receiving permissions will perform the check.
if (newParcel == null)
return true;
// The prim hasn't crossed a region boundry so we don't need to worry
// about prim counts here
if(oldParcel.Equals(newParcel))
{
return true;
}
// Prim counts are determined by the location of the root prim. if we're
// moving a child prim, just let it pass
if(!obj.IsRoot)
{
return true;
}
// TODO: Add Special Case here for temporary prims
int usedPrims = newParcel.PrimCounts.Total;
int simulatorCapacity = newParcel.GetSimulatorMaxPrimCount();
if (objectCount + usedPrims > simulatorCapacity)
{
m_dialogModule.SendAlertToUser(obj.OwnerID, "Unable to move object because the destination parcel is too full");
return false;
}
return true;
}
示例10: CanObjectEnter
private bool CanObjectEnter(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene)
{
SceneObjectPart obj = scene.GetSceneObjectPart(objectID);
Vector3 oldPoint = obj.GroupPosition;
int objectCount = obj.ParentGroup.PrimCount;
ILandObject oldParcel = scene.LandChannel.GetLandObject(oldPoint.X, oldPoint.Y);
ILandObject newParcel = scene.LandChannel.GetLandObject(newPoint.X, newPoint.Y);
// newParcel will be null only if it outside of our current region. If this is the case, then the
// receiving permissions will perform the check.
if (newParcel == null)
return true;
// The prim hasn't crossed a region boundary so we don't need to worry
// about prim counts here
if(oldParcel.Equals(newParcel))
{
return true;
}
// Prim counts are determined by the location of the root prim. if we're
// moving a child prim, just let it pass
if(!obj.IsRoot)
{
return true;
}
// TODO: Add Special Case here for temporary prims
string response = DoCommonChecks(objectCount, obj.OwnerID, newParcel, scene);
if (response != null)
{
m_dialogModule.SendAlertToUser(obj.OwnerID, response);
return false;
}
return true;
}
示例11: SyncInfoFactory
public static SyncInfoBase SyncInfoFactory(UUID uuid, Scene scene, long lastUpdateTimeStamp, string syncID)
{
ScenePresence sp = scene.GetScenePresence(uuid);
if (sp != null)
{
return new SyncInfoPresence(sp, lastUpdateTimeStamp, syncID, scene);
}
SceneObjectPart sop = scene.GetSceneObjectPart(uuid);
if (sop != null)
{
return new SyncInfoPrim(sop, lastUpdateTimeStamp, syncID, scene);
}
DebugLog.WarnFormat("{0}: SyncInfoFactory could not find uuid {1} in local scene.", LogHeader, uuid);
return null;
}
示例12: DataReceived
/// <summary>
/// Called once new texture data has been received for this updater.
/// </summary>
public void DataReceived(byte[] data, Scene scene)
{
SceneObjectPart part = scene.GetSceneObjectPart(PrimID);
if (data == null)
{
string msg =
String.Format("DynamicTextureModule: Error preparing image using URL {0}", Url);
scene.SimChat(Utils.StringToBytes(msg), ChatTypeEnum.Say,
0, part.ParentGroup.RootPart.AbsolutePosition, part.Name, part.UUID, false);
return;
}
byte[] assetData;
AssetBase oldAsset = null;
if (BlendWithOldTexture)
{
UUID lastTextureID = part.Shape.Textures.DefaultTexture.TextureID;
oldAsset = scene.CommsManager.AssetCache.GetAsset(lastTextureID, AssetRequestInfo.InternalRequest());
if (oldAsset != null)
{
assetData = BlendTextures(data, oldAsset.Data, SetNewFrontAlpha, FrontAlpha);
}
else
{
assetData = new byte[data.Length];
Array.Copy(data, assetData, data.Length);
}
}
else
{
assetData = new byte[data.Length];
Array.Copy(data, assetData, data.Length);
}
// Create a new asset for user
AssetBase asset = new AssetBase();
asset.FullID = UUID.Random();
asset.Data = assetData;
asset.Name = "DynamicImage" + Util.RandomClass.Next(1, 10000);
asset.Type = 0;
asset.Description = "dynamic image";
asset.Local = false;
asset.Temporary = true;
scene.CommsManager.AssetCache.AddAsset(asset, AssetRequestInfo.InternalRequest());
LastAssetID = asset.FullID;
IJ2KDecoder cacheLayerDecode = scene.RequestModuleInterface<IJ2KDecoder>();
if (cacheLayerDecode != null)
{
cacheLayerDecode.Decode(asset.FullID, asset.Data);
}
cacheLayerDecode = null;
// mostly keep the values from before
Primitive.TextureEntry tmptex = part.Shape.Textures;
// remove the old asset from the cache
UUID oldID = tmptex.DefaultTexture.TextureID;
tmptex.DefaultTexture.TextureID = asset.FullID;
// I'm pretty sure we always want to force this to true
// I'm pretty sure noone whats to set fullbright true if it wasn't true before.
// tmptex.DefaultTexture.Fullbright = true;
part.Shape.Textures = tmptex;
part.ScheduleFullUpdate();
}
示例13: SimChat
public void SimChat(string message, ChatTypeEnum type, int channel, Vector3 fromPos, string fromName,
UUID fromID, bool fromAgent, bool broadcast, float range, UUID ToAgentID, Scene scene)
{
OSChatMessage args = new OSChatMessage();
args.Message = message;
args.Channel = channel;
args.Type = type;
args.Position = fromPos;
args.Range = range;
args.SenderUUID = fromID;
args.Scene = scene;
args.ToAgentID = ToAgentID;
if (fromAgent)
{
ScenePresence user = scene.GetScenePresence(fromID);
if (user != null)
args.Sender = user.ControllingClient;
}
else
{
SceneObjectPart obj = scene.GetSceneObjectPart(fromID);
args.SenderObject = obj;
}
args.From = fromName;
//args.
if (broadcast)
{
OnChatBroadcast(scene, args);
scene.EventManager.TriggerOnChatBroadcast(scene, args);
}
else
{
OnChatFromWorld(scene, args);
scene.EventManager.TriggerOnChatFromWorld(scene, args);
}
}
示例14: CanEditNotecard
/// <summary>
/// Check whether the specified user can edit the given notecard
/// </summary>
/// <param name="notecard"></param>
/// <param name="objectID"></param>
/// <param name="user"></param>
/// <param name="scene"></param>
/// <returns></returns>
private bool CanEditNotecard(UUID notecard, UUID objectID, UUID user, Scene scene)
{
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
if (objectID == UUID.Zero) // User inventory
{
IInventoryService invService = m_scene.InventoryService;
InventoryItemBase assetRequestItem = new InventoryItemBase(notecard, user);
assetRequestItem = invService.GetItem(assetRequestItem);
if (assetRequestItem == null && LibraryRootFolder != null) // Library item
{
assetRequestItem = LibraryRootFolder.FindItem(notecard);
if (assetRequestItem != null) // Implicitly readable
return true;
}
// Notecards must be both mod and copy to be saveable
// This is because of they're not copy, you can't read
// them, and if they're not mod, well, then they're
// not mod. Duh.
//
if ((assetRequestItem.CurrentPermissions &
((uint)PermissionMask.Modify |
(uint)PermissionMask.Copy)) !=
((uint)PermissionMask.Modify |
(uint)PermissionMask.Copy))
return false;
}
else // Prim inventory
{
SceneObjectPart part = scene.GetSceneObjectPart(objectID);
if (part == null)
return false;
if (part.OwnerID != user)
{
if (part.GroupID == UUID.Zero)
return false;
if (!IsGroupMember(part.GroupID, user, 0))
return false;
if ((part.GroupMask & (uint)PermissionMask.Modify) == 0)
return false;
}
else
{
if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
return false;
}
TaskInventoryItem ti = part.Inventory.GetInventoryItem(notecard);
if (ti == null)
return false;
if (ti.OwnerID != user)
{
if (ti.GroupID == UUID.Zero)
return false;
if (!IsGroupMember(ti.GroupID, user, 0))
return false;
}
// Require full perms
if ((ti.CurrentPermissions &
((uint)PermissionMask.Modify |
(uint)PermissionMask.Copy)) !=
((uint)PermissionMask.Modify |
(uint)PermissionMask.Copy))
return false;
}
return true;
}
示例15: Script
internal Script(string script, UUID scriptID, uint localID, IConfigSource config, Scene scene, PolicyLevel policy, ScriptAccessor scriptAccessor, bool error2Console)
{
m_hostSOP = scene.GetSceneObjectPart(localID);
m_asset = m_hostSOP.Inventory.GetInventoryItem(scriptID);
m_god = scene.UserAccountService.GetUserAccount(UUID.Zero, m_hostSOP.OwnerID);
m_name = (m_god.Name + "." + m_hostSOP.Name + "." + m_asset.Name).Replace(" ", "");
m_name = scriptAccessor.AddScript(this);
m_scene = scene;
m_config = config;
m_policy = policy;
m_error2Console = config.Configs["MRM"].GetBoolean("ErrorToConsole", true);
m_scriptAccessor = scriptAccessor;
m_errors = new ArrayList();
SEUser securityUser = new SEUser(m_god.PrincipalID, m_god.Name, this);
m_creds = new SecurityCredential(securityUser, m_scene);
ScriptText = script;
}