本文整理汇总了C#中UUID.CRC方法的典型用法代码示例。如果您正苦于以下问题:C# UUID.CRC方法的具体用法?C# UUID.CRC怎么用?C# UUID.CRC使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UUID
的用法示例。
在下文中一共展示了UUID.CRC方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrepareSceneForConnection
private bool PrepareSceneForConnection(UUID sessionId, UUID sceneId, UserProfileData userProfile, out string reason)
{
Scene scene = m_scenes[sceneId];
CommunicationsManager commsManager = m_scenes[sceneId].CommsManager;
UserManagerBase userService = (UserManagerBase)commsManager.UserService;
AgentCircuitData agent = new AgentCircuitData();
agent.AgentID = userProfile.ID;
agent.firstname = userProfile.FirstName;
agent.lastname = userProfile.SurName;
agent.SessionID = sessionId;
agent.SecureSessionID = userProfile.CurrentAgent.SecureSessionID;
agent.circuitcode = sessionId.CRC();
agent.BaseFolder = UUID.Zero;
agent.InventoryFolder = UUID.Zero;
agent.startpos = new Vector3(0, 0, 0); // TODO Fill in region start position
agent.CapsPath = "http://localhost/";
agent.Appearance = userService.GetUserAppearance(userProfile.ID);
if (agent.Appearance == null)
{
m_log.WarnFormat("[INTER]: Appearance not found for {0} {1}. Creating default.", agent.firstname, agent.lastname);
agent.Appearance = new AvatarAppearance();
}
return scene.NewUserConnection(agent, 0, out reason);
}
示例2: InventoryCRC
/// <summary>
/// Calculates the CRC (cyclic redundancy check) needed to upload inventory.
/// </summary>
/// <param name="creationDate">Creation date</param>
/// <param name="saleType">Sale type</param>
/// <param name="invType">Inventory type</param>
/// <param name="type">Type</param>
/// <param name="assetID">Asset ID</param>
/// <param name="groupID">Group ID</param>
/// <param name="salePrice">Sale price</param>
/// <param name="ownerID">Owner ID</param>
/// <param name="creatorID">Creator ID</param>
/// <param name="itemID">Item ID</param>
/// <param name="folderID">Folder ID</param>
/// <param name="everyoneMask">Everyone mask (permissions)</param>
/// <param name="flags">Flags</param>
/// <param name="nextOwnerMask">Next owner mask (permissions)</param>
/// <param name="groupMask">Group mask (permissions)</param>
/// <param name="ownerMask">Owner mask (permissions)</param>
/// <returns>The calculated CRC</returns>
public static uint InventoryCRC(int creationDate, byte saleType, sbyte invType, sbyte type,
UUID assetID, UUID groupID, int salePrice, UUID ownerID, UUID creatorID,
UUID itemID, UUID folderID, uint everyoneMask, uint flags, uint nextOwnerMask,
uint groupMask, uint ownerMask)
{
uint CRC = 0;
// IDs
CRC += assetID.CRC(); // AssetID
CRC += folderID.CRC(); // FolderID
CRC += itemID.CRC(); // ItemID
// Permission stuff
CRC += creatorID.CRC(); // CreatorID
CRC += ownerID.CRC(); // OwnerID
CRC += groupID.CRC(); // GroupID
// CRC += another 4 words which always seem to be zero -- unclear if this is a UUID or what
CRC += ownerMask;
CRC += nextOwnerMask;
CRC += everyoneMask;
CRC += groupMask;
// The rest of the CRC fields
CRC += flags; // Flags
CRC += (uint)invType; // InvType
CRC += (uint)type; // Type
CRC += (uint)creationDate; // CreationDate
CRC += (uint)salePrice; // SalePrice
CRC += (uint)((uint)saleType * 0x07073096); // SaleType
return CRC;
}
示例3: PrepareSceneForConnection
private bool PrepareSceneForConnection(UUID sessionId, UUID secureSessionId, UUID sceneId, UserAccount account, out string reason)
{
Scene scene = m_scenes[sceneId];
AgentCircuitData agent = new AgentCircuitData();
agent.AgentID = account.PrincipalID;
agent.firstname = account.FirstName;
agent.lastname = account.LastName;
agent.SessionID = sessionId;
agent.SecureSessionID = secureSessionId;
agent.circuitcode = sessionId.CRC();
agent.BaseFolder = UUID.Zero;
agent.InventoryFolder = UUID.Zero;
agent.startpos = new Vector3(0, 0, 0); // TODO Fill in region start position
agent.CapsPath = "http://localhost/";
AvatarData avatar = scene.AvatarService.GetAvatar(account.PrincipalID);
if (avatar != null)
agent.Appearance = avatar.ToAvatarAppearance(account.PrincipalID); //userService.GetUserAppearance(userProfile.ID);
if (agent.Appearance == null)
{
m_log.WarnFormat("[INTER]: Appearance not found for {0} {1}. Creating default.", agent.firstname, agent.lastname);
agent.Appearance = new AvatarAppearance();
}
return scene.NewUserConnection(agent, 0, out reason);
}