• Hello
Search Results for

    Show / Hide Table of Contents

    Class DesktopInstanceLockDetector

    Reports a second process of this game on the same machine.

    Inheritance
    System.Object
    ADetector<IDesktopCheatingDetectionStatus>
    DesktopInstanceLockDetector
    Implements
    IDetector<IDesktopCheatingDetectionStatus>
    Inherited Members
    ADetector<IDesktopCheatingDetectionStatus>.IsActive
    ADetector<IDesktopCheatingDetectionStatus>.Subscribe(IObserver<IDesktopCheatingDetectionStatus>)
    ADetector<IDesktopCheatingDetectionStatus>.Notify(IDesktopCheatingDetectionStatus)
    ADetector<IDesktopCheatingDetectionStatus>.Dispose()
    ADetector<IDesktopCheatingDetectionStatus>.Awake()
    Namespace: GUPS.AntiCheat.Detector.Desktop
    Assembly: cs.temp.dll.dll
    Syntax
    public class DesktopInstanceLockDetector : ADetector<IDesktopCheatingDetectionStatus>
    Remarks

    The check is opt-in through , which is off by default. A second copy matters for multiplayer and is harmless for local co-op. While the setting is off, no lock is taken and nothing is reported.

    The first process holds GUPS.AntiCheat.Detector.Desktop.InstanceLock until it quits. A later process that cannot take the same lock reports once. The process that holds the lock does not report. This detector does not close the game. Attach a punisher when a second copy should end the session.

    The lock is the handle the running game holds. On Windows that handle is a named mutex. On macOS and Linux it is a lock on an open file. Quitting releases the handle. A crash or a kill releases it too, because the operating system closes the handle when the process is gone, so the next start can take the lock. A start is reported only while a previous process of this game is still running.

    Development builds and the Unity editor skip the lock unless is on, so play mode does not pin a built player. A failure to create the lock is logged and is not reported as cheating.

    Fields

    OnCheatingDetectionEvent

    Unity event raised when a second copy is reported. Useful to wire up reactions through the inspector without writing an .

    Declaration
    public CheatingDetectionEvent<DesktopCheatingDetectionStatus> OnCheatingDetectionEvent
    Field Value
    Type Description
    CheatingDetectionEvent<DesktopCheatingDetectionStatus>

    Properties

    IsSupported

    Gets a value indicating whether the detector is supported on the current platform.

    Declaration
    public override bool IsSupported { get; }
    Property Value
    Type Description
    System.Boolean
    Overrides
    GUPS.AntiCheat.Detector.ADetector<GUPS.AntiCheat.Detector.Desktop.IDesktopCheatingDetectionStatus>.IsSupported

    Name

    Gets the human-readable name of the detector.

    Declaration
    public override String Name { get; }
    Property Value
    Type Description
    String
    Overrides
    GUPS.AntiCheat.Detector.ADetector<GUPS.AntiCheat.Detector.Desktop.IDesktopCheatingDetectionStatus>.Name

    PossibilityOfFalsePositive

    Gets the false-positive likelihood reported with a second-copy detection.

    Declaration
    public float PossibilityOfFalsePositive { get; }
    Property Value
    Type Description
    System.Single

    PossibleCheatingDetected

    Gets a value indicating whether the detector has observed possible cheating activity.

    Declaration
    public override bool PossibleCheatingDetected { get; protected set; }
    Property Value
    Type Description
    System.Boolean
    Overrides
    GUPS.AntiCheat.Detector.ADetector<GUPS.AntiCheat.Detector.Desktop.IDesktopCheatingDetectionStatus>.PossibleCheatingDetected

    ThreatRating

    Gets the threat rating reported with every detection. Higher values denote greater perceived threats.

    Declaration
    public override uint ThreatRating { get; protected set; }
    Property Value
    Type Description
    System.UInt32
    Overrides
    GUPS.AntiCheat.Detector.ADetector<GUPS.AntiCheat.Detector.Desktop.IDesktopCheatingDetectionStatus>.ThreatRating

    Methods

    ManualScan()

    Tries the lock once. Returns false when the setting is off, this process holds the lock, or the lock could not be created. Returns true when another process already holds it.

    Declaration
    public bool ManualScan()
    Returns
    Type Description
    System.Boolean

    true when a second copy was found; otherwise false.

    OnCompleted()

    Called when an observed subject signals completion.

    Declaration
    public override void OnCompleted()
    Overrides
    GUPS.AntiCheat.Detector.ADetector<GUPS.AntiCheat.Detector.Desktop.IDesktopCheatingDetectionStatus>.OnCompleted()

    OnDestroy()

    Drops this component's hold. The native lock stays while another component in this process still holds it.

    Declaration
    protected virtual void OnDestroy()

    OnError(Exception)

    Called when an observed subject reports an error.

    Declaration
    public override void OnError(Exception _Error)
    Parameters
    Type Name Description
    Exception _Error

    The error reported by the observed subject.

    Overrides
    GUPS.AntiCheat.Detector.ADetector<GUPS.AntiCheat.Detector.Desktop.IDesktopCheatingDetectionStatus>.OnError(Exception)

    OnNext(IWatchedSubject)

    Called when an observed subject publishes a new status.

    Declaration
    public override void OnNext(IWatchedSubject _Subject)
    Parameters
    Type Name Description
    IWatchedSubject _Subject

    The status published by the observed subject.

    Overrides
    GUPS.AntiCheat.Detector.ADetector<GUPS.AntiCheat.Detector.Desktop.IDesktopCheatingDetectionStatus>.OnNext(IWatchedSubject)

    Start()

    Runs the one check at start. There is no recheck: the holder cannot see a later attempt.

    Declaration
    protected virtual void Start()

    Implements

    IDetector<>

    See Also

    AntiCheatMonitor
    In This Article
    Back to top GuardingPearSoftware documentation