static public int refreshMojang(Account acnt) { String[] str = MojangRequests.refresh(acnt.AccessToken, Account.ClientToken, acnt.Id, acnt.Name); //String[] str = { "OK", "{\"accessToken\":\"5c1da662b2484599a8f5903ea547c119\",\"clientToken\":\"ca5d8019489947a7cc2874cd422ddbc\",\"selectedProfile\":{\"id\":\"a73a7cfdc77a47b4967972b259db9b08\",\"name\":\"Qwerwer\"}}" }; int result = checkRequest(str); if (result > 0) { acnt.AccessToken = getValue(str[1], "accessToken"); acnt.Id = getValue(str[1], "id"); acnt.Name = getValue(str[1], "name"); } return(result); }
static public int authMojang(Account acnt, String pass) { String[] str = MojangRequests.authenticate(Account.ClientToken, acnt.Email, pass); //String[] str = { "OK", "{\"accessToken\":\"f237b93d2aef459585e7ca0682f0e1ce\",\"clientToken\":\"952984cf356392874ae7d4dfc84f42c\",\"selectedProfile\":{\"id\":\"a73a7cfdc77a47b4967972b259db9b08\",\"name\":\"Qwerwer\"},\"availableProfiles\":[{\"id\":\"a73a7cfdc77a47b4967972b259db9b08\",\"name\":\"Qwerwer\"}]}" }; int result = checkRequest(str); if (result > 0) { acnt.AccessToken = getValue(str[1], "accessToken"); acnt.Id = getValue(str[1], "id"); acnt.Name = getValue(str[1], "name"); } return(result); }
static public int invalidateMojang(Account acnt) { String[] str = MojangRequests.invalidate(acnt.AccessToken, Account.ClientToken); //String[] str = { "No Content", "" }; return(checkRequest(str)); }
static public int signoutMojang(Account acnt, String pass) { String[] str = MojangRequests.signout(acnt.Email, pass); //String[] str = { "No Content", "" }; return(checkRequest(str)); }