Added GuiRegister to allow users to create a new account on ReplayMod.com from the Mod itself

This commit is contained in:
CrushedPixel
2015-05-03 21:58:24 +02:00
parent 38ca7a0054
commit 5a3e3575c3
11 changed files with 327 additions and 27 deletions

View File

@@ -29,6 +29,15 @@ public class ApiClient {
return auth;
}
public AuthKey register(String username, String mail, String password) throws IOException, ApiException {
QueryBuilder builder = new QueryBuilder(ApiMethods.register);
builder.put("username", username);
builder.put("email", mail);
builder.put("password", password);
AuthKey auth = invokeAndReturn(builder, AuthKey.class);
return auth;
}
public boolean logout(String auth) throws IOException, ApiException {
QueryBuilder builder = new QueryBuilder(ApiMethods.logout);
builder.put("auth", auth);

View File

@@ -2,6 +2,7 @@ package eu.crushedpixel.replaymod.api.client;
public class ApiMethods {
public static final String register = "register";
public static final String login = "login";
public static final String logout = "logout";
public static final String replay_files = "replay_files";