本文整理汇总了C#中UUID.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# UUID.Equals方法的具体用法?C# UUID.Equals怎么用?C# UUID.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UUID
的用法示例。
在下文中一共展示了UUID.Equals方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetListeners
/// <summary>
/// Get listeners matching the input parameters.
/// </summary>
/// <remarks>
/// Theres probably a more clever and efficient way to do this, maybe
/// with regex.
/// PM2008: Ha, one could even be smart and define a specialized
/// Enumerator.
/// </remarks>
/// <param name="itemID"></param>
/// <param name="channel"></param>
/// <param name="name"></param>
/// <param name="id"></param>
/// <param name="msg"></param>
/// <returns></returns>
public List<ListenerInfo> GetListeners(UUID itemID, int channel,
string name, UUID id, string msg)
{
List<ListenerInfo> collection = new List<ListenerInfo>();
lock (m_listeners)
{
List<ListenerInfo> listeners;
if (!m_listeners.TryGetValue(channel, out listeners))
{
return collection;
}
foreach (ListenerInfo li in listeners)
{
if (!li.IsActive())
{
continue;
}
if (!itemID.Equals(UUID.Zero) &&
!li.GetItemID().Equals(itemID))
{
continue;
}
if (li.GetName().Length > 0 && (
((li.RegexBitfield & OS_LISTEN_REGEX_NAME) != OS_LISTEN_REGEX_NAME && !li.GetName().Equals(name)) ||
((li.RegexBitfield & OS_LISTEN_REGEX_NAME) == OS_LISTEN_REGEX_NAME && !Regex.IsMatch(name, li.GetName()))
))
{
continue;
}
if (!li.GetID().Equals(UUID.Zero) && !li.GetID().Equals(id))
{
continue;
}
if (li.GetMessage().Length > 0 && (
((li.RegexBitfield & OS_LISTEN_REGEX_MESSAGE) != OS_LISTEN_REGEX_MESSAGE && !li.GetMessage().Equals(msg)) ||
((li.RegexBitfield & OS_LISTEN_REGEX_MESSAGE) == OS_LISTEN_REGEX_MESSAGE && !Regex.IsMatch(msg, li.GetMessage()))
))
{
continue;
}
collection.Add(li);
}
}
return collection;
}
示例2: GetListeners
// Theres probably a more clever and efficient way to
// do this, maybe with regex.
public List<ListenerInfo> GetListeners(UUID itemID, int channel, string name, UUID id, string msg)
{
List<ListenerInfo> collection = new List<ListenerInfo>();
lock (m_listeners)
{
List<ListenerInfo> listeners;
if (!m_listeners.TryGetValue(channel, out listeners))
{
return collection;
}
collection.AddRange(from li in listeners
where li.IsActive()
where itemID.Equals(UUID.Zero) || li.GetItemID().Equals(itemID)
where li.GetName().Length <= 0 || li.GetName().Equals(name)
where li.GetName().Length <= 0 || ((li.RegexBitfield & OS_LISTEN_REGEX_NAME) != OS_LISTEN_REGEX_NAME && li.GetName().Equals(name)) ||
((li.RegexBitfield & OS_LISTEN_REGEX_NAME) == OS_LISTEN_REGEX_NAME && Regex.IsMatch(name, li.GetName()))
where li.GetMessage().Length <= 0 || ((li.RegexBitfield & OS_LISTEN_REGEX_MESSAGE) != OS_LISTEN_REGEX_MESSAGE && li.GetMessage().Equals(msg)) ||
((li.RegexBitfield & OS_LISTEN_REGEX_MESSAGE) == OS_LISTEN_REGEX_MESSAGE && Regex.IsMatch(msg, li.GetMessage()))
where li.GetID().Equals(UUID.Zero) || li.GetID().Equals(id)
where li.GetMessage().Length <= 0 || li.GetMessage().Equals(msg)
select li);
}
return collection;
}
示例3: ExportAsset
///
/// Used in DeleteToInventory
///
protected override void ExportAsset(UUID agentID, UUID assetID)
{
if (!assetID.Equals(UUID.Zero))
UploadInventoryItem(agentID, AssetType.Unknown, assetID, "", 0);
else
m_log.Debug("[HGScene]: Scene.Inventory did not create asset");
}
示例4: ExportAsset
///
/// Used in DeleteToInventory
///
protected override void ExportAsset(UUID agentID, UUID assetID)
{
if (!assetID.Equals(UUID.Zero))
{
InventoryItemBase item = new InventoryItemBase();
item.Owner = agentID;
item.AssetType = (int)AssetType.Unknown;
item.AssetID = assetID;
item.Name = String.Empty;
PostInventoryAsset(item, 0);
}
else
{
m_log.Debug("[HGScene]: Scene.Inventory did not create asset");
}
}
示例5: CityBuilding
/// <summary>
/// Construct the building class instance from the given properties.
/// </summary>
/// <param name="type" type="BuildingType">type</param>
/// <param name="plot">The plot of land this building stands on, note it might be bigger than the
/// actual buildings footprint, for example if it is part of a larger complex, limit the size of
/// buildings to have a footprint of no more than 100 square meters.</param>
/// <param name="flags"></param>
/// <param name="owner">The owner of the building either a user, or company (group of companies) own buildings.</param>
/// <param name="seed"></param>
/// <param name="height">The height in floors of the building, not each floor is approximately 3 meters in size
/// and thus buildings are limited to a maximum height of 100 floors.</param>
public CityBuilding( BuildingType type, BuildingPlot plot, BuildingFlags flags,
UUID owner, IScene scene, string name ):base(owner,new Vector3(plot.xpos,21,plot.ypos),
Quaternion.Identity, PrimitiveBaseShape.CreateBox(), name, scene)
{
// Start the process of constructing a building given the parameters specified. For
// truly random buildings change the following value (6) too another number, this is
// used to allow for the buildings to be fairly fixed during research and development.
buildingSeed = 6; // TODO FIX ACCESS TO THE CityModule.randomValue(n) code.
buildingType = type;
buildingPlot = plot;
buildingFlags = flags;
// Has a valid owner been specified, if not use the default library owner (i think) of the zero uuid.
if (!owner.Equals(UUID.Zero))
buildingOwner = owner;
else
buildingOwner = UUID.Zero;
// Generate a unique value for this building and it's own group if it's part of a complex,
// otherwise use the zero uuid for group (perhaps it should inherit from the city?)
buildingUUID = UUID.Random();
buildingGUID = UUID.Random();
buildingCenter = new Vector3((plot.xpos + plot.width / 2), 21, (plot.ypos + plot.depth) / 2);
if (name.Length > 0)
buildingName = name;
else
buildingName = "Building" + type.ToString();
// Now that internal variables that are used by other methods have been set construct
// the building based on the type, plot, flags and seed given in the parameters.
switch (type)
{
case BuildingType.BUILDING_GENERAL:
OpenSim.Framework.MainConsole.Instance.Output("Building Type GENERAL", log4net.Core.Level.Info);
createBlocky();
break;
case BuildingType.BUILDING_LOCALE:
/*
switch ( CityModule.randomValue(8) )
{
case 0:
OpenSim.Framework.MainConsole.Instance.Output("Locale general.", log4net.Core.Level.Info);
createSimple();
break;
case 1:
OpenSim.Framework.MainConsole.Instance.Output("locale 1", log4net.Core.Level.Info);
createBlocky();
break;
}
*/
break;
case BuildingType.BUILDING_CIVIL:
createTower();
break;
case BuildingType.BUILDING_MILITARY:
break;
case BuildingType.BUILDING_HEALTHCARE:
break;
case BuildingType.BUILDING_SPORTS:
break;
case BuildingType.BUILDING_ENTERTAINMENT:
break;
case BuildingType.BUILDING_EDUCATION:
break;
case BuildingType.BUILDING_RELIGIOUS:
break;
case BuildingType.BUILDING_MUSEUM:
break;
case BuildingType.BUILDING_POWERSTATION:
break;
case BuildingType.BUILDING_MINEOILGAS:
break;
case BuildingType.BUILDING_ZOOLOGICAL:
break;
case BuildingType.BUILDING_CEMETARY:
break;
case BuildingType.BUILDING_PRISON:
break;
case BuildingType.BUILDING_AGRICULTURAL:
break;
case BuildingType.BUILDING_RECREATION:
break;
default:
createSimple();
break;
}
}
示例6: getNeighbourCol
private string getNeighbourCol(UUID x, UUID y, int width, string infinity)
{
if (x.Equals(y))
return getCol("0", width);
if (neighbourVectors[y].ContainsKey(x)) {
float v = neighbourVectors[y][x].Dist;
string format = "{0:##.";
for (int i = 0; i < width - (v < 10f ? 3 : 4); i++)
format += "#";
format += "}";
return getCol(String.Format(format, v), width);
}
return getCol(infinity, width);
}
示例7: GetListeners
// Theres probably a more clever and efficient way to
// do this, maybe with regex.
// PM2008: Ha, one could even be smart and define a specialized Enumerator.
public List<ListenerInfo> GetListeners(UUID itemID, int channel, string name, UUID id, string msg)
{
List<ListenerInfo> collection = new List<ListenerInfo>();
lock (m_listeners)
{
List<ListenerInfo> listeners;
if (!m_listeners.TryGetValue(channel,out listeners))
{
return collection;
}
foreach (ListenerInfo li in listeners)
{
if (!li.IsActive())
{
continue;
}
if (!itemID.Equals(UUID.Zero) && !li.GetItemID().Equals(itemID))
{
continue;
}
if (li.GetName().Length > 0 && !li.GetName().Equals(name))
{
continue;
}
if (!li.GetID().Equals(UUID.Zero) && !li.GetID().Equals(id))
{
continue;
}
if (li.GetMessage().Length > 0 && !li.GetMessage().Equals(msg))
{
continue;
}
collection.Add(li);
}
}
return collection;
}
示例8: IsLocal
private bool IsLocal(UUID groupID, out string serviceLocation, out string name)
{
serviceLocation = string.Empty;
name = string.Empty;
if (groupID.Equals(UUID.Zero))
return true;
ExtendedGroupRecord group = m_LocalGroupsConnector.GetGroupRecord(UUID.Zero.ToString(), groupID, string.Empty);
if (group == null)
{
//m_log.DebugFormat("[XXX]: IsLocal? group {0} not found -- no.", groupID);
return false;
}
serviceLocation = group.ServiceLocation;
name = group.GroupName;
bool isLocal = (group.ServiceLocation == string.Empty);
//m_log.DebugFormat("[XXX]: IsLocal? {0}", isLocal);
return isLocal;
}
示例9: Authorize
public bool Authorize(IOwned entity, UUID id)
{
if (id.Equals(_ownerID)) {
//Reset the timeout every time the user makes a change
_updated = true;
JM726.Lib.Static.Util.Wake(this);
return true;
}
return false;
}
示例10: RemoveBoard
public void RemoveBoard(UUID board)
{
_boards = _boards.Where(oldBoard => !board.Equals(oldBoard.ID));
}
示例11: OnChange
/// <summary>
/// Override this to change what happens when something changes in the topology.
/// Changes are:
/// A link is added.
/// A link is removed.
/// The weight of a link changes.
///
/// The default behaviour is to run the algorithm from every node.
/// </summary>
protected virtual void OnChange(string msg, UUID link, Parameters parameters, bool visualise)
{
foreach (DijkstraNode n in this.GetAllNodes<DijkstraNode>()) {
if (n.GetType().Equals(_dijkstraType) && !Links.ContainsKey(n.ID) || !link.Equals(Links[n.ID].ID) || !Links[n.ID].IsBidirectional)
n.RunAlgorithm("Running algorithm from " + n.Name + " because " + msg + ".", null, n.Equals(VisualisedNode));
}
}
示例12: GetListeners
// Theres probably a more clever and efficient way to
// do this, maybe with regex.
// PM2008: Ha, one could even be smart and define a specialized Enumerator.
public List<ListenerInfo> GetListeners(UUID itemID, int channel, string name, UUID id, string msg)
{
List<ListenerInfo> collection = new List<ListenerInfo>();
lock (m_listeners)
{
List<ListenerInfo> listeners;
if (!m_listeners.TryGetValue(channel, out listeners))
{
return collection;
}
collection.AddRange(from li in listeners
where li.IsActive()
where itemID.Equals(UUID.Zero) || li.GetItemID().Equals(itemID)
where li.GetName().Length <= 0 || li.GetName().Equals(name)
where li.GetID().Equals(UUID.Zero) || li.GetID().Equals(id)
where li.GetMessage().Length <= 0 || li.GetMessage().Equals(msg)
select li);
}
return collection;
}
示例13: RezObject
///
/// RezObject
///
public override SceneObjectGroup RezObject(IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart,
UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
{
//m_log.DebugFormat("[HGScene] RezObject itemID={0} fromTaskID={1}", itemID, fromTaskID);
if (fromTaskID.Equals(UUID.Zero))
{
CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
if (userInfo != null)
{
if (userInfo.RootFolder != null)
{
InventoryItemBase item = userInfo.RootFolder.FindItem(itemID);
if (item == null)
{ // Fetch the item
item = new InventoryItemBase();
item.Owner = remoteClient.AgentId;
item.ID = itemID;
item = m_assMapper.Get(item, userInfo.RootFolder.ID, userInfo);
}
if (item != null)
{
m_assMapper.Get(item.AssetID, remoteClient.AgentId);
}
}
}
}
// OK, we're done fetching. Pass it up to the default RezObject
return base.RezObject(remoteClient, itemID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection,
RezSelected, RemoveItem, fromTaskID, attachment);
}
示例14: OtherEnd
/// <inheritdoc />
public UUID OtherEnd(UUID n)
{
if (!n.Equals(To.ID) && !n.Equals(From.ID))
throw new Exception("Cannot return other end. Parameter 'node' must be connected to link.");
return From.ID.Equals(n) ? To.ID : From.ID;
}
示例15: Authorize
private bool Authorize(string command, UUID id)
{
if (!id.Equals(m_god.PrincipalID) && !id.Equals(UUID.Zero)) {
UserAccount attempt = m_scene.UserAccountService.GetUserAccount(UUID.Zero, id);
m_log.Warn("Can't execute " + command + " on " + Name + ". " + (attempt != null ? attempt.FirstName + " " + attempt.LastName + " is not " : "Not ") + "authorized.");
return false;
}
return true;
}