mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-23 07:40:28 +02:00
Modified internal configuration classes, Updated Mojang UUID fetcher, other various method and documentation tweaks
This commit is contained in:
@@ -31,13 +31,13 @@ import java.util.ArrayDeque;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class SQLUUIDHandler extends UUIDHandlerImplementation {
|
||||
|
||||
final int MAX_REQUESTS = 500;
|
||||
private final String PROFILE_URL =
|
||||
"https://sessionserver.mojang.com/session/minecraft/profile/";
|
||||
private final int INTERVAL = 12000;
|
||||
private final JSONParser jsonParser = new JSONParser();
|
||||
private final SQLite sqlite;
|
||||
|
||||
@@ -133,7 +133,10 @@ public class SQLUUIDHandler extends UUIDHandlerImplementation {
|
||||
"Invalid response from Mojang: Some UUIDs will be cached later. (`unknown` until then or player joins)");
|
||||
}
|
||||
try {
|
||||
Thread.sleep(INTERVAL * 50);
|
||||
//Mojang allows requests every 10 minutes according to https://wiki.vg/Mojang_API
|
||||
//15 Minutes is chosen here since system timers are not always precise
|
||||
//and it should provide enough time where Mojang won't block requests.
|
||||
TimeUnit.MINUTES.sleep(15);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
break;
|
||||
@@ -142,7 +145,6 @@ public class SQLUUIDHandler extends UUIDHandlerImplementation {
|
||||
if (whenDone != null) {
|
||||
whenDone.run();
|
||||
}
|
||||
return;
|
||||
});
|
||||
});
|
||||
} catch (SQLException e) {
|
||||
|
Reference in New Issue
Block a user