Merge pull request #339 from runelite-extended/switchtooursession
Switch to our session endpoint
This commit is contained in:
@@ -48,6 +48,7 @@ public class RuneLiteAPI
|
||||
public static String userAgent;
|
||||
|
||||
private static final String BASE = "https://api.runelite.net";
|
||||
private static final String RLPLUS = "https://session.runelitepl.us";
|
||||
private static final String WSBASE = "https://api.runelite.net/ws";
|
||||
private static final String STATICBASE = "https://static.runelite.net";
|
||||
private static final Properties properties = new Properties();
|
||||
@@ -100,6 +101,11 @@ public class RuneLiteAPI
|
||||
return HttpUrl.parse(BASE);
|
||||
}
|
||||
|
||||
public static HttpUrl getSessionBase()
|
||||
{
|
||||
return HttpUrl.parse(RLPLUS);
|
||||
}
|
||||
|
||||
public static HttpUrl getApiBase()
|
||||
{
|
||||
return HttpUrl.parse(BASE + "/runelite-" + getVersion());
|
||||
|
||||
@@ -39,13 +39,12 @@ class SessionClient
|
||||
{
|
||||
UUID open() throws IOException
|
||||
{
|
||||
HttpUrl url = RuneLiteAPI.getApiRoot().newBuilder()
|
||||
.addPathSegment("session")
|
||||
.build();
|
||||
HttpUrl url = RuneLiteAPI.getSessionBase().newBuilder()
|
||||
.build();
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.url(url)
|
||||
.build();
|
||||
.url(url)
|
||||
.build();
|
||||
|
||||
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
|
||||
{
|
||||
@@ -62,15 +61,14 @@ class SessionClient
|
||||
|
||||
void ping(UUID uuid) throws IOException
|
||||
{
|
||||
HttpUrl url = RuneLiteAPI.getApiRoot().newBuilder()
|
||||
.addPathSegment("session")
|
||||
.addPathSegment("ping")
|
||||
.addQueryParameter("session", uuid.toString())
|
||||
.build();
|
||||
HttpUrl url = RuneLiteAPI.getSessionBase().newBuilder()
|
||||
.addPathSegment("ping")
|
||||
.addQueryParameter("session", uuid.toString())
|
||||
.build();
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.url(url)
|
||||
.build();
|
||||
.url(url)
|
||||
.build();
|
||||
|
||||
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
|
||||
{
|
||||
@@ -83,15 +81,14 @@ class SessionClient
|
||||
|
||||
void delete(UUID uuid) throws IOException
|
||||
{
|
||||
HttpUrl url = RuneLiteAPI.getApiRoot().newBuilder()
|
||||
.addPathSegment("session")
|
||||
.addQueryParameter("session", uuid.toString())
|
||||
.build();
|
||||
HttpUrl url = RuneLiteAPI.getSessionBase().newBuilder()
|
||||
.addQueryParameter("session", uuid.toString())
|
||||
.build();
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.delete()
|
||||
.url(url)
|
||||
.build();
|
||||
.delete()
|
||||
.url(url)
|
||||
.build();
|
||||
|
||||
RuneLiteAPI.CLIENT.newCall(request).execute().close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user