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.
43 lines
1.1 KiB
43 lines
1.1 KiB
package org.openrs2.archive.client
|
|
|
|
import io.ktor.http.ContentType
|
|
|
|
public enum class OperatingSystem {
|
|
INDEPENDENT,
|
|
WINDOWS,
|
|
MACOS,
|
|
LINUX,
|
|
SOLARIS;
|
|
|
|
public fun getPrefix(): String {
|
|
return when (this) {
|
|
INDEPENDENT -> throw IllegalArgumentException()
|
|
WINDOWS -> ""
|
|
else -> "lib"
|
|
}
|
|
}
|
|
|
|
public fun getExtension(): String {
|
|
return when (this) {
|
|
INDEPENDENT -> throw IllegalArgumentException()
|
|
WINDOWS -> "dll"
|
|
MACOS -> "dylib"
|
|
LINUX, SOLARIS -> "so"
|
|
}
|
|
}
|
|
|
|
public fun getContentType(): ContentType {
|
|
return when (this) {
|
|
INDEPENDENT -> throw IllegalArgumentException()
|
|
WINDOWS -> PE
|
|
MACOS -> MACHO
|
|
LINUX, SOLARIS -> ELF_SHARED
|
|
}
|
|
}
|
|
|
|
private companion object {
|
|
private val ELF_SHARED = ContentType("application", "x-sharedlib")
|
|
private val MACHO = ContentType("application", "x-mach-binary")
|
|
private val PE = ContentType("application", "vnd.microsoft.portable-executable")
|
|
}
|
|
}
|
|
|