Struct ProtectedDateTime
Drop-in replacement for System.DateTime that protects the underlying
Implements
Namespace: GUPS.AntiCheat.Protected
Assembly: cs.temp.dll.dll
Syntax
public struct ProtectedDateTime
Constructors
ProtectedDateTime(DateTime)
Initializes a new protected DateTime with the specified value.
Declaration
public ProtectedDateTime(DateTime _Value)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | _Value | Initial value. |
Properties
HasIntegrity
Gets a value indicating whether the protected value still has integrity (i.e. the honeypot has not been tampered with).
Declaration
public bool HasIntegrity { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Value
Gets or sets the unobfuscated value.
Declaration
public DateTime Value { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTime |
Remarks
Reading the value runs an integrity check; if the honeypot has been tampered with, the
Methods
CheckIntegrity()
Returns true when the honeypot still matches the obfuscated value.
Declaration
public bool CheckIntegrity()
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Dispose()
Clears the inner ProtectedInt64.
Declaration
public void Dispose()
Equals(Object)
Returns true when this protected DateTime equals the given object.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | obj | Object to compare with. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Overrides
GetHashCode()
Returns the hash code of the unobfuscated value.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| System.Int32 | Hash code of the unobfuscated value. |
Overrides
Obfuscate()
Rerolls the inner ProtectedInt64's secret and re-obfuscates the current value.
Declaration
public void Obfuscate()
OnAfterDeserialize()
Unity deserialization hook; rebuilds the obfuscation state from the deserialized honeypot value.
Declaration
public void OnAfterDeserialize()
OnBeforeSerialize()
Unity serialization hook; writes the true value into the honeypot field.
Declaration
public void OnBeforeSerialize()
ToString()
Returns the string representation of the unobfuscated value.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String | The string representation of the unobfuscated value. |
Overrides
Operators
Equality(ProtectedDateTime, ProtectedDateTime)
Returns true when both protected DateTimes represent the same instant.
Declaration
public static bool operator ==(ProtectedDateTime v1, ProtectedDateTime v2)
Parameters
| Type | Name | Description |
|---|---|---|
| ProtectedDateTime | v1 | First operand. |
| ProtectedDateTime | v2 | Second operand. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Implicit(DateTime to ProtectedDateTime)
Implicitly wraps a
Declaration
public static implicit operator ProtectedDateTime(DateTime _Value)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | _Value | Value to wrap. |
Returns
| Type | Description |
|---|---|
| ProtectedDateTime | A protected DateTime holding the given value. |
Implicit(ProtectedDateTime to DateTime)
Implicitly unwraps a protected DateTime to its
Declaration
public static implicit operator DateTime(ProtectedDateTime _Value)
Parameters
| Type | Name | Description |
|---|---|---|
| ProtectedDateTime | _Value | Protected DateTime to unwrap. |
Returns
| Type | Description |
|---|---|
| DateTime | The unobfuscated DateTime value. |
Inequality(ProtectedDateTime, ProtectedDateTime)
Returns true when the two protected DateTimes represent different instants.
Declaration
public static bool operator !=(ProtectedDateTime v1, ProtectedDateTime v2)
Parameters
| Type | Name | Description |
|---|---|---|
| ProtectedDateTime | v1 | First operand. |
| ProtectedDateTime | v2 | Second operand. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|