Class AntiCheatMonitor
The heart of the anti cheat system. The monitor watches all detectors and punishes cheaters. It is a persistent singleton, once created it will exist throughout the whole application.
Inheritance
Implements
Namespace: GUPS.AntiCheat
Assembly: cs.temp.dll.dll
Syntax
public class AntiCheatMonitor : Singleton<AntiCheatMonitor>
Remarks
On awake, the monitor registers all detectors and punishers in the children gameobjects of the monitor. It then subscribes to all detectors and watches for threats. If a threat is detected, the monitor will punish the cheater. The monitor also slowly reduces the threat level over time. The monitor is a thread-safe singleton and is persistent throughout the whole application.
Properties
IsPersistent
The persistent singleton instance of the anti cheat monitor.
Declaration
public override bool IsPersistent { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
SensitiveLevel
The sensitive level of the monitor. Manage the reaction sensitivity of the monitor to possible detected threats. Ratings of detected threats are scaled by the sensitive level beginning at 0 (NOT_SENSITIVE) up to 4 (VERY_SENSITIVE). The higher the sensitive level, the earlier the monitor will react and punish the cheater.
Declaration
public ESensitiveLevel SensitiveLevel { get; }
Property Value
Type | Description |
---|---|
ESensitiveLevel |
ThreatLevel
The current threat level of the monitor.
Declaration
public float ThreatLevel { get; }
Property Value
Type | Description |
---|---|
System.Single |
Methods
Awake()
On start of the monitor, register all detectors and punishers in the children of the monitor.
Declaration
protected override void Awake()
Dispose()
On dispose, do nothing.
Declaration
public void Dispose()
FixedUpdate()
On the fixed update of the monitor, reduce the threat level over time.
Declaration
protected virtual void FixedUpdate()
GetDetector<TDetector>()
Get the first detector of the specified type.
Declaration
public TDetector GetDetector<TDetector>()
where TDetector : IDetector
Returns
Type | Description |
---|---|
TDetector | The first detector of the specified type. |
Type Parameters
Name | Description |
---|---|
TDetector | The type of the detector to get. |
GetPunisher(UInt32)
Returns a list of all punishers that have a threat rating lower than the threat level and can punish multiple times or have not punished yet.
Declaration
public List<IPunisher> GetPunisher(UInt32 _ThreatLevel)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | _ThreatLevel | The current threat level. |
Returns
Type | Description |
---|---|
List<IPunisher> | A list of punishable punishers, sorted by threat rating ascending. |
OnCompleted()
The monitor is notified of the completion of a detector.
Declaration
public void OnCompleted()
OnError(Exception)
The monitor is notified of an error by a detector.
Declaration
public void OnError(Exception _Error)
Parameters
Type | Name | Description |
---|---|---|
Exception | _Error | The error that occurred. |
OnNext(IDetectorStatus)
The monitor is notified of a threat by a detector.
Declaration
public void OnNext(IDetectorStatus value)
Parameters
Type | Name | Description |
---|---|---|
IDetectorStatus | value | The detected threat status. |