本文整理汇总了C#中OpenMetaverse.ParcelManager.ParcelAccessEntry类的典型用法代码示例。如果您正苦于以下问题:C# ParcelManager.ParcelAccessEntry类的具体用法?C# ParcelManager.ParcelAccessEntry怎么用?C# ParcelManager.ParcelAccessEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ParcelManager.ParcelAccessEntry类属于OpenMetaverse命名空间,在下文中一共展示了ParcelManager.ParcelAccessEntry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: setup
public void setup()
{
// setup LandData object
this.land = new LandData();
this.land.AABBMax = new Vector3(0, 0, 0);
this.land.AABBMin = new Vector3(128, 128, 128);
this.land.Area = 128;
this.land.AuctionID = 0;
this.land.AuthBuyerID = new UUID();
this.land.Category = ParcelCategory.Residential;
this.land.ClaimDate = 0;
this.land.ClaimPrice = 0;
this.land.GlobalID = new UUID("54ff9641-dd40-4a2c-b1f1-47dd3af24e50");
this.land.GroupID = new UUID("d740204e-bbbf-44aa-949d-02c7d739f6a5");
this.land.GroupPrims = 0;
this.land.Description = "land data to test LandDataSerializer";
this.land.Flags = (uint)(ParcelFlags.AllowDamage | ParcelFlags.AllowVoiceChat);
this.land.LandingType = (byte)LandingType.Direct;
this.land.Name = "LandDataSerializerTest Land";
this.land.Status = ParcelStatus.Leased;
this.land.LocalID = 0;
this.land.MediaAutoScale = (byte)0x01;
this.land.MediaID = new UUID("d4452578-2f25-4b97-a81b-819af559cfd7");
this.land.MediaURL = "http://videos.opensimulator.org/bumblebee.mp4";
this.land.OwnerID = new UUID("1b8eedf9-6d15-448b-8015-24286f1756bf");
this.landWithParcelAccessList = this.land.Copy();
this.landWithParcelAccessList.ParcelAccessList.Clear();
ParcelManager.ParcelAccessEntry pae0 = new ParcelManager.ParcelAccessEntry();
pae0.AgentID = new UUID("62d65d45-c91a-4f77-862c-46557d978b6c");
pae0.Flags = AccessList.Ban;
pae0.Time = new DateTime(2009, 10, 01);
this.landWithParcelAccessList.ParcelAccessList.Add(pae0);
ParcelManager.ParcelAccessEntry pae1 = new ParcelManager.ParcelAccessEntry();
pae1.AgentID = new UUID("ec2a8d18-2378-4fe0-8b68-2a31b57c481e");
pae1.Flags = AccessList.Access;
pae1.Time = new DateTime(2010, 10, 20);
this.landWithParcelAccessList.ParcelAccessList.Add(pae1);
}
示例2: BuildParcelAccessList
private void BuildParcelAccessList(LandData LandData)
{
List<string> Query = GD.Query("ParcelID", LandData.GlobalID, "parcelaccess", "AccessID, Flags, Time");
int i = 0;
int dataCount = 0;
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
foreach (string retVal in Query)
{
if (dataCount == 0)
entry.AgentID = UUID.Parse(Query[i]);
if (dataCount == 1)
entry.Flags = (AccessList)int.Parse(Query[i]);
if (dataCount == 2)
entry.Time = new DateTime(long.Parse(Query[i]));
dataCount++;
i++;
if (dataCount == 3)
{
LandData.ParcelAccessList.Add(entry);
entry = new ParcelManager.ParcelAccessEntry();
dataCount = 0;
}
}
}
示例3: BuildLandAccessData
///<summary>
///</summary>
///<param name = "row"></param>
///<returns></returns>
private static ParcelManager.ParcelAccessEntry BuildLandAccessData(IDataReader row)
{
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry
{
AgentID = DBGuid.FromDB(row["AccessUUID"]),
Flags = (AccessList) Convert.ToInt32(row["Flags"]),
Time = new DateTime()
};
return entry;
}
示例4: IsRestrictedFromLand
public bool IsRestrictedFromLand(UUID avatar)
{
if (m_scene.Permissions.IsAdministrator(avatar))
return false;
if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0)
{
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
entry.AgentID = avatar;
entry.Flags = AccessList.Access;
entry.Time = new DateTime();
entry = LandData.ParcelAccessList.Find(delegate(ParcelManager.ParcelAccessEntry pae)
{
if (entry.AgentID == pae.AgentID && entry.Flags == pae.Flags)
return true;
return false;
});
//If they are not on the access list and are not the owner
if (entry.AgentID == avatar && LandData.OwnerID != avatar)
{
if ((LandData.Flags & (uint)ParcelFlags.UseAccessGroup) > 0)
{
IScenePresence SP = m_scene.GetScenePresence (avatar);
if (SP != null && LandData.GroupID == SP.ControllingClient.ActiveGroupId)
{
//They are a part of the group, let them in
return false;
}
else
{
//They are not allowed in this parcel, but not banned, so lets send them a notice about this parcel
return true;
}
}
else
{
//No group checking, not on the access list, restricted
return true;
}
}
else
{
//If it does, we need to check the time
entry = LandData.ParcelAccessList.Find(delegate (ParcelManager.ParcelAccessEntry item)
{
if(item.AgentID == entry.AgentID && item.Flags == entry.Flags)
return true;
return false;
});
if (entry.Time.Ticks < DateTime.Now.Ticks)
{
//Time expired, remove them
LandData.ParcelAccessList.Remove(entry);
return true;
}
}
}
return false;
}
示例5: ParcelBuyPass
public void ParcelBuyPass(IClientAPI client, UUID agentID, int ParcelLocalID)
{
ILandObject landObject = GetLandObject(ParcelLocalID);
if (landObject == null)
{
client.SendAlertMessage("Could not find the parcel you are currently on.");
return;
}
if (landObject.IsBannedFromLand(agentID))
{
client.SendAlertMessage("You cannot buy a pass as you are banned from this parcel.");
return;
}
IMoneyModule module = m_scene.RequestModuleInterface<IMoneyModule>();
if (module != null)
if (
!module.Transfer(landObject.LandData.OwnerID, client.AgentId, landObject.LandData.PassPrice,
"Parcel Pass"))
{
client.SendAlertMessage("You do not have enough funds to complete this transaction.");
return;
}
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry
{
AgentID = agentID,
Flags = AccessList.Access,
Time = DateTime.Now.AddHours(landObject.LandData.PassHours)
};
landObject.LandData.ParcelAccessList.Add(entry);
client.SendAgentAlertMessage("You have been added to the parcel access list.", false);
}
示例6: BuildLandAccessData
/// <summary>
/// Builds the landaccess data from a data record.
/// </summary>
/// <param name="row">datarecord with landaccess data</param>
/// <returns></returns>
private static ParcelManager.ParcelAccessEntry BuildLandAccessData(IDataRecord row)
{
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
entry.AgentID = new UUID((Guid)row["AccessUUID"]);
entry.Flags = (AccessList)Convert.ToInt32(row["Flags"]);
entry.Time = new DateTime();
return entry;
}
示例7: buildLandAccessData
/// <summary>
/// Build a land access entry from the persisted data.
/// </summary>
/// <param name="row"></param>
/// <returns></returns>
private ParcelManager.ParcelAccessEntry buildLandAccessData(DataRow row)
{
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
entry.AgentID = new UUID((string) row["AccessUUID"]);
entry.Flags = (AccessList) row["Flags"];
entry.Time = new DateTime();
return entry;
}
示例8: IsRestrictedFromLand
public bool IsRestrictedFromLand(UUID avatar)
{
if (m_scene.Permissions.IsAdministrator(avatar))
return false;
if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0)
{
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
entry.AgentID = avatar;
entry.Flags = AccessList.Access;
entry.Time = new DateTime();
//If they are not on the access list and are not the owner
if (!LandData.ParcelAccessList.Contains(entry) && LandData.OwnerID != avatar)
{
//They are not allowed in this parcel, but not banned, so lets send them a notice about this parcel
return true;
}
}
return false;
}
示例9: llAddToLandBanList
public void llAddToLandBanList(string avatar, double hours)
{
m_host.AddScriptLPS(1);
UUID key;
ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned))
{
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
if (UUID.TryParse(avatar, out key))
{
if (land.LandData.ParcelAccessList.FindIndex(
delegate(ParcelManager.ParcelAccessEntry e)
{
if (e.AgentID == key && e.Flags == AccessList.Ban)
return true;
return false;
}) == -1)
{
entry.AgentID = key;
entry.Flags = AccessList.Ban;
entry.Time = DateTime.Now.AddHours(hours);
land.LandData.ParcelAccessList.Add(entry);
}
}
}
ScriptSleep(100);
}
示例10: UpdateAccessList
public void UpdateAccessList(uint flags, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client)
{
if (entries.Count == 1 && entries[0].AgentID == UUID.Zero)
entries.Clear();
#if (!ISWIN)
List<ParcelManager.ParcelAccessEntry> toRemove = new List<ParcelManager.ParcelAccessEntry>();
foreach (ParcelManager.ParcelAccessEntry entry in LandData.ParcelAccessList)
{
if (entry.Flags == (AccessList) flags) toRemove.Add(entry);
}
#else
List<ParcelManager.ParcelAccessEntry> toRemove =
LandData.ParcelAccessList.Where(entry => entry.Flags == (AccessList) flags).ToList();
#endif
foreach (ParcelManager.ParcelAccessEntry entry in toRemove)
{
LandData.ParcelAccessList.Remove(entry);
}
#if (!ISWIN)
foreach (ParcelManager.ParcelAccessEntry entry in entries)
{
ParcelManager.ParcelAccessEntry temp = new ParcelManager.ParcelAccessEntry
{
AgentID = entry.AgentID,
Time = DateTime.MaxValue,
Flags = (AccessList) flags
};
if (!LandData.ParcelAccessList.Contains(temp))
{
LandData.ParcelAccessList.Add(temp);
}
}
#else
foreach (ParcelManager.ParcelAccessEntry temp in entries.Select(entry => new ParcelManager.ParcelAccessEntry
{
AgentID = entry.AgentID,
Time = DateTime.MaxValue,
Flags = (AccessList) flags
}).Where(temp => !LandData.ParcelAccessList.Contains(temp)))
{
LandData.ParcelAccessList.Add(temp);
}
#endif
m_parcelManagementModule.UpdateLandObject(this);
}
示例11: updateAccessList
public void updateAccessList(uint flags, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client)
{
LandData newData = landData.Copy();
if (entries.Count == 1 && entries[0].AgentID == UUID.Zero)
{
entries.Clear();
}
List<ParcelManager.ParcelAccessEntry> toRemove = new List<ParcelManager.ParcelAccessEntry>();
foreach (ParcelManager.ParcelAccessEntry entry in newData.ParcelAccessList)
{
if (entry.Flags == (AccessList)flags)
{
toRemove.Add(entry);
}
}
foreach (ParcelManager.ParcelAccessEntry entry in toRemove)
{
newData.ParcelAccessList.Remove(entry);
}
foreach (ParcelManager.ParcelAccessEntry entry in entries)
{
ParcelManager.ParcelAccessEntry temp = new ParcelManager.ParcelAccessEntry();
temp.AgentID = entry.AgentID;
temp.Time = new DateTime(); //Pointless? Yes.
temp.Flags = (AccessList)flags;
if (!newData.ParcelAccessList.Contains(temp))
{
newData.ParcelAccessList.Add(temp);
}
}
m_log.InfoFormat("[LAND]: updateAccessList for land parcel {0} [{1}] flags {2} -> {3} by {4}",
newData.LocalID, newData.GlobalID, landData.Flags.ToString("X8"), newData.Flags.ToString("X8"), remote_client.Name);
m_scene.LandChannel.UpdateLandObject(landData.LocalID, newData);
}
示例12: isRestrictedFromLand
public bool isRestrictedFromLand(UUID avatar)
{
if (m_scene.Permissions.BypassPermissions())
return false;
// Is everyone allowed in? Most common case, just permit entry.
if ((landData.Flags & (uint)ParcelFlags.UseAccessList) == 0)
return false;
// Land owner always has access. Just permit entry.
if (landData.OwnerID == avatar)
return false;
// Not public access, not the owner. Check other overrides.
// Check if this user is listed with access.
if (landData.ParcelAccessList.Count != 0)
{
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
entry.AgentID = avatar;
entry.Flags = AccessList.Access;
entry.Time = new DateTime();
if (landData.ParcelAccessList.Contains(entry))
return false; // explicitly permitted to enter
}
// Note: AllowAccessEstatewide is potentially slightly expensive due to partner check profile lookup.
if (AllowAccessEstatewide(avatar))
return false;
if (landData.GroupID != UUID.Zero) // It has a group set.
{
// If it's group-owned land or group-based access enabled, allow in group members.
if (landData.IsGroupOwned || ((landData.Flags & (uint)ParcelFlags.UseAccessGroup) != 0))
{
// FastConfirmGroupMember is light if the avatar has a root or child connection to this region.
if (m_scene.FastConfirmGroupMember(avatar, landData.GroupID))
return false;
}
}
// Parcel not public access and no qualifications to allow in.
return true;
}
示例13: isBannedFromLand
public bool isBannedFromLand(UUID avatar)
{
if (m_scene.Permissions.BypassPermissions())
return false;
if (landData.OwnerID == avatar)
return false;
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
entry.AgentID = avatar;
entry.Flags = AccessList.Ban;
entry.Time = new DateTime();
if (landData.ParcelAccessList.Contains(entry))
{
// Banned, but ignore if EO etc? Delay this call to here because
// this call is potentially slightly expensive due to partner check profile lookup.
if (!AllowAccessEstatewide(avatar))
return true;
}
return false;
}
示例14: isBannedFromLand
public bool isBannedFromLand(UUID avatar)
{
if ((landData.Flags & (uint) ParcelFlags.UseBanList) > 0)
{
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
entry.AgentID = avatar;
entry.Flags = AccessList.Ban;
entry.Time = new DateTime();
if (landData.ParcelAccessList.Contains(entry))
{
//They are banned, so lets send them a notice about this parcel
return true;
}
}
return false;
}
示例15: Copy
/// <summary>
/// Make a new copy of the land data
/// </summary>
/// <returns></returns>
public LandData Copy()
{
LandData landData = new LandData
{
_AABBMax = _AABBMax,
_AABBMin = _AABBMin,
_area = _area,
_auctionID = _auctionID,
_authBuyerID = _authBuyerID,
_category = _category,
_claimDate = _claimDate,
_claimPrice = _claimPrice,
_globalID = _globalID,
_groupID = _groupID,
_isGroupOwned = _isGroupOwned,
_localID = _localID,
_landingType = _landingType,
_mediaAutoScale = _mediaAutoScale,
_mediaID = _mediaID,
_mediaURL = _mediaURL,
_musicURL = _musicURL,
_ownerID = _ownerID,
_bitmap = (byte[]) _bitmap.Clone(),
_description = _description,
_flags = _flags,
_name = _name,
_status = _status,
_passHours = _passHours,
_passPrice = _passPrice,
_salePrice = _salePrice,
_snapshotID = _snapshotID,
_userLocation = _userLocation,
_userLookAt = _userLookAt,
_otherCleanTime = _otherCleanTime,
_dwell = _dwell,
_mediaType = _mediaType,
_mediaDescription = _mediaDescription,
_mediaWidth = _mediaWidth,
_mediaHeight = _mediaHeight,
_mediaLoop = _mediaLoop,
_MediaLoopSet = _MediaLoopSet,
_obscureMusic = _obscureMusic,
_obscureMedia = _obscureMedia,
_regionID = _regionID,
_regionHandle = _regionHandle,
_infoUUID = _infoUUID,
_Maturity = _Maturity,
_private = _private
};
landData._parcelAccessList.Clear();
#if (!ISWIN)
foreach (ParcelManager.ParcelAccessEntry entry in _parcelAccessList)
{
ParcelManager.ParcelAccessEntry newEntry = new ParcelManager.ParcelAccessEntry
{
AgentID = entry.AgentID, Flags = entry.Flags, Time = entry.Time
};
landData._parcelAccessList.Add(newEntry);
}
#else
foreach (ParcelManager.ParcelAccessEntry newEntry in _parcelAccessList.Select(entry => new ParcelManager.ParcelAccessEntry
{
AgentID = entry.AgentID,
Flags = entry.Flags,
Time = entry.Time
}))
{
landData._parcelAccessList.Add(newEntry);
}
#endif
return landData;
}