Added Api Call checking if the Mod has the latest version and Message in Main Menu if not up-to-date
Removed unused GuiConstants Fields
This commit is contained in:
@@ -202,6 +202,12 @@ public class ApiClient {
|
||||
invokeAndReturn(builder, Success.class);
|
||||
}
|
||||
|
||||
public boolean isVersionUpToDate(String versionIdentifier) throws IOException, ApiException {
|
||||
QueryBuilder builder = new QueryBuilder(ReplayModApiMethods.up_to_date);
|
||||
builder.put("version", versionIdentifier);
|
||||
return invokeAndReturn(builder, Success.class).isSuccess();
|
||||
}
|
||||
|
||||
private <T> T invokeAndReturn(QueryBuilder builder, Class<T> classOfT) throws IOException, ApiException {
|
||||
return invokeAndReturn(builder.toString(), classOfT);
|
||||
}
|
||||
|
||||
@@ -20,4 +20,5 @@ public class ReplayModApiMethods {
|
||||
public static final String check_auth = REPLAYMOD_BASE_URL+"check_auth";
|
||||
public static final String get_language = REPLAYMOD_BASE_URL+"get_language";
|
||||
public static final String search = REPLAYMOD_BASE_URL+"search";
|
||||
public static final String up_to_date = REPLAYMOD_BASE_URL+"up_to_date";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user