-
-
Notifications
You must be signed in to change notification settings - Fork 5
Rewarded Captcha
Elijah Brown edited this page Apr 11, 2024
·
7 revisions
This module provides functionality to implement a simple client-side captcha. The method of operation is quite simple - the user needs to click on the icons in the sequence indicated at the top of the screen. After successful completion, you can give him a reward:
You can provide auto-configuration using Setup Wizzard or setup module manual:
// Initialize Module
Core.GameShield.Main.AddModule<RewardedCaptcha>();
// Get Module for API Requests
Core.GameShield.Main.GetModule<RewardedCaptcha>().PauseDetector(true);
Request Rewarded Captcha using Event:
EventMessenger.Main.Publish(new RequestCaptchaPayload {
NumOfImages = 5, // Number of Images for Captcha
OnError = (error) => {
// Captcha Solve Error
},
OnCanceled = () => {
// Captcha Canceled by User
},
OnComplete = () => {
// Captcha Completed by User
}
});
Unified for all modules Cheating Detection Event:
// Get Information when cheating detected
EventMessenger.Main.Subscribe<SecurityWarningPayload>(payload => {
// Work with payload
});
See Demo Example to learn how to use Captcha UI (CaptchaView.prefab):
This module provide IShieldModule interface methods with own functional extension:
Method | Usage |
---|---|
SetupModule | Setup Current Module with configuration and force reinitialization if it needed |
Disconnect | Disconnect Current Module |
PauseDetector | Pause / Resume cheating detection for current module |
IsPaused | Check if current module is paused |
GenerateCaptchaData | Generates an Array of Captcha orders (required and presented) |
GetData | Get current captcha data |
IsRightOrder | Compare an array of clicks with required clicks order generated at captcha data |
GetModuleInfo | Get Current Module info (used in assemblies searching) |