forked from openrs2/openrs2
This was actually only compatible with OpenOSRS's code (RuneLite uses a completely different API). Furthermore, I don't think it's really going to be necessary as we've arranged access to RuneLite's XTEA API. Signed-off-by: Graham <gpe@openrs2.org>bzip2
parent
e1f33158f2
commit
704687e262
@ -1,29 +0,0 @@ |
|||||||
package org.openrs2.archive.web |
|
||||||
|
|
||||||
import io.ktor.application.ApplicationCall |
|
||||||
import io.ktor.http.HttpStatusCode |
|
||||||
import io.ktor.response.respond |
|
||||||
import org.openrs2.archive.key.KeyImporter |
|
||||||
import org.openrs2.crypto.XteaKey |
|
||||||
import javax.inject.Inject |
|
||||||
import javax.inject.Singleton |
|
||||||
|
|
||||||
@Singleton |
|
||||||
public class KeysController @Inject constructor( |
|
||||||
private val importer: KeyImporter |
|
||||||
) { |
|
||||||
public suspend fun create(call: ApplicationCall) { |
|
||||||
val k0 = call.request.queryParameters["key1"]?.toIntOrNull() |
|
||||||
val k1 = call.request.queryParameters["key2"]?.toIntOrNull() |
|
||||||
val k2 = call.request.queryParameters["key3"]?.toIntOrNull() |
|
||||||
val k3 = call.request.queryParameters["key4"]?.toIntOrNull() |
|
||||||
|
|
||||||
if (k0 == null || k1 == null || k2 == null || k3 == null) { |
|
||||||
call.respond(HttpStatusCode.BadRequest) |
|
||||||
return |
|
||||||
} |
|
||||||
|
|
||||||
importer.import(listOf(XteaKey(k0, k1, k2, k3))) |
|
||||||
call.respond(HttpStatusCode.NoContent) |
|
||||||
} |
|
||||||
} |
|
Loading…
Reference in new issue