loottracker service: include time in loot record

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2019-02-13 10:01:20 +01:00
parent 125f3c7213
commit 0529d5d144
3 changed files with 8 additions and 5 deletions

View File

@@ -24,6 +24,7 @@
*/
package net.runelite.http.api.loottracker;
import java.time.Instant;
import java.util.Collection;
import lombok.AllArgsConstructor;
import lombok.Data;
@@ -37,4 +38,5 @@ public class LootRecord
private String eventId;
private LootRecordType type;
private Collection<GameItem> drops;
private Instant time;
}

View File

@@ -142,7 +142,7 @@ public class LootTrackerService
{
if (!gameItems.isEmpty())
{
LootRecord lootRecord = new LootRecord(current.getEventId(), current.getType(), gameItems);
LootRecord lootRecord = new LootRecord(current.getEventId(), current.getType(), gameItems, current.getTime());
lootRecords.add(lootRecord);
gameItems = new ArrayList<>();
@@ -157,7 +157,7 @@ public class LootTrackerService
if (!gameItems.isEmpty())
{
LootRecord lootRecord = new LootRecord(current.getEventId(), current.getType(), gameItems);
LootRecord lootRecord = new LootRecord(current.getEventId(), current.getType(), gameItems, current.getTime());
lootRecords.add(lootRecord);
}

View File

@@ -28,6 +28,7 @@ package net.runelite.client.plugins.loottracker;
import com.google.inject.Provides;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -274,7 +275,7 @@ public class LootTrackerPlugin extends Plugin
if (lootTrackerClient != null && config.saveLoot())
{
LootRecord lootRecord = new LootRecord(name, LootRecordType.NPC, toGameItems(items));
LootRecord lootRecord = new LootRecord(name, LootRecordType.NPC, toGameItems(items), Instant.now());
lootTrackerClient.submit(lootRecord);
}
}
@@ -291,7 +292,7 @@ public class LootTrackerPlugin extends Plugin
if (lootTrackerClient != null && config.saveLoot())
{
LootRecord lootRecord = new LootRecord(name, LootRecordType.PLAYER, toGameItems(items));
LootRecord lootRecord = new LootRecord(name, LootRecordType.PLAYER, toGameItems(items), Instant.now());
lootTrackerClient.submit(lootRecord);
}
}
@@ -350,7 +351,7 @@ public class LootTrackerPlugin extends Plugin
if (lootTrackerClient != null && config.saveLoot())
{
LootRecord lootRecord = new LootRecord(eventType, LootRecordType.EVENT, toGameItems(items));
LootRecord lootRecord = new LootRecord(eventType, LootRecordType.EVENT, toGameItems(items), Instant.now());
lootTrackerClient.submit(lootRecord);
}
}