Struct HWID
- Namespace
- Uncreated.Warfare.Moderation
- Assembly
- Uncreated.Warfare.dll
A 20-length hardware ID of an Unturned player.
[JsonConverter(typeof(HWIDJsonConverter))]
[ValueConverter(typeof(HWIDValueConverter))]
public readonly struct HWID : IEquatable<HWID>
- Implements
- Inherited Members
Constructors
HWID(byte*)
public HWID(byte* ptr)
Parameters
ptrbyte*
HWID(byte[], int)
public HWID(byte[] bytes, int index = 0)
Parameters
HWID(long, long, int)
public HWID(long i1, long i2, int i3)
Parameters
HWID(Span<byte>)
public HWID(Span<byte> span)
Parameters
Fields
Size
public const int Size = 20
Field Value
Zero
public static readonly HWID Zero
Field Value
Methods
AsMySQLParameter()
public object AsMySQLParameter()
Returns
CopyTo(byte*)
public int CopyTo(byte* ptr)
Parameters
ptrbyte*
Returns
CopyTo(byte[], int)
public int CopyTo(byte[] array, int offset)
Parameters
Returns
CopyTo(Span<byte>)
public int CopyTo(Span<byte> span)
Parameters
Returns
Equals(byte[])
public bool Equals(byte[] hwid)
Parameters
hwidbyte[]
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
Equals(HWID)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(HWID other)
Parameters
otherHWIDAn object to compare with this object.
Returns
GenerateRandomHWID()
public static HWID GenerateRandomHWID()
Returns
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
ReadFromByteReader(ByteReader)
public static HWID ReadFromByteReader(ByteReader reader)
Parameters
readerByteReader
Returns
ReadFromDataReader(int, IDataReader)
public static HWID ReadFromDataReader(int ordinal, IDataReader reader)
Parameters
ordinalintreaderIDataReader
Returns
ReadFromJsonReader(ref Utf8JsonReader)
public static HWID ReadFromJsonReader(ref Utf8JsonReader reader)
Parameters
readerUtf8JsonReader
Returns
ToBase10String()
public string ToBase10String()
Returns
ToBase16String(bool, bool)
public string ToBase16String(bool lowerCase = false, bool includePrefix = false)
Parameters
Returns
ToBase64String()
public string ToBase64String()
Returns
ToByteArray()
public byte[] ToByteArray()
Returns
- byte[]
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
TryParseBase10(string, out HWID)
public static bool TryParseBase10(string str, out HWID hwid)
Parameters
Returns
TryParseBase16(string, out HWID)
public static bool TryParseBase16(string str, out HWID hwid)
Parameters
Returns
TryParseBase64(string, out HWID)
public static bool TryParseBase64(string str, out HWID hwid)
Parameters
Returns
WriteToByteWriter(ByteWriter)
public void WriteToByteWriter(ByteWriter writer)
Parameters
writerByteWriter
WriteToJsonWriter(Utf8JsonWriter)
public void WriteToJsonWriter(Utf8JsonWriter writer)
Parameters
writerUtf8JsonWriter
Operators
operator ==(HWID, HWID)
public static bool operator ==(HWID left, HWID right)
Parameters
Returns
operator !=(HWID, HWID)
public static bool operator !=(HWID left, HWID right)