Merge remote-tracking branch 'runelite/master'
This commit is contained in:
@@ -54,6 +54,7 @@ public class RuneLiteAPI
|
||||
private static final Logger logger = LoggerFactory.getLogger(RuneLiteAPI.class);
|
||||
|
||||
public static final String RUNELITE_AUTH = "RUNELITE-AUTH";
|
||||
public static final String RUNELITE_MACHINEID = "RUNELITE-MACHINEID";
|
||||
|
||||
public static final OkHttpClient CLIENT;
|
||||
public static final Gson GSON = new Gson();
|
||||
|
||||
@@ -27,7 +27,7 @@ package net.runelite.http.api.ge;
|
||||
import com.google.gson.Gson;
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.http.api.RuneLiteAPI;
|
||||
import static net.runelite.http.api.RuneLiteAPI.JSON;
|
||||
@@ -39,12 +39,14 @@ import okhttp3.RequestBody;
|
||||
import okhttp3.Response;
|
||||
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class GrandExchangeClient
|
||||
{
|
||||
private static final Gson GSON = RuneLiteAPI.GSON;
|
||||
|
||||
private final UUID uuid;
|
||||
@Setter
|
||||
private UUID uuid;
|
||||
@Setter
|
||||
private String machineId;
|
||||
|
||||
public void submit(GrandExchangeTrade grandExchangeTrade)
|
||||
{
|
||||
@@ -53,8 +55,17 @@ public class GrandExchangeClient
|
||||
.build();
|
||||
|
||||
RequestBody body = RequestBody.Companion.create(GSON.toJson(grandExchangeTrade), JSON);
|
||||
Request request = new Request.Builder()
|
||||
.header(RuneLiteAPI.RUNELITE_AUTH, uuid.toString())
|
||||
Request.Builder builder = new Request.Builder();
|
||||
if (uuid != null)
|
||||
{
|
||||
builder.header(RuneLiteAPI.RUNELITE_AUTH, uuid.toString());
|
||||
}
|
||||
if (machineId != null)
|
||||
{
|
||||
builder.header(RuneLiteAPI.RUNELITE_MACHINEID, machineId);
|
||||
}
|
||||
|
||||
Request request = builder
|
||||
.post(body)
|
||||
.url(url)
|
||||
.build();
|
||||
|
||||
@@ -24,15 +24,18 @@
|
||||
*/
|
||||
package net.runelite.http.api.ge;
|
||||
|
||||
import java.time.Instant;
|
||||
import lombok.Data;
|
||||
import net.runelite.http.api.worlds.WorldType;
|
||||
|
||||
@Data
|
||||
public class GrandExchangeTrade
|
||||
{
|
||||
private boolean buy;
|
||||
private boolean cancel;
|
||||
private int itemId;
|
||||
private int quantity;
|
||||
private int total;
|
||||
private int price;
|
||||
private Instant time;
|
||||
private int offer;
|
||||
private WorldType worldType;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user