/// <summary> /// starts the user-specified detectors /// </summary> void Start() { m_DetectedHackName = PLACEHOLDER_HACK_NAME; if (Detectors.SpeedHack && (SpeedHackDetector.Instance == null)) { SpeedHackDetector.StartDetection(OnSpeedHackDetected); } if (Detectors.ObscuredCheating && (ObscuredCheatingDetector.Instance == null)) { ObscuredCheatingDetector.StartDetection(OnObscuredCheatingDetected); } if (Detectors.WallHack && (WallHackDetector.Instance == null)) { WallHackDetector.StartDetection(OnWallHackDetected, Detectors.WallHackSpawnPos); } if (Detectors.Injection && (InjectionDetector.Instance == null)) { InjectionDetector.StartDetection(OnInjectionDetected); } if (DontDestroyOnLoad) { Object.DontDestroyOnLoad(transform.root.gameObject); } }
void Start() { // SpeedHackDetector usage example. // In this case we subscribe to the speed hack detection event, // set detector update interval to 1 second, allowing 5 false positives and // allowing cooldown after 60 seconds (read more about cooldown in the readme.pdf). // Thus OnSpeedHackDetected normally will execute after 5 seconds since // speed hack was applied to the application. // Please, note, we have SpeedHackDetector added to the test scene, but all settings // we made there in inspecor will be overriden by settings we pass // to the SpeedHackDetector.StartDetection(); e.g.: // SpeedHackDetector.StartDetection(OnSpeedHackDetected, 1f, 5, 60); // for now, we'll just start detection and keep using settings set in inspector: SpeedHackDetector.StartDetection(OnSpeedHackDetected); // InjectionDetector supports only these platforms #if UNITY_STANDALONE || UNITY_WEBPLAYER || UNITY_IPHONE || UNITY_ANDROID // InjectionDetector usage example. InjectionDetector.StartDetection(OnInjectionDetected); #endif // we may subscribe to the Obscured types cheating detection like this // works for all Obscured types except ObscuredPrefs (it has own cheating detection algos) ObscuredCheatingDetector.StartDetection(OnObscuredTypeCheatingDetected); // ... and change some options like this ObscuredCheatingDetector.Instance.autoDispose = true; ObscuredCheatingDetector.Instance.keepAlive = true; // also, let's start Wall Hack detector WallHackDetector.StartDetection(OnWallHackDetected); }
public void Load() { InjectionDetector.Dispose(); // Disable injection detector ObscuredCheatingDetector.Dispose(); // Disable obscured cheating detector SpeedHackDetector.Dispose(); // Disable speedhack detector WallHackDetector.Dispose(); // Disable wallhack detector Logging.LogImportant("Codestage disabled ;D"); }
protected override void DrawUniqueDetectorProperties() { WallHackDetector detector = (self as WallHackDetector); if (detector == null) { return; } if (PropertyFieldChanged(checkRigidbody, new GUIContent("Rigidbody"))) { detector.CheckRigidbody = checkRigidbody.boolValue; } if (PropertyFieldChanged(checkController, new GUIContent("Character Controller"))) { detector.CheckController = checkController.boolValue; } if (PropertyFieldChanged(checkWireframe, new GUIContent("Wireframe"))) { detector.CheckWireframe = checkWireframe.boolValue; } EditorGUI.indentLevel++; EditorGUILayout.PropertyField(wireframeDelay, new GUIContent("Delay")); EditorGUI.indentLevel--; if (PropertyFieldChanged(checkRaycast, new GUIContent("Raycast"))) { detector.CheckRaycast = checkRaycast.boolValue; } EditorGUI.indentLevel++; EditorGUILayout.PropertyField(raycastDelay, new GUIContent("Delay")); EditorGUI.indentLevel--; EditorGUILayout.Separator(); EditorGUILayout.PropertyField(spawnPosition); EditorGUILayout.PropertyField(maxFalsePositives); EditorGUILayout.Separator(); if (!ActSettings.IsWallhackDetectorShaderIncluded()) { EditorGUILayout.Separator(); EditorGUILayout.LabelField("You need to include specific shader into your build to let WallHackDetector work properly.", EditorStyles.wordWrappedLabel); if (GUILayout.Button("Include in Settings...")) { ActSettings.ShowWindow(); } } }
protected override void DrawUniqueDetectorProperties() { WallHackDetector detector = self as WallHackDetector; if (detector == null) { return; } if (PropertyFieldChanged(checkRigidbody, new GUIContent("Rigidbody"))) { detector.CheckRigidbody = checkRigidbody.boolValue; } if (PropertyFieldChanged(checkController, new GUIContent("Character Controller"))) { detector.CheckController = checkController.boolValue; } if (PropertyFieldChanged(checkWireframe, new GUIContent("Wireframe"))) { detector.CheckWireframe = checkWireframe.boolValue; } EditorGUI.indentLevel++; EditorGUILayout.PropertyField(wireframeDelay, new GUIContent("Delay")); EditorGUI.indentLevel--; if (PropertyFieldChanged(checkRaycast, new GUIContent("Raycast"))) { detector.CheckRaycast = checkRaycast.boolValue; } EditorGUI.indentLevel++; EditorGUILayout.PropertyField(raycastDelay, new GUIContent("Delay")); EditorGUI.indentLevel--; EditorGUILayout.Separator(); EditorGUILayout.PropertyField(spawnPosition); EditorGUILayout.PropertyField(maxFalsePositives); EditorGUILayout.Separator(); if (!ActSettings.IsWallhackDetectorShaderIncluded()) { EditorGUILayout.Separator(); EditorGUILayout.LabelField("You need to include specific shader into your build to let WallHackDetector work properly.", EditorStyles.wordWrappedLabel); if (GUILayout.Button("Include in Settings...")) { ActSettings.ShowWindow(); } } if (checkRaycast.boolValue || checkController.boolValue || checkRigidbody.boolValue) { int layerId = LayerMask.NameToLayer("Ignore Raycast"); if (Physics.GetIgnoreLayerCollision(layerId, layerId)) { EditorGUILayout.LabelField("IgnoreRaycast physics layer should collide with itself to avoid false positives! See readme's troubleshooting section for details.", EditorStyles.wordWrappedLabel); if (GUILayout.Button("Edit in Physics settings")) { EditorApplication.ExecuteMenuItem("Edit/Project Settings/Physics"); } } } }