Skip to main content
Version: 5.11.4

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(Backend.IsInitialized) {
Backend.ErrorHandler.InitializePoll(true);

Backend.ErrorHandler.OnTooManyRequestError = () => {
Debug.Log("403 error occurred!!!");
gameObject.GetComponentInChildren<Text>().text = "Excessive requests detected.";
};
}
}

void Update() {
if(Backend.ErrorHandler.UseAsyncQueuePoll) {
Backend.ErrorHandler.Poll();
}
}

External thread

void Start() {
Backend.ErrorHandler.OnTooManyRequestByLocalError = () => {
Debug.Log("403 local error occurred!!!");
};
}