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.
14 lines
415 B
14 lines
415 B
2 years ago
|
package org.openrs2.protocol.js5.downstream
|
||
4 years ago
|
|
||
|
import io.netty.buffer.ByteBuf
|
||
|
import io.netty.channel.ChannelHandlerContext
|
||
|
import io.netty.handler.codec.MessageToMessageEncoder
|
||
|
|
||
|
public class XorEncoder : MessageToMessageEncoder<ByteBuf>(ByteBuf::class.java) {
|
||
|
public var key: Int = 0
|
||
|
|
||
|
override fun encode(ctx: ChannelHandlerContext, msg: ByteBuf, out: MutableList<Any>) {
|
||
|
out += msg.xor(key)
|
||
|
}
|
||
|
}
|