-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from runetopic/development
Development
- Loading branch information
Showing
61 changed files
with
231 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ plugins { | |
signing | ||
} | ||
|
||
version = "1.4.6-SNAPSHOT" | ||
version = "1.4.7-SNAPSHOT" | ||
|
||
java { | ||
withJavadocJar() | ||
|
20 changes: 20 additions & 0 deletions
20
cache/src/main/kotlin/com/runetopic/cache/codec/CodecType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.runetopic.cache.codec | ||
|
||
import com.runetopic.cache.codec.impl.BZip2Codec | ||
import com.runetopic.cache.codec.impl.GZipCodec | ||
import com.runetopic.cache.codec.impl.NoFileCodec | ||
|
||
/** | ||
* @author Tyler Telis | ||
* @email <xlitersps@gmail.com> | ||
* | ||
* @author Jordan Abraham | ||
*/ | ||
internal sealed class CodecType( | ||
val codec: IFileCodec | ||
) { | ||
object BadCodec: CodecType(NoFileCodec()) | ||
object NoCodec: CodecType(NoFileCodec()) | ||
object BZipCodec: CodecType(BZip2Codec()) | ||
object GZipCodec: CodecType(GZipCodec()) | ||
} |
4 changes: 2 additions & 2 deletions
4
.../runetopic/cache/compression/Container.kt → ...in/com/runetopic/cache/codec/Container.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
cache/src/main/kotlin/com/runetopic/cache/codec/Decompression.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@file:JvmName("Decompression") | ||
package com.runetopic.cache.codec | ||
|
||
/** | ||
* @author Jordan Abraham | ||
*/ | ||
fun ByteArray.decompress(keys: IntArray = intArrayOf()): ByteArray { | ||
return ContainerCodec.decompress(this, keys).data | ||
} | ||
|
||
fun ByteArray.decompress(): ByteArray { | ||
return ContainerCodec.decompress(this, intArrayOf()).data | ||
} |
10 changes: 10 additions & 0 deletions
10
cache/src/main/kotlin/com/runetopic/cache/codec/IFileCodec.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.runetopic.cache.codec | ||
|
||
/** | ||
* @author Tyler Telis | ||
* @email <xlitersps@gmail.com> | ||
*/ | ||
internal interface IFileCodec { | ||
fun compress(data: ByteArray, length: Int, keys: IntArray): ByteArray | ||
fun decompress(data: ByteArray, length: Int, keys: IntArray): ByteArray | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...pic/cache/compression/impl/NoFileCodec.kt → ...runetopic/cache/codec/impl/NoFileCodec.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
package com.runetopic.cache.compression.impl | ||
package com.runetopic.cache.codec.impl | ||
|
||
import com.runetopic.cache.compression.IFileCodec | ||
import com.runetopic.cache.codec.IFileCodec | ||
|
||
/** | ||
* @author Tyler Telis | ||
* @email <xlitersps@gmail.com> | ||
*/ | ||
internal class NoFileCodec: IFileCodec { | ||
override fun compress(data: ByteArray, length: Int, keys: Array<Int>): ByteArray { | ||
override fun compress(data: ByteArray, length: Int, keys: IntArray): ByteArray { | ||
throw NotImplementedError("No codec provided.") | ||
} | ||
|
||
override fun decompress(data: ByteArray, length: Int, keys: Array<Int>): ByteArray { | ||
override fun decompress(data: ByteArray, length: Int, keys: IntArray): ByteArray { | ||
throw NotImplementedError("No codec provided.") | ||
} | ||
} |
20 changes: 0 additions & 20 deletions
20
cache/src/main/kotlin/com/runetopic/cache/compression/CompressionType.kt
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
cache/src/main/kotlin/com/runetopic/cache/compression/IFileCodec.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
...runetopic/cache/hierarchy/index/IIndex.kt → .../runetopic/cache/hierarchy/index/Index.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
package com.runetopic.cache.hierarchy.index | ||
|
||
import com.runetopic.cache.hierarchy.index.group.IGroup | ||
import com.runetopic.cache.hierarchy.index.group.Group | ||
|
||
/** | ||
* @author Jordan Abraham | ||
*/ | ||
interface IIndex: Comparable<IIndex> { | ||
interface Index: Comparable<Index> { | ||
fun getId(): Int | ||
fun getCRC(): Int | ||
fun getWhirlpool(): ByteArray | ||
fun getCompression(): Int | ||
fun getProtocol(): Int | ||
fun getRevision(): Int | ||
fun getIsNamed(): Boolean | ||
fun getGroups(): Collection<IGroup> | ||
fun getGroup(groupId: Int): IGroup | ||
fun getGroup(groupName: String): IGroup | ||
fun getGroups(): Collection<Group> | ||
fun getGroup(groupId: Int): Group | ||
fun getGroup(groupName: String): Group | ||
fun expand(): Int | ||
|
||
fun use(block: (IIndex) -> Unit) = block.invoke(this) | ||
fun use(block: (Index) -> Unit) = block.invoke(this) | ||
|
||
override fun compareTo(other: IIndex): Int { | ||
override fun compareTo(other: Index): Int { | ||
return getId().compareTo(other.getId()) | ||
} | ||
} |
Oops, something went wrong.