diff --git a/CommonCore/SQL/src/de/steamwar/sql/Event.java b/CommonCore/SQL/src/de/steamwar/sql/Event.java index a92cc9f2..5a4477bf 100644 --- a/CommonCore/SQL/src/de/steamwar/sql/Event.java +++ b/CommonCore/SQL/src/de/steamwar/sql/Event.java @@ -64,7 +64,7 @@ public class Event { } public static Event create(String eventName, Timestamp start, Timestamp end){ - return get(create.insertGetKey(eventName, start, start, end, 5, false, false)); + return get(create.insertGetKey(eventName, start, start, end, 5, false)); } public static Event get(int eventID){ diff --git a/CommonCore/SQL/src/de/steamwar/sql/NodeData.java b/CommonCore/SQL/src/de/steamwar/sql/NodeData.java index 0de6c6c5..a8d7c099 100644 --- a/CommonCore/SQL/src/de/steamwar/sql/NodeData.java +++ b/CommonCore/SQL/src/de/steamwar/sql/NodeData.java @@ -65,6 +65,10 @@ public class NodeData { private SchematicFormat nodeFormat; public InputStream schemData() throws IOException { + return schemData(true); + } + + public InputStream schemData(boolean decompress) throws IOException { try { return selSchemData.select(rs -> { rs.next(); @@ -73,7 +77,11 @@ public class NodeData { if(rs.wasNull() || schemData.available() == 0) { throw new SecurityException("SchemData is null"); } - return new GZIPInputStream(schemData); + if (decompress) { + return new GZIPInputStream(schemData); + } else { + return schemData; + } } catch (IOException e) { throw new SecurityException("SchemData is wrong", e); } diff --git a/WebsiteBackend/src/de/steamwar/routes/Events.kt b/WebsiteBackend/src/de/steamwar/routes/Events.kt index 4b4c6206..d1edcf07 100644 --- a/WebsiteBackend/src/de/steamwar/routes/Events.kt +++ b/WebsiteBackend/src/de/steamwar/routes/Events.kt @@ -32,6 +32,7 @@ import kotlinx.serialization.Serializable import java.lang.StringBuilder import java.sql.Timestamp import java.time.Instant +import java.util.* @Serializable data class ShortEvent(val id: Int, val name: String, val start: Long, val end: Long) { @@ -82,8 +83,8 @@ data class UpdateEvent( val maxTeamMembers: Int? = null, val schemType: String? = null, val publicSchemsOnly: Boolean? = null, - val addReferee: Set? = null, - val removeReferee: Set? = null, + val addReferee: Set? = null, + val removeReferee: Set? = null, ) fun Route.configureEventsRoute() { @@ -204,13 +205,13 @@ fun Route.configureEventsRoute() { if (updateEvent.addReferee != null) { updateEvent.addReferee.forEach { - Referee.add(event.eventID, it) + Referee.add(event.eventID, SteamwarUser.get(UUID.fromString(it)).id) } } if (updateEvent.removeReferee != null) { updateEvent.removeReferee.forEach { - Referee.remove(event.eventID, it) + Referee.remove(event.eventID, SteamwarUser.get(UUID.fromString(it)).id) } } event.update(eventName, deadline, start, end, schemType, maxTeamMembers, publicSchemsOnly) diff --git a/WebsiteBackend/src/de/steamwar/routes/Page.kt b/WebsiteBackend/src/de/steamwar/routes/Page.kt index 9b28ddd5..6f9a9fc4 100644 --- a/WebsiteBackend/src/de/steamwar/routes/Page.kt +++ b/WebsiteBackend/src/de/steamwar/routes/Page.kt @@ -108,7 +108,7 @@ fun Route.configurePage() { json() } defaultRequest { - url("https://steamwar.de/devlabs/api/v1/") + url("https://git.steamwar.de/api/v1/") header("Authorization", "token " + config.giteaToken) } } diff --git a/WebsiteBackend/src/de/steamwar/routes/Schematic.kt b/WebsiteBackend/src/de/steamwar/routes/Schematic.kt index 02f12243..1beb0f29 100644 --- a/WebsiteBackend/src/de/steamwar/routes/Schematic.kt +++ b/WebsiteBackend/src/de/steamwar/routes/Schematic.kt @@ -95,7 +95,7 @@ fun Route.configureSchematic() { } call.response.header("Content-Disposition", "attachment; filename=\"${node.name}${data.nodeFormat.fileEnding}\"") - call.respondBytes(data.schemData().readAllBytes(), contentType = ContentType.Application.OctetStream, status = HttpStatusCode.OK) + call.respondBytes(data.schemData(false).readAllBytes(), contentType = ContentType.Application.OctetStream, status = HttpStatusCode.OK) } get("/info") { val node = call.receiveSchematic() ?: return@get