com.github.isaichkindanila:g-net-client

Client for g-net

Лицензия

Лицензия

Категории

Категории

Сеть CLI Взаимодействие с пользователем
Группа

Группа

com.github.isaichkindanila
Идентификатор

Идентификатор

g-net-client
Последняя версия

Последняя версия

1.0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

com.github.isaichkindanila:g-net-client
Client for g-net
Ссылка на сайт

Ссылка на сайт

https://github.com/isaichkindanila/g-net-client
Система контроля версий

Система контроля версий

http://github.com/isaichkindanila/g-net-client/tree/master

Скачать g-net-client

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.isaichkindanila/g-net-client/ -->
<dependency>
    <groupId>com.github.isaichkindanila</groupId>
    <artifactId>g-net-client</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.isaichkindanila/g-net-client/
implementation 'com.github.isaichkindanila:g-net-client:1.0.1'
// https://jarcasting.com/artifacts/com.github.isaichkindanila/g-net-client/
implementation ("com.github.isaichkindanila:g-net-client:1.0.1")
'com.github.isaichkindanila:g-net-client:jar:1.0.1'
<dependency org="com.github.isaichkindanila" name="g-net-client" rev="1.0.1">
  <artifact name="g-net-client" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.isaichkindanila', module='g-net-client', version='1.0.1')
)
libraryDependencies += "com.github.isaichkindanila" % "g-net-client" % "1.0.1"
[com.github.isaichkindanila/g-net-client "1.0.1"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.jetbrains : annotations jar 17.0.0

provided (1)

Идентификатор библиотеки Тип Версия
org.projectlombok : lombok jar 1.18.10

Модули Проекта

Данный проект не имеет модулей.

Usage

Add maven dependency:
<dependency>
    <groupId>com.github.isaichkindanila</groupId>
    <artifactId>g-net-client</artifactId>
    <version>1.0.1</version>
</dependency>
Implement ServerMessageHandler:
public class TestServerMessageHandler implements ServerMessageHandler {

    @Override
    public void handle(@NotNull ServerInit message) {
        System.out.println(message);
    }

    @Override
    public void handle(@NotNull ServerUpdate message) {
        System.out.println(message);
    }

    @Override
    public void handle(@NotNull ServerResults message) {
        System.out.println(message);
    }

    @Override
    public void handle(@NotNull ServerError message) {
        System.out.println(message);
    }
}
Instantiate Client:
Client client = new Client("localhost", 4321, new TestServerMessageHandler(), "test");
Start message receiver thread:
Thread receiver = client.startReceiveLoop(() -> System.out.println("receiver stopped"));
Send some messages:
var acc = new Vector(100.0, -20.0);
var dir = new Vector(-13.2, 11.7);
client.sendMessage(new ClientUpdate(acc, dir));

Working example available here

Версии библиотеки

Версия
1.0.1
1.0