* Created new "UUID" class to override LLUUID in general. (Unable to inherit from LLUUID, so written as a wrapper + extra functions), 1:1 Feature compatible with LLUUID designed as "Drop In" replacement.
parent
72cd28be1b
commit
e4df6ea08e
|
@ -1,4 +1,4 @@
|
||||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ProjectType>Local</ProjectType>
|
<ProjectType>Local</ProjectType>
|
||||||
<ProductVersion>8.0.50727</ProductVersion>
|
<ProductVersion>8.0.50727</ProductVersion>
|
||||||
|
@ -6,7 +6,8 @@
|
||||||
<ProjectGuid>{8ACA2445-0000-0000-0000-000000000000}</ProjectGuid>
|
<ProjectGuid>{8ACA2445-0000-0000-0000-000000000000}</ProjectGuid>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
<ApplicationIcon></ApplicationIcon>
|
<ApplicationIcon>
|
||||||
|
</ApplicationIcon>
|
||||||
<AssemblyKeyContainerName>
|
<AssemblyKeyContainerName>
|
||||||
</AssemblyKeyContainerName>
|
</AssemblyKeyContainerName>
|
||||||
<AssemblyName>OpenSim.Framework</AssemblyName>
|
<AssemblyName>OpenSim.Framework</AssemblyName>
|
||||||
|
@ -15,9 +16,11 @@
|
||||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||||
<DelaySign>false</DelaySign>
|
<DelaySign>false</DelaySign>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<AppDesignerFolder></AppDesignerFolder>
|
<AppDesignerFolder>
|
||||||
|
</AppDesignerFolder>
|
||||||
<RootNamespace>OpenSim.Framework</RootNamespace>
|
<RootNamespace>OpenSim.Framework</RootNamespace>
|
||||||
<StartupObject></StartupObject>
|
<StartupObject>
|
||||||
|
</StartupObject>
|
||||||
<FileUpgradeFlags>
|
<FileUpgradeFlags>
|
||||||
</FileUpgradeFlags>
|
</FileUpgradeFlags>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
@ -28,7 +31,8 @@
|
||||||
<ConfigurationOverrideFile>
|
<ConfigurationOverrideFile>
|
||||||
</ConfigurationOverrideFile>
|
</ConfigurationOverrideFile>
|
||||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||||
<DocumentationFile></DocumentationFile>
|
<DocumentationFile>
|
||||||
|
</DocumentationFile>
|
||||||
<DebugSymbols>True</DebugSymbols>
|
<DebugSymbols>True</DebugSymbols>
|
||||||
<FileAlignment>4096</FileAlignment>
|
<FileAlignment>4096</FileAlignment>
|
||||||
<Optimize>False</Optimize>
|
<Optimize>False</Optimize>
|
||||||
|
@ -37,7 +41,8 @@
|
||||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<NoWarn></NoWarn>
|
<NoWarn>
|
||||||
|
</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||||
|
@ -46,7 +51,8 @@
|
||||||
<ConfigurationOverrideFile>
|
<ConfigurationOverrideFile>
|
||||||
</ConfigurationOverrideFile>
|
</ConfigurationOverrideFile>
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
<DocumentationFile></DocumentationFile>
|
<DocumentationFile>
|
||||||
|
</DocumentationFile>
|
||||||
<DebugSymbols>False</DebugSymbols>
|
<DebugSymbols>False</DebugSymbols>
|
||||||
<FileAlignment>4096</FileAlignment>
|
<FileAlignment>4096</FileAlignment>
|
||||||
<Optimize>True</Optimize>
|
<Optimize>True</Optimize>
|
||||||
|
@ -55,7 +61,8 @@
|
||||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<NoWarn></NoWarn>
|
<NoWarn>
|
||||||
|
</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Db4objects.Db4o.dll">
|
<Reference Include="Db4objects.Db4o.dll">
|
||||||
|
@ -70,6 +77,7 @@
|
||||||
<HintPath>System.dll</HintPath>
|
<HintPath>System.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Xml">
|
<Reference Include="System.Xml">
|
||||||
<HintPath>System.Xml.dll</HintPath>
|
<HintPath>System.Xml.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
|
@ -103,6 +111,7 @@
|
||||||
<Compile Include="IRegionCommsListener.cs">
|
<Compile Include="IRegionCommsListener.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Types\UUID.cs" />
|
||||||
<Compile Include="Util.cs">
|
<Compile Include="Util.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
|
|
@ -0,0 +1,129 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using libsecondlife;
|
||||||
|
|
||||||
|
namespace OpenSim.Framework.Types
|
||||||
|
{
|
||||||
|
class UUID
|
||||||
|
{
|
||||||
|
public LLUUID llUUID;
|
||||||
|
|
||||||
|
public UUID(string uuid)
|
||||||
|
{
|
||||||
|
llUUID = new LLUUID(uuid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public UUID(byte[] uuid)
|
||||||
|
{
|
||||||
|
llUUID = new LLUUID(uuid, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public UUID(byte[] uuid, int offset)
|
||||||
|
{
|
||||||
|
llUUID = new LLUUID(uuid, offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
public UUID()
|
||||||
|
{
|
||||||
|
llUUID = LLUUID.Zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UUID(ulong uuid)
|
||||||
|
{
|
||||||
|
llUUID = new LLUUID(uuid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public UUID(UInt32 first, UInt32 second, UInt32 third, UInt32 fourth)
|
||||||
|
{
|
||||||
|
byte[] uuid = new byte[16];
|
||||||
|
|
||||||
|
byte[] n = BitConverter.GetBytes(first);
|
||||||
|
n.CopyTo(uuid, 0);
|
||||||
|
n = BitConverter.GetBytes(second);
|
||||||
|
n.CopyTo(uuid, 4);
|
||||||
|
n = BitConverter.GetBytes(third);
|
||||||
|
n.CopyTo(uuid, 8);
|
||||||
|
n = BitConverter.GetBytes(fourth);
|
||||||
|
n.CopyTo(uuid, 12);
|
||||||
|
|
||||||
|
llUUID = new LLUUID(uuid,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return llUUID.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public string ToStringHyphenated()
|
||||||
|
{
|
||||||
|
return llUUID.ToStringHyphenated();
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] GetBytes()
|
||||||
|
{
|
||||||
|
return llUUID.GetBytes();
|
||||||
|
}
|
||||||
|
|
||||||
|
public UInt32[] GetInts()
|
||||||
|
{
|
||||||
|
UInt32[] ints = new UInt32[4];
|
||||||
|
ints[0] = BitConverter.ToUInt32(llUUID.Data, 0);
|
||||||
|
ints[1] = BitConverter.ToUInt32(llUUID.Data, 4);
|
||||||
|
ints[2] = BitConverter.ToUInt32(llUUID.Data, 8);
|
||||||
|
ints[3] = BitConverter.ToUInt32(llUUID.Data, 12);
|
||||||
|
|
||||||
|
return ints;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LLUUID GetLLUUID()
|
||||||
|
{
|
||||||
|
return llUUID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public uint CRC()
|
||||||
|
{
|
||||||
|
return llUUID.CRC();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int GetHashCode()
|
||||||
|
{
|
||||||
|
return llUUID.GetHashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Combine(UUID other)
|
||||||
|
{
|
||||||
|
llUUID.Combine(other.GetLLUUID());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Combine(LLUUID other)
|
||||||
|
{
|
||||||
|
llUUID.Combine(other);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Equals(Object other)
|
||||||
|
{
|
||||||
|
return llUUID.Equals(other);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool operator ==(UUID a, UUID b)
|
||||||
|
{
|
||||||
|
return a.Equals(b);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool operator !=(UUID a, UUID b)
|
||||||
|
{
|
||||||
|
return !a.Equals(b);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool operator ==(UUID a, LLUUID b)
|
||||||
|
{
|
||||||
|
return a.Equals(b);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool operator !=(UUID a, LLUUID b)
|
||||||
|
{
|
||||||
|
return !a.Equals(b);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue