Пример #1
0
		protected override bool DrawUniqueDetectorProperties()
		{
			if (!ACTkSettings.Instance.InjectionDetectorEnabled)
			{
				using (GUITools.Vertical(GUITools.PanelWithBackground))
				{
					EditorGUILayout.Separator();
					EditorGUILayout.HelpBox("Injection Detector support is not enabled! Injection Detector will not work properly", 
						MessageType.Error, true);

					using (new GUILayout.HorizontalScope())
					{
						if (GUILayout.Button("Enable Now"))
						{
							ACTkSettings.Instance.InjectionDetectorEnabled = true;
						}
						if (GUILayout.Button("Enable In settings..."))
						{
							ACTkSettings.Show();
						}
					}

					EditorGUILayout.Separator();
				}

				return true;
			}

			if (SettingsUtils.IsIL2CPPEnabled())
			{
				EditorGUILayout.HelpBox("Mono Injections are not possible in IL2CPP, this detector is not needed in IL2CPP builds", 
					MessageType.Info, true);

				return true;
			}

			if (!InjectionRoutines.IsTargetPlatformCompatible())
			{
				EditorGUILayout.HelpBox("Injection Detection is only supported in Standalone and Android builds", 
					MessageType.Warning, true); 

				return true;
			}

			return false;
		}
Пример #2
0
        protected override bool DrawUniqueDetectorProperties()
        {
            var detector = self;

            if (detector == null)
            {
                return(false);
            }

            DrawHeader("Specific settings");

            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);
            if (Vector3.Distance(spawnPosition.vector3Value, Vector3.zero) <= 0.001f)
            {
                EditorGUILayout.HelpBox("Please consider placing spawn position as far from your moving objects as possible to avoid false positives", MessageType.Warning);
                EditorGUILayout.Space();
            }
            EditorGUILayout.PropertyField(maxFalsePositives);

            EditorGUILayout.Separator();

            if (checkWireframe.boolValue && !SettingsGUI.IsWallhackDetectorShaderIncluded())
            {
                using (GUITools.Vertical(GUITools.PanelWithBackground))
                {
                    EditorGUILayout.Separator();
                    EditorGUILayout.HelpBox("Wallhack Detector shader for Wireframe checks is not included into the build! Detector may work incorrectly",
                                            MessageType.Error, true);

                    if (GUILayout.Button("Include in Settings..."))
                    {
                        ACTkSettings.Show();
                    }

                    EditorGUILayout.Separator();
                }
            }

            if (checkRaycast.boolValue || checkController.boolValue || checkRigidbody.boolValue)
            {
                var 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");
                    }
                }
            }

            return(true);
        }
Пример #3
0
        private static void OnHierarchyChanged()
        {
            if (!injectionValidated && !ACTkSettings.Instance.DisableInjectionDetectorValidation)
            {
                var instance = InjectionDetector.Instance;
                if (instance != null)
                {
                    if (InjectionRoutines.IsInjectionPossible())
                    {
                        if (!ACTkSettings.Instance.InjectionDetectorEnabled)
                        {
                            var result = EditorUtility.DisplayDialogComplex("Anti-Cheat Toolkit Validation",
                                                                            "ACTk noticed you're using Injection Detector but you have build detection support disabled.\n" +
                                                                            "Injection Detector needs it enabled in order to work properly.\nWould you like to enable it now?",
                                                                            "Yes", "Open Settings", "No, never ask again");

                            if (result == 0)
                            {
                                ACTkSettings.Instance.InjectionDetectorEnabled = true;
                            }
                            else if (result == 1)
                            {
                                ACTkSettings.Show();
                                return;
                            }
                            else
                            {
                                ACTkSettings.Instance.DisableInjectionDetectorValidation = true;
                            }
                        }
                    }
                }
                injectionValidated = true;
            }

            if (!wallhackValidated && !ACTkSettings.Instance.DisableWallhackDetectorValidation)
            {
                var instance = WallHackDetector.Instance;
                if (instance != null && instance.CheckWireframe)
                {
                    if (!SettingsGUI.IsWallhackDetectorShaderIncluded())
                    {
                        var result = EditorUtility.DisplayDialog("Anti-Cheat Toolkit Validation",
                                                                 "ACTk noticed you're using Wallhack Detector with Wireframe option enabled but you have no required shader added" +
                                                                 " to the Always Included Shaders.\n" +
                                                                 "Would you like to exit Play Mode and open Settings to include it now?",
                                                                 "Yes", "No, never ask again");

                        if (result)
                        {
                            EditorApplication.isPlaying = false;
                            ACTkSettings.Show();
                        }
                        else
                        {
                            ACTkSettings.Instance.DisableWallhackDetectorValidation = true;
                        }
                    }
                }
                wallhackValidated = true;
            }
        }