1
0
Fork 0
mirror of https://github.com/dragonfireclient/hydra-dragonfire.git synced 2024-11-21 10:24:01 -05:00
No description
Find a file
Lizzy Fleckenstein cdc8a5726e
Merge pull request #4 from Minetest-j45/master
Clarify usage for mt package fork
2023-01-06 21:30:46 +01:00
.github/workflows docker build and workflow 2022-12-23 14:31:24 +01:00
builtin Fix vector equals operator 2022-06-08 21:02:46 +02:00
convert Use dragonfire fork of mt 2022-06-09 00:20:27 +02:00
doc Doc fixes 2022-06-01 18:11:16 +02:00
example Add path finding 2022-06-08 20:20:45 +02:00
.gitignore Rename to hydra-dragonfire 2022-05-28 23:42:02 +02:00
client.go Fix deadlock on auth fail 2022-06-09 01:01:15 +02:00
comp_auth.go Use serializeVer variable in auth component 2022-06-09 01:15:06 +02:00
comp_map.go Use dragonfire fork of mt 2022-06-09 00:20:27 +02:00
comp_pkts.go Fix deadlock on auth fail 2022-06-09 01:01:15 +02:00
Dockerfile docker build and workflow 2022-12-23 14:31:24 +01:00
go.mod Use dragonfire fork of mt 2022-06-09 00:20:27 +02:00
go.sum Use dragonfire fork of mt 2022-06-09 00:20:27 +02:00
hydra.go Handle SIGUSR1 by printing stack trace 2022-06-09 01:00:19 +02:00
LICENSE Create LICENSE 2022-05-28 15:44:50 +02:00
map.go Fix deadlock on auth fail 2022-06-09 01:01:15 +02:00
path.go Fix deadlock on auth fail 2022-06-09 01:01:15 +02:00
poll.go Event system 2022-05-31 18:10:27 +02:00
README.md Update README.md 2023-01-06 19:12:50 +00:00

Hydra

Lua bindings for client side minetest protocol - written in Go, using a fork of anon5's mt package. Capable of deserializing ToClt packets and serializing ToSrv packets.

Main use case are bot clients. Multiple clients can easily be spawend and polled from one script - hence the name "Hydra". Hydra may also be useful for integration testing or network debugging.

Hydra is WIP: there are bugs, API may change any time, doc is incomplete, some packets are unimplemented and many components are yet to be added. However, hydra can already be used and big parts of it's main functionality are implemented.

Installation

Go 1.18 is required. go install github.com/dragonfireclient/hydra-dragonfire@latest

Invocation

Due to limitations of Go, hydra unfortunately cannot be require()'d from a Lua script. Instead, the hydra binary has to be invoked with a script as argument: hydra-dragonfire file.lua <args>. Any additional arguments <args> are provided to the script.

Architecture Overview

By default, hydra will only take care of connection and packet serialization, no state management takes place. Hydra is a library, not a framework: it does not organize your code and there is no module system.

Multiple clients can be created independently by calling the hydra.client function. poll can be used on one or multiple clients to receive packets and send can be used to send packets. Only selected packets will be returned by poll, to avoid unnecessary conversion of packets to Lua. Poll will return early if the script is interrupted by a signal, one of the selected clients is disconnected or the configured timeout elapses.

Additionally, different native components can be enabled per-client to manage state. Currently auth and map components are available, and components like objs, inv, pos, player_list etc. will be added in the future. Components handle packets asynchronously, they will process them even if poll is not called.

Further Documentation

API documentation