Open-source multiplayer game server compatible with the RuneScape client
https://www.openrs2.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
1013 B
26 lines
1013 B
package org.openrs2.cache.cli
|
|
|
|
import com.github.ajalt.clikt.core.CliktCommand
|
|
import com.github.ajalt.clikt.parameters.arguments.argument
|
|
import com.github.ajalt.clikt.parameters.types.path
|
|
import com.google.inject.Guice
|
|
import io.netty.buffer.ByteBufAllocator
|
|
import org.openrs2.cache.CacheModule
|
|
import org.openrs2.cache.OpenNxtStore
|
|
import org.openrs2.cache.Store
|
|
import org.openrs2.inject.CloseableInjector
|
|
|
|
public class OpenNxtUnpackCommand : CliktCommand(name = "unpack-opennxt") {
|
|
private val input by argument().path(mustExist = true, canBeFile = false, mustBeReadable = true)
|
|
private val output by argument().path(canBeFile = false, mustBeReadable = true, mustBeWritable = true)
|
|
|
|
override fun run() {
|
|
CloseableInjector(Guice.createInjector(CacheModule)).use { injector ->
|
|
val alloc = injector.getInstance(ByteBufAllocator::class.java)
|
|
|
|
Store.open(output, alloc).use { store ->
|
|
OpenNxtStore.unpack(input, store)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|