Skip to main content

A server and client implementation to talk to GloomhavenHelper Application

Project description

Gloomhaven Helper Server Client

Supports Gloomhaven Helper with network sync up to version 8.4.x

This project provides an open source alternative to talk to the application "Gloomhaven Helper".

A simple example would be to run a headless server (no GUI) and connect to it with your clients. The purpose of this would be to have a small inexpensive always-on computer with your gloomhaven game state (like a raspberry pi). With port-forwarding enabled in your router, your friends can connect over the internet and you don't have to forward internet traffic to your personal computer.

Another use-case is to connect as a client and hook it up to a bounch of hardware that changes depending on the game state.

The original purpose for this project was to connect an inexpensive wifi-enabled micro-controller to Gloomhaven Helper app and scan rfid/nfc tags to interact with the game state (like setting initiative or adding/removing characters). Because of this, the core protocol is implemented in c++ and wrapped in swig for python bindings. If you want to use this project with c++ directly, look at the c++ codebase and the Makefile to figure out how to use it.

Installation

Requires python 3.7 or higher

For an x86 (intel/amd cpu) running linux or macos, install with pip (3):

pip install gloomhavenhelper

For arm64/aarch64 systems, install with:

pip install https://github.com/Gronis/gloomhaven-helper-rfid/releases/download/0.1.1/gloomhavenhelper-0.1.1-py3-none-linux_aarch64.whl

for older arm versions, open an issue and I can see if I can provide a build for those systems as well.

Windows is not supported or tested. If you have a windows machine and want to host a server, I recommend just to use the original Gloomhaven Helper java application as a server.

Usage:

Use as a sever

python -m gloomhavenhelper

Use as a client

#!/usr/bin/env python

import glommhavenhelper as ghh
import asyncio

TCP_IP = '127.0.0.1' # server ip
TCP_PORT = 58888     # server port


async def on_game_state(message_number, game_state):
    # Do things with the game state.
    print("Got game state {}, round {}".format(message_number, game_state.round))
    # To understand what you can get out of the game state print it out
    ghh.print(game_state)


async def main():
    client = ghh.Client(TCP_IP, TCP_PORT)
    client.on_game_state = on_game_state
    await client.connect()
    print("Connected")

asyncio.get_event_loop().create_task(main())
asyncio.get_event_loop().run_forever()

Example of projects:

  • Video of scanning a tag/card and changing initiative

Build

This project requires

  • g++/clang++ or another c++ compiler
  • python3
  • swig
  • wheels (build wheels binary)
  • twine (upload wheels binary to pypi repository)

How to build

Run make python to build python code. The python module is placed in a out directory. Change to this directory and import gloomhavenhelper to try out your new build: cd out && python.

Run make wheel to build wheel library. The build will be located in dist folder. You can then install it with pip install dist/gloomhavenhelper-<some-more-stuff-here>.whl

If you want to clean up the workspace because your build is failing because of some old cached file, or you just want to clean up the workspace, use make clean.

License: MIT

Contributers

- Robin Grönberg

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

gloomhavenhelper-0.1.3-py3-none-macosx_10_12_x86_64.whl (685.5 kB view details)

Uploaded Python 3 macOS 10.12+ x86-64

File details

Details for the file gloomhavenhelper-0.1.3-py3-none-manylinux1_x86_64.whl.

File metadata

  • Download URL: gloomhavenhelper-0.1.3-py3-none-manylinux1_x86_64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.1

File hashes

Hashes for gloomhavenhelper-0.1.3-py3-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 76eb8db65fc68688a84f8242fe66954fc93a48e42ad0ab2bd7af1ea1fbec1392
MD5 9f86d02f3019ec5fd01dcecda8edc5cd
BLAKE2b-256 3cd154934017a862f47e84b6c76a6807784b3a412f4da223b8c582ad21ac1587

See more details on using hashes here.

File details

Details for the file gloomhavenhelper-0.1.3-py3-none-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: gloomhavenhelper-0.1.3-py3-none-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 685.5 kB
  • Tags: Python 3, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.5

File hashes

Hashes for gloomhavenhelper-0.1.3-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 1042b2397e3530af30b6a8ed7e9f1963c23d958aee99ee75efe324a3219c7636
MD5 d9a13898ddc52662e04b7dec66899b87
BLAKE2b-256 63ca117557ce0254fd484d7d9ab3c9c17ebb0ca3d177b8b4f64bd4501fbdad45

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page