You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello i have a problem with the implementation of the API.
So this is my code
public void OnPlayerJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
IPInfo ipInfo = IPInfo.builder().setToken("***********").build();
try {
IPResponse response = ipInfo.lookupIP(player.getAddress().getAddress().getHostAddress());
System.out.println(response.getOrg());
int index = response.getOrg().toString().indexOf("Mobile");
if (index == 1) {
System.out.println("Vous venez de vous connecter avec une adresse IP mobile");
player.kickPlayer("Veuillez vous rendre sur le teamspeak.");
}
} catch (RateLimitedException ex) {
ex.getMessage();
// Handle rate limits here.
}
System.out.println("Le joueur qui vient de se connecter avec l'ip suivante : " + player.getAddress());
}
I got the error
Caused by: java.lang.ClassNotFoundException: io.ipinfo.api.errors.RateLimitedException
I know i have to handler error after the try catch but i don't know how !
Please your help can be helpfull thank you
The text was updated successfully, but these errors were encountered:
The error is 'ClassNotFoundException', so this is an environmental error and there's not that much I can help you with - check that your classpath is correct, and search online for related errors.
You're creating a brand new IPinfo client on every player join, and therefore not using the built-in caching systems which can help you not hit rate limits too quickly. You can create the client once outside of this function scope, and then use it in the function repeatedly.
Hello i have a problem with the implementation of the API.
So this is my code
public void OnPlayerJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
IPInfo ipInfo = IPInfo.builder().setToken("***********").build();
I got the error
Caused by: java.lang.ClassNotFoundException: io.ipinfo.api.errors.RateLimitedException
I know i have to handler error after the try catch but i don't know how !
Please your help can be helpfull thank you
The text was updated successfully, but these errors were encountered: