OnTooManyRequestError
Description
This handler is called automatically and restricts requests from the server when excessive requests are sent, such as in the case of making at least 1 call per second.
When excessive requests are detected, making requests becomes available after 5 minutes and 30 seconds.
The handler is called when the following error is returned:
When too many requests are sent from one client(same IP)
statusCode : 403
errorCode : Forbidden
Example
Main thread
void Start() {
if(Backnd.IsInitialized) {
Backnd.ErrorHandler.InitializePoll(true);
Backnd.ErrorHandler.OnTooManyRequestError = () => {
Debug.Log("403 error occurred!!!");
gameObject.GetComponentInChildren<Text>().text = "Excessive requests detected.";
};
}
}
void Update() {
if(Backnd.ErrorHandler.UseAsyncQueuePoll) {
Backnd.ErrorHandler.Poll();
}
}
External thread
void Start() {
Backnd.ErrorHandler.OnTooManyRequestByLocalError = () => {
Debug.Log("403 local error occurred!!!");
};
}