From f07e67b3fd5dc4452db355cb44f911e98cf5ca68 Mon Sep 17 00:00:00 2001 From: bel Date: Sun, 26 Mar 2023 16:24:08 -0600 Subject: [PATCH] export host.d to -venue repo --- host.d/README.md | 62 ------------------- host.d/config.d/mayhem-party.d/env.env | 11 ---- .../mayhem-party.d/remap.d/.players_offset.py | 31 ---------- .../config.d/mayhem-party.d/remap.d/live.yaml | 1 - .../remap.d/players_offset_0.yaml | 1 - .../remap.d/players_offset_1.yaml | 55 ---------------- .../remap.d/players_offset_2.yaml | 55 ---------------- .../remap.d/players_offset_3.yaml | 55 ---------------- .../remap.d/players_offset_4.yaml | 55 ---------------- .../config.d/mayhem-party.d/remap.d/rotate.sh | 21 ------- host.d/config.d/mayhem-party.d/v01.yaml | 23 ------- host.d/config.d/rusty-pipe.d/1.yaml | 30 --------- host.d/config.d/rusty-pipe.d/2.yaml | 30 --------- host.d/config.d/rusty-pipe.d/3.yaml | 30 --------- host.d/config.d/rusty-pipe.d/4.yaml | 30 --------- host.d/config.d/rusty-pipe.d/5.yaml | 30 --------- host.d/config.d/rusty-pipe.d/6.yaml | 30 --------- host.d/config.d/rusty-pipe.d/7.yaml | 30 --------- host.d/config.d/rusty-pipe.d/rusty-pipe.exe | 1 - host.d/config.d/stt.d/hotwords.txt | 5 -- 20 files changed, 586 deletions(-) delete mode 100644 host.d/README.md delete mode 100644 host.d/config.d/mayhem-party.d/env.env delete mode 100644 host.d/config.d/mayhem-party.d/remap.d/.players_offset.py delete mode 120000 host.d/config.d/mayhem-party.d/remap.d/live.yaml delete mode 100644 host.d/config.d/mayhem-party.d/remap.d/players_offset_0.yaml delete mode 100644 host.d/config.d/mayhem-party.d/remap.d/players_offset_1.yaml delete mode 100644 host.d/config.d/mayhem-party.d/remap.d/players_offset_2.yaml delete mode 100644 host.d/config.d/mayhem-party.d/remap.d/players_offset_3.yaml delete mode 100644 host.d/config.d/mayhem-party.d/remap.d/players_offset_4.yaml delete mode 100644 host.d/config.d/mayhem-party.d/remap.d/rotate.sh delete mode 100644 host.d/config.d/mayhem-party.d/v01.yaml delete mode 100644 host.d/config.d/rusty-pipe.d/1.yaml delete mode 100644 host.d/config.d/rusty-pipe.d/2.yaml delete mode 100644 host.d/config.d/rusty-pipe.d/3.yaml delete mode 100644 host.d/config.d/rusty-pipe.d/4.yaml delete mode 100644 host.d/config.d/rusty-pipe.d/5.yaml delete mode 100644 host.d/config.d/rusty-pipe.d/6.yaml delete mode 100644 host.d/config.d/rusty-pipe.d/7.yaml delete mode 120000 host.d/config.d/rusty-pipe.d/rusty-pipe.exe delete mode 100644 host.d/config.d/stt.d/hotwords.txt diff --git a/host.d/README.md b/host.d/README.md deleted file mode 100644 index 5fbd1e5..0000000 --- a/host.d/README.md +++ /dev/null @@ -1,62 +0,0 @@ -# Hosting a Mayhem Party - -## Requirements - -1. [`rusty-pipe`](https://gogs.inhome.blapointe.com/bel/rusty-pipe) -1. [`mayhem-party`](https://gogs.inhome.blapointe.com/bel/mayhem-party) -1. [`stt`](https://gogs.inhome.blapointe.com/bel/stt) - -# Clients - -## Distribute `rusty-pipe` - -```bash -# https://www.reddit.com/r/rust/comments/5k8uab/crosscompiling_from_ubuntu_to_windows_with_rustup/ -( - echo '[target.x86_64-pc-windows-gnu]' - echo 'linker = "x86_64-w64-mingw32-gcc"' - echo 'ar = "x86_64-w64-mingw32-gcc-ar"' -) >> $HOME/.cargo/config -sudo apt install mingw-w64 -rustup target add x86_64-pc-windows-gnu -echo windows -cargo build --release --target x86_64-pc-windows-gnu && ls target/x86_64-pc-windows-gnu/release/rusty-pipe.exe -echo local -cargo install --path ./ -``` - -Each client needs 1 executable and 1 env file with a unique set of buttons - -> 10 buttons per player -> `go doc key Undef | grep Key | grep -v Undef | wc -l` total (51) - -The server cannot be a client because math. Maybe a VM on the client as a server would work tho. - -See `./config.d/rusty-pipe.d` - -# Server - -## TTS - -`cd /home/breel/Go/src/gogs.inhome.blapointe.com/tts/larynx.d; bash run.sh` - -## STT - -`cd /home/breel/Go/src/gogs.inhome.blapointe.com/stt.d/whisper-2023; HOTWORDS=/home/breel/Go/src/gogs.inhome.blapointe.com/mayhem-party.d/host.d/config.d/stt.d/hotwords.txt MIC_TIMEOUT=2 URL=http://localhost:17071/config HEADERS=say='Eye herd {{hotword}}' BODY='[{"op":"replace", "path":"/Quiet", "value":true}]' python3 ./hotwords.py' - -## `mayhem-party` - -### Configs - -`cd ./config.d/mayhem-party.d/remap.d; bash ./rotate.sh` - -> rotate anytime via stdin or `pkill -SIGUSR1 -f rotate.sh` - -### Binary - -`bash -c 'true; source ./config.d/mayhem-party.d/env.env; mayhem-party'` - -## Game Playing - -Foreground - diff --git a/host.d/config.d/mayhem-party.d/env.env b/host.d/config.d/mayhem-party.d/env.env deleted file mode 100644 index 3f6810f..0000000 --- a/host.d/config.d/mayhem-party.d/env.env +++ /dev/null @@ -1,11 +0,0 @@ -export DEBUG=true -export MAIN_INTERVAL_DURATION=5ms - -export RAW_UDP=17070 - -export PARSE_V01=true -export V01_CONFIG=./config.d/mayhem-party.d/v01.yaml - -export WRAP_REFRESH_ON_SIGUSR1=true - -export OUTPUT_KEYBOARD=false diff --git a/host.d/config.d/mayhem-party.d/remap.d/.players_offset.py b/host.d/config.d/mayhem-party.d/remap.d/.players_offset.py deleted file mode 100644 index d6ecf80..0000000 --- a/host.d/config.d/mayhem-party.d/remap.d/.players_offset.py +++ /dev/null @@ -1,31 +0,0 @@ -import yaml -from sys import argv -from sys import stderr - -def log(*args): - print(*args, file=stderr) - -def main(args): - players = [] - for i in range(1, 5+1): - with open(f"../../rusty-pipe.d/{i}.yaml", "r") as f: - players.append(yaml.safe_load(f)["streams"]["input"]["engine"]["gui"]["buttons"]) - log(players[-1]) - for arg in args: - offset = int(arg) - for i in range(len(players)): - j = (i+offset)%len(players) - if i == j: - break - keys = players[i] - values = players[j] - log(f"player {i+1} plays as player {j+1}") - print(f"# player {i+1} controls {j+1}") - for k in keys: - key = keys[k] - value = values[k] - print(f"'{key}': '{value}'") - -if __name__ == "__main__": - from sys import argv - main(argv[1:]) diff --git a/host.d/config.d/mayhem-party.d/remap.d/live.yaml b/host.d/config.d/mayhem-party.d/remap.d/live.yaml deleted file mode 120000 index 94cf0e4..0000000 --- a/host.d/config.d/mayhem-party.d/remap.d/live.yaml +++ /dev/null @@ -1 +0,0 @@ -players_offset_2.yaml \ No newline at end of file diff --git a/host.d/config.d/mayhem-party.d/remap.d/players_offset_0.yaml b/host.d/config.d/mayhem-party.d/remap.d/players_offset_0.yaml deleted file mode 100644 index 0967ef4..0000000 --- a/host.d/config.d/mayhem-party.d/remap.d/players_offset_0.yaml +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/host.d/config.d/mayhem-party.d/remap.d/players_offset_1.yaml b/host.d/config.d/mayhem-party.d/remap.d/players_offset_1.yaml deleted file mode 100644 index e12aabf..0000000 --- a/host.d/config.d/mayhem-party.d/remap.d/players_offset_1.yaml +++ /dev/null @@ -1,55 +0,0 @@ -# player 1 controls 2 -'1': 'q' -'2': 'w' -'3': 'e' -'4': 'r' -'5': 't' -'6': 'y' -'7': 'u' -'8': 'i' -'9': 'o' -'0': 'p' -# player 2 controls 3 -'q': 'a' -'w': 's' -'e': 'd' -'r': 'f' -'t': 'g' -'y': 'h' -'u': 'j' -'i': 'k' -'o': 'l' -'p': ';' -# player 3 controls 4 -'a': 'z' -'s': 'x' -'d': 'c' -'f': 'v' -'g': 'b' -'h': 'n' -'j': 'm' -'k': ',' -'l': '-' -';': '/' -# player 4 controls 5 -'z': '!' -'x': '@' -'c': '#' -'v': '$' -'b': '%' -'n': '^' -'m': '&' -',': '*' -'-': '(' -'/': ')' -# player 5 controls 1 -'!': '1' -'@': '2' -'#': '3' -'$': '4' -'%': '5' -'^': '6' -'&': '7' -'*': '8' -'(': '9' -')': '0' diff --git a/host.d/config.d/mayhem-party.d/remap.d/players_offset_2.yaml b/host.d/config.d/mayhem-party.d/remap.d/players_offset_2.yaml deleted file mode 100644 index 1d3c173..0000000 --- a/host.d/config.d/mayhem-party.d/remap.d/players_offset_2.yaml +++ /dev/null @@ -1,55 +0,0 @@ -# player 1 controls 3 -'1': 'a' -'2': 's' -'3': 'd' -'4': 'f' -'5': 'g' -'6': 'h' -'7': 'j' -'8': 'k' -'9': 'l' -'0': ';' -# player 2 controls 4 -'q': 'z' -'w': 'x' -'e': 'c' -'r': 'v' -'t': 'b' -'y': 'n' -'u': 'm' -'i': ',' -'o': '-' -'p': '/' -# player 3 controls 5 -'a': '!' -'s': '@' -'d': '#' -'f': '$' -'g': '%' -'h': '^' -'j': '&' -'k': '*' -'l': '(' -';': ')' -# player 4 controls 1 -'z': '1' -'x': '2' -'c': '3' -'v': '4' -'b': '5' -'n': '6' -'m': '7' -',': '8' -'-': '9' -'/': '0' -# player 5 controls 2 -'!': 'q' -'@': 'w' -'#': 'e' -'$': 'r' -'%': 't' -'^': 'y' -'&': 'u' -'*': 'i' -'(': 'o' -')': 'p' diff --git a/host.d/config.d/mayhem-party.d/remap.d/players_offset_3.yaml b/host.d/config.d/mayhem-party.d/remap.d/players_offset_3.yaml deleted file mode 100644 index bb66f1f..0000000 --- a/host.d/config.d/mayhem-party.d/remap.d/players_offset_3.yaml +++ /dev/null @@ -1,55 +0,0 @@ -# player 1 controls 4 -'1': 'z' -'2': 'x' -'3': 'c' -'4': 'v' -'5': 'b' -'6': 'n' -'7': 'm' -'8': ',' -'9': '-' -'0': '/' -# player 2 controls 5 -'q': '!' -'w': '@' -'e': '#' -'r': '$' -'t': '%' -'y': '^' -'u': '&' -'i': '*' -'o': '(' -'p': ')' -# player 3 controls 1 -'a': '1' -'s': '2' -'d': '3' -'f': '4' -'g': '5' -'h': '6' -'j': '7' -'k': '8' -'l': '9' -';': '0' -# player 4 controls 2 -'z': 'q' -'x': 'w' -'c': 'e' -'v': 'r' -'b': 't' -'n': 'y' -'m': 'u' -',': 'i' -'-': 'o' -'/': 'p' -# player 5 controls 3 -'!': 'a' -'@': 's' -'#': 'd' -'$': 'f' -'%': 'g' -'^': 'h' -'&': 'j' -'*': 'k' -'(': 'l' -')': ';' diff --git a/host.d/config.d/mayhem-party.d/remap.d/players_offset_4.yaml b/host.d/config.d/mayhem-party.d/remap.d/players_offset_4.yaml deleted file mode 100644 index f694f4f..0000000 --- a/host.d/config.d/mayhem-party.d/remap.d/players_offset_4.yaml +++ /dev/null @@ -1,55 +0,0 @@ -# player 1 controls 5 -'1': '!' -'2': '@' -'3': '#' -'4': '$' -'5': '%' -'6': '^' -'7': '&' -'8': '*' -'9': '(' -'0': ')' -# player 2 controls 1 -'q': '1' -'w': '2' -'e': '3' -'r': '4' -'t': '5' -'y': '6' -'u': '7' -'i': '8' -'o': '9' -'p': '0' -# player 3 controls 2 -'a': 'q' -'s': 'w' -'d': 'e' -'f': 'r' -'g': 't' -'h': 'y' -'j': 'u' -'k': 'i' -'l': 'o' -';': 'p' -# player 4 controls 3 -'z': 'a' -'x': 's' -'c': 'd' -'v': 'f' -'b': 'g' -'n': 'h' -'m': 'j' -',': 'k' -'-': 'l' -'/': ';' -# player 5 controls 4 -'!': 'z' -'@': 'x' -'#': 'c' -'$': 'v' -'%': 'b' -'^': 'n' -'&': 'm' -'*': ',' -'(': '-' -')': '/' diff --git a/host.d/config.d/mayhem-party.d/remap.d/rotate.sh b/host.d/config.d/mayhem-party.d/remap.d/rotate.sh deleted file mode 100644 index 744fe5d..0000000 --- a/host.d/config.d/mayhem-party.d/remap.d/rotate.sh +++ /dev/null @@ -1,21 +0,0 @@ -#! /bin/bash - -mayhem_party_rotate() { - local currently=$(realpath live.yaml | grep -o '[0-9].yaml$' | grep -o '^[0-9]') - local next=${NEXT:-$((RANDOM%5))} - while [ -z "$NEXT" ] && [ "$next" == "$currently" ]; do - next=$((RANDOM%5)) - done - rm live.yaml - ln -s players_offset_$next.yaml live.yaml - pkill -SIGUSR1 -f mayhem-party -} - -trap mayhem_party_rotate SIGUSR1 - -if [ "$0" == "$BASH_SOURCE" ]; then - NEXT=0 mayhem_party_rotate - while read -p "$(date) > [press enter to rotate]"; do - mayhem_party_rotate - done -fi diff --git a/host.d/config.d/mayhem-party.d/v01.yaml b/host.d/config.d/mayhem-party.d/v01.yaml deleted file mode 100644 index da2363d..0000000 --- a/host.d/config.d/mayhem-party.d/v01.yaml +++ /dev/null @@ -1,23 +0,0 @@ -feedback: - addr: :17071 - ttsurl: http://localhost:15002 -users: - bel: - player: 2 - message: its bel - broadcast: - message: 8 -players: -- {} -- transformation: - w: t - a: f - s: g - d: h - q: r - e: y - 1: 5 - 2: 6 - 3: 7 - 4: 8 -quiet: false diff --git a/host.d/config.d/rusty-pipe.d/1.yaml b/host.d/config.d/rusty-pipe.d/1.yaml deleted file mode 100644 index a052e75..0000000 --- a/host.d/config.d/rusty-pipe.d/1.yaml +++ /dev/null @@ -1,30 +0,0 @@ -streams: - input: - debug: false - engine: - name: gui - gui: - user: bel - feedback: - url: http://mayhem-party.home.blapointe.com:17071?user=bel - press: {prefix: "", suffix: ""} - release: {prefix: "", suffix: ""} - format: '{"T":{{ms}},"U":"{{user}}","Y":"{{pressed}}","N":"{{released}}"}' - buttons: - up: 'w' - down: 's' - left: 'a' - right: 'd' - l: 'e' - r: 'q' - a: '1' - b: '2' - x: '3' - y: '4' - output: - debug: false - engine: - name: udp - udp: - host: mayhem-party.home.blapointe.com - port: 17070 diff --git a/host.d/config.d/rusty-pipe.d/2.yaml b/host.d/config.d/rusty-pipe.d/2.yaml deleted file mode 100644 index f966ee4..0000000 --- a/host.d/config.d/rusty-pipe.d/2.yaml +++ /dev/null @@ -1,30 +0,0 @@ -streams: - input: - debug: false - engine: - name: gui - gui: - user: zach - feedback: - url: http://mayhem-party.home.blapointe.com:17071?user=zach - press: {prefix: "", suffix: ""} - release: {prefix: "", suffix: ""} - format: '{"T":{{ms}},"U":"{{user}}","Y":"{{pressed}}","N":"{{released}}"}' - buttons: - up: 'w' - down: 's' - left: 'a' - right: 'd' - l: 'e' - r: 'q' - a: '1' - b: '2' - x: '3' - y: '4' - output: - debug: false - engine: - name: udp - udp: - host: mayhem-party.home.blapointe.com - port: 17070 diff --git a/host.d/config.d/rusty-pipe.d/3.yaml b/host.d/config.d/rusty-pipe.d/3.yaml deleted file mode 100644 index 979c71e..0000000 --- a/host.d/config.d/rusty-pipe.d/3.yaml +++ /dev/null @@ -1,30 +0,0 @@ -streams: - input: - debug: false - engine: - name: gui - gui: - user: chase - feedback: - url: http://mayhem-party.home.blapointe.com:17071?user=chase - press: {prefix: "", suffix: ""} - release: {prefix: "", suffix: ""} - format: '{"T":{{ms}},"U":"{{user}}","Y":"{{pressed}}","N":"{{released}}"}' - buttons: - up: 'w' - down: 's' - left: 'a' - right: 'd' - l: 'e' - r: 'q' - a: '1' - b: '2' - x: '3' - y: '4' - output: - debug: false - engine: - name: udp - udp: - host: mayhem-party.home.blapointe.com - port: 17070 diff --git a/host.d/config.d/rusty-pipe.d/4.yaml b/host.d/config.d/rusty-pipe.d/4.yaml deleted file mode 100644 index 2ab7a7c..0000000 --- a/host.d/config.d/rusty-pipe.d/4.yaml +++ /dev/null @@ -1,30 +0,0 @@ -streams: - input: - debug: false - engine: - name: gui - gui: - user: mason - feedback: - url: http://mayhem-party.home.blapointe.com:17071?user=mason - press: {prefix: "", suffix: ""} - release: {prefix: "", suffix: ""} - format: '{"T":{{ms}},"U":"{{user}}","Y":"{{pressed}}","N":"{{released}}"}' - buttons: - up: 'w' - down: 's' - left: 'a' - right: 'd' - l: 'e' - r: 'q' - a: '1' - b: '2' - x: '3' - y: '4' - output: - debug: false - engine: - name: udp - udp: - host: mayhem-party.home.blapointe.com - port: 17070 diff --git a/host.d/config.d/rusty-pipe.d/5.yaml b/host.d/config.d/rusty-pipe.d/5.yaml deleted file mode 100644 index ee1d810..0000000 --- a/host.d/config.d/rusty-pipe.d/5.yaml +++ /dev/null @@ -1,30 +0,0 @@ -streams: - input: - debug: false - engine: - name: gui - gui: - user: nat - feedback: - url: http://mayhem-party.home.blapointe.com:17071?user=nat - press: {prefix: "", suffix: ""} - release: {prefix: "", suffix: ""} - format: '{"T":{{ms}},"U":"{{user}}","Y":"{{pressed}}","N":"{{released}}"}' - buttons: - up: 'w' - down: 's' - left: 'a' - right: 'd' - l: 'e' - r: 'q' - a: '1' - b: '2' - x: '3' - y: '4' - output: - debug: false - engine: - name: udp - udp: - host: mayhem-party.home.blapointe.com - port: 17070 diff --git a/host.d/config.d/rusty-pipe.d/6.yaml b/host.d/config.d/rusty-pipe.d/6.yaml deleted file mode 100644 index 1fc15d8..0000000 --- a/host.d/config.d/rusty-pipe.d/6.yaml +++ /dev/null @@ -1,30 +0,0 @@ -streams: - input: - debug: false - engine: - name: gui - gui: - user: roxy - feedback: - url: http://mayhem-party.home.blapointe.com:17071?user=roxy - press: {prefix: "", suffix: ""} - release: {prefix: "", suffix: ""} - format: '{"T":{{ms}},"U":"{{user}}","Y":"{{pressed}}","N":"{{released}}"}' - buttons: - up: 'w' - down: 's' - left: 'a' - right: 'd' - l: 'e' - r: 'q' - a: '1' - b: '2' - x: '3' - y: '4' - output: - debug: false - engine: - name: udp - udp: - host: mayhem-party.home.blapointe.com - port: 17070 diff --git a/host.d/config.d/rusty-pipe.d/7.yaml b/host.d/config.d/rusty-pipe.d/7.yaml deleted file mode 100644 index 5a507ac..0000000 --- a/host.d/config.d/rusty-pipe.d/7.yaml +++ /dev/null @@ -1,30 +0,0 @@ -streams: - input: - debug: false - engine: - name: gui - gui: - user: bill - feedback: - url: http://mayhem-party.home.blapointe.com:17071?user=bill - press: {prefix: "", suffix: ""} - release: {prefix: "", suffix: ""} - format: '{"T":{{ms}},"U":"{{user}}","Y":"{{pressed}}","N":"{{released}}"}' - buttons: - up: 'w' - down: 's' - left: 'a' - right: 'd' - l: 'e' - r: 'q' - a: '1' - b: '2' - x: '3' - y: '4' - output: - debug: false - engine: - name: udp - udp: - host: mayhem-party.home.blapointe.com - port: 17070 diff --git a/host.d/config.d/rusty-pipe.d/rusty-pipe.exe b/host.d/config.d/rusty-pipe.d/rusty-pipe.exe deleted file mode 120000 index eafe89e..0000000 --- a/host.d/config.d/rusty-pipe.d/rusty-pipe.exe +++ /dev/null @@ -1 +0,0 @@ -../../../../rusty-pipe.d/target/x86_64-pc-windows-gnu/release/rusty-pipe.exe \ No newline at end of file diff --git a/host.d/config.d/stt.d/hotwords.txt b/host.d/config.d/stt.d/hotwords.txt deleted file mode 100644 index 94bbfcc..0000000 --- a/host.d/config.d/stt.d/hotwords.txt +++ /dev/null @@ -1,5 +0,0 @@ -mario -party -yo -win -die