Skip to content
jython234 edited this page Jul 24, 2015 · 5 revisions

Requirements

This tutorial assumes you have the JRakLib JAR in your compile and runtime classpaths. You must also have general knowledge of bytes and data types.

Setting up the server interface

In order to use the library, you must create a class that implements the interface net.beaconpe.jraklib.server.ServerInstance. An example is shown below:

import net.beaconpe.jraklib.protocol.EncapsulatedPacket;
import net.beaconpe.jraklib.server.ServerInstance;

/**
 * A very simple ServerInstance class.
 */
public class JRakLibInterface implements ServerInstance{
    @Override
    public void openSession(String identifier, String s1, int i, long l) {
        
    }

    @Override
    public void closeSession(String s, String s1) {

    }

    @Override
    public void handleEncapsulated(String s, EncapsulatedPacket encapsulatedPacket, int i) {

    }

    @Override
    public void handleRaw(String s, int i, byte[] bytes) {

    }

    @Override
    public void notifyACK(String s, int i) {

    }

    @Override
    public void handleOption(String s, String s1) {

    }
}

Clone this wiki locally