forked from SteamWar/SteamWar
Merge branch 'main' into Schematics/1.21
# Conflicts: # VelocityCore/build.gradle.kts
This commit is contained in:
@@ -37,6 +37,9 @@ class Groups {
|
||||
private var groups: GroupsData = if (kGroupsFile.exists()) {
|
||||
Cbor.decodeFromByteArray(kGroupsFile.readBytes())
|
||||
} else {
|
||||
if (!kGroupsFile.parentFile.exists()) {
|
||||
kGroupsFile.parentFile.mkdirs()
|
||||
}
|
||||
kGroupsFile.createNewFile()
|
||||
kGroupsFile.writeBytes(Cbor.encodeToByteArray(GroupsData(mutableListOf())))
|
||||
|
||||
|
||||
@@ -234,7 +234,7 @@ fun Route.configureEventsRoute() {
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun ApplicationCall.receiveEvent(fieldName: String = "event"): Event? {
|
||||
suspend fun ApplicationCall.receiveEvent(fieldName: String = "id"): Event? {
|
||||
val eventId = parameters[fieldName]?.toIntOrNull()
|
||||
if (eventId == null) {
|
||||
respond(HttpStatusCode.BadRequest, ResponseError("Invalid event ID"))
|
||||
|
||||
Reference in New Issue
Block a user