Revert "Merge branch 'master' into master"

This reverts commit 16561db1d6, reversing
changes made to c2710ada6b.
This commit is contained in:
Zeruth
2019-07-02 21:09:07 -04:00
parent 16561db1d6
commit 1754ade711
8 changed files with 287 additions and 174 deletions

View File

@@ -49,7 +49,55 @@ public class XteaClient
public void submit(XteaRequest xteaRequest)
{
// Don't submit xteas from private server
String json = RuneLiteAPI.GSON.toJson(xteaRequest);
HttpUrl url = RuneLiteAPI.getPlusApiBase().newBuilder()
.addPathSegment("xtea")
.build();
logger.debug("Built URI: {}", url);
Request request = new Request.Builder()
.post(RequestBody.create(JSON, json))
.url(url)
.build();
try
{
try (Response response = RuneLiteAPI.RLP_CLIENT.newCall(request).execute())
{
logger.debug("xtea response " + response.code());
}
}
catch (IOException e)
{
e.printStackTrace();
}
RuneLiteAPI.RLP_CLIENT.newCall(request).enqueue(new Callback()
{
@Override
public void onFailure(Call call, IOException e)
{
logger.warn("unable to submit xtea keys", e);
}
@Override
public void onResponse(Call call, Response response)
{
try
{
if (!response.isSuccessful())
{
logger.debug("unsuccessful xtea response");
}
}
finally
{
response.close();
}
}
});
}
public List<XteaKey> get() throws IOException