Skip to content

Instantly share code, notes, and snippets.

View Jire's full-sized avatar
🇧🇷
of the jungle

Jire Jire

🇧🇷
of the jungle
View GitHub Profile
import io.netty.bootstrap.Bootstrap;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelOption;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel;
(defproject void "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.8.0"] [io.netty/netty-all "4.1.0.CR7"]])
val buf = ByteBufPacketeer(ctx.alloc().directBuffer())
buf + 14.byte + 0.byte + 16.byte + 0.byte + 255.byte + 317.short + true
for (i in 1..29) buf + 0.short
buf + "acelta$it" + "password"
ctx.writeAndFlush(buf.data, ctx.voidPromise())
This file has been truncated, but you can view the full file.
Created new DefaultNode(com.acelta.net.Session$flushTask$1@5e8ba466)
Created new DefaultNode(com.acelta.net.Session$flushTask$1@2aa8364a)
Created new DefaultNode(com.acelta.net.Session$flushTask$1@5f527776)
Created new DefaultNode(com.acelta.net.Session$flushTask$1@2002e93e)
Created new DefaultNode(com.acelta.net.Session$flushTask$1@3705538)
Created new DefaultNode(com.acelta.net.Session$flushTask$1@1cbddc7c)
Created new DefaultNode(com.acelta.net.Session$flushTask$1@48844147)
Created new DefaultNode(com.acelta.net.Session$flushTask$1@78ad75ce)
Created new DefaultNode(com.acelta.net.Session$flushTask$1@78b17287)
Created new DefaultNode(com.acelta.net.Session$flushTask$1@4150e8a4)
@Sharable object HTTPHandler : SimpleChannelInboundHandler<HttpRequest>() {
private val files = Object2ObjectArrayMap<String, ByteBuf>(8)
override fun channelRead0(ctx: ChannelHandlerContext, msg: HttpRequest) {
val uri = msg.uri()
var buffer = files[uri]
if (buffer == null) {
val bytes = Files.readAllBytes(Paths.get(uri))
buffer = ctx.alloc().directBuffer(bytes.size)
buffer.writeBytes(bytes)
package com.acelta.world.mob
import com.acelta.world.mob.player.Player
import com.acelta.world.region.lastRegionX
import com.acelta.world.region.lastRegionY
import com.acelta.packet.outgoing.rs186.sector
import it.unimi.dsi.fastutil.ints.IntArrayList
import java.lang.Math.abs
import java.lang.Math.max
public final void updatePlayers(Buffer b, int size) {
int updateCount = 0;
b.startBitAccess(0);
currentPlane = b.readBits(2);
int tileX = b.readBits(7);
int tileY = b.readBits(7);
if (b.readBits(1) == 1) {
entityUpdateIndices[updateCount++] = LOCALPLAYER_INDEX;
@Jire
Jire / Indexer.kt
Created June 8, 2016 01:30
Zero-garbage fast iteration collection
package com.acelta.util
import com.acelta.world.mob.Mob
class Indexer<T : Mob>(val capacity: Int) : MutableIterable<T> {
private inner class Iterator : MutableIterator<T> {
internal var cursor = 0
@Jire
Jire / build.gradle
Created June 21, 2016 18:53
build.gradle of Wot
group 'org.jire.wot'
version '0.1'
ext {
kotlinVersion = "1.0.2-1"
gdxVersion = '1.9.3'
roboVMVersion = '2.1.0'
box2DLightsVersion = '1.4'
ashleyVersion = '1.7.0'
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import org.jire.kotmem.NativeBuffer;
import org.jire.kotmem.Process;
import java.util.HashMap;
import java.util.Map;
public final class KotmemJava {