Skip to content

anthill-platform/anthill-runtime-java-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Server extention for Java Runtime for Anthill Platform

This Runtime extends Java Runtime, adding functionality for Game Server to communicate with Controller Service.

How To Use

  1. Override GameServerController class
public class YourServerController extends GameServerController
{
    public YourServerController(String socket)
    {
        super(socket);
    }

    @Override
    protected String getStatus()
    {
        return "ok";
    }
}

See this for getStatus() method reference.

  1. Instantiate it in your Game Server instance
ServerController = new YourServerController(sockets);
  1. Once you Game Server instance initialized, call Initialized Request:
ServerController.inited(settings, new GameServerController.InitedHandler()
{
    @Override
    public void result(boolean success)
    {
        if (!success)
        {
            System.exit(-1);
        }
    }
});
  1. Once a Player connected, call ServerController.joined and one a Player left, call ServerController.left.

Installation

On Linux and Mac OS X, you would need to install ZeroMQ library to your system for the whole package to work.

Linux (Debian stretch):

apt install -y libzmq5-dev

Mac Os X:

brew install zmq

Gradle

  1. Add the JitPack repository to your build.gradle file
allprojects {
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
}
  1. Add the dependency:
dependencies {
    compile 'com.github.anthill-platform:anthill-runtime-java-server:0.1.8'
}

Maven

  1. Add the JitPack repository to your pom.xml file
<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>
  1. Add the dependency:
<dependency>
    <groupId>com.github.anthill-platform</groupId>
    <artifactId>anthill-runtime-java-server</artifactId>
    <version>0.1.8</version>
</dependency>

About

Server extension for Java Runtime for Anthill Platform

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages