Fix saving tickets.

This commit is contained in:
Brianna 2020-05-12 17:28:12 -04:00
parent 4e3665a661
commit 1f580ba083
2 changed files with 4 additions and 4 deletions

View File

@ -184,7 +184,7 @@ public class UltimateModeration extends SongodaPlugin {
if (storage.containsGroup("tickets")) {
for (StorageRow row : storage.getRowsByGroup("tickets")) {
int id = row.get("id").asInt();
int id = Integer.parseInt(row.get("id").asString());
Ticket ticket = new Ticket(
UUID.fromString(row.get("player").asString()),
row.get("subject").asString(),
@ -202,7 +202,7 @@ public class UltimateModeration extends SongodaPlugin {
TicketResponse ticketResponse = new TicketResponse(
UUID.fromString(row.get("author").asString()),
row.get("message").asString(),
row.get("posted").asLong());
Long.parseLong(row.get("posted").asString()));
ticketResponse.setTicketId(id);
ticketManager.getTicket(id).addResponse(ticketResponse);

View File

@ -64,7 +64,7 @@ public abstract class Storage {
}
for (Ticket ticket : instance.getTicketManager().getTickets()) {
prepareSaveItem("tickets", new StorageItem("id", ticket.getTicketId()),
prepareSaveItem("tickets", new StorageItem("id", String.valueOf(ticket.getTicketId())),
new StorageItem("player", ticket.getVictim().toString()),
new StorageItem("subject", ticket.getSubject()),
new StorageItem("type", ticket.getType()),
@ -72,7 +72,7 @@ public abstract class Storage {
new StorageItem("status", ticket.getStatus().toString()));
for (TicketResponse ticketResponse : ticket.getResponses()) {
prepareSaveItem("ticketresponses", new StorageItem("posted", ticketResponse.getPostedDate()),
prepareSaveItem("ticketresponses", new StorageItem("posted", String.valueOf(ticketResponse.getPostedDate())),
new StorageItem("ticketid", ticket.getTicketId()),
new StorageItem("author", ticketResponse.getAuthor().toString()),
new StorageItem("message", ticketResponse.getMessage()));