diff options
author | epoch <epoch@thebackupbox.net> | 2022-08-17 21:34:02 -0500 |
---|---|---|
committer | epoch <epoch@thebackupbox.net> | 2022-08-17 21:34:02 -0500 |
commit | 6492ba6b4107a4da228e18db4fc5fc871bfb0579 (patch) | |
tree | 11301c4e20d9a1448337e73b62a16ab1bfeba457 /share/hackvr/examples/hackvrd | |
parent | 49d54d7582bdcbdcff5637e72e9f29bb5cc571bd (diff) | |
download | hackvr-master.tar.gz hackvr-master.zip |
updated README to show that everything that got deleted went to an -extras repo. also, hackvr script updated to be better bashHEADmaster
Diffstat (limited to 'share/hackvr/examples/hackvrd')
-rwxr-xr-x | share/hackvr/examples/hackvrd/hackvr-subsystem | 7 | ||||
-rwxr-xr-x | share/hackvr/examples/hackvrd/hackvrd.sh | 115 | ||||
-rwxr-xr-x | share/hackvr/examples/hackvrd/ident | 16 | ||||
-rwxr-xr-x | share/hackvr/examples/hackvrd/list_to_cubes.sh | 33 | ||||
-rwxr-xr-x | share/hackvr/examples/hackvrd/multi.sh | 10 | ||||
-rwxr-xr-x | share/hackvr/examples/hackvrd/radio.sh | 84 |
6 files changed, 0 insertions, 265 deletions
diff --git a/share/hackvr/examples/hackvrd/hackvr-subsystem b/share/hackvr/examples/hackvrd/hackvr-subsystem deleted file mode 100755 index 024a896..0000000 --- a/share/hackvr/examples/hackvrd/hackvr-subsystem +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -set -o pipefail - -if [ "$1" ];then - derp="$USER action $1" -fi -cat <(echo $derp) /dev/stdin | socat tcp-connect:127.0.0.1:1337,null-eof stdio diff --git a/share/hackvr/examples/hackvrd/hackvrd.sh b/share/hackvr/examples/hackvrd/hackvrd.sh deleted file mode 100755 index 0b16543..0000000 --- a/share/hackvr/examples/hackvrd/hackvrd.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/env bash - -set -o pipefail - -OUR_HOST=$(/usr/local/libexec/sockip | head -n1) -THEIR_HOST=$(/usr/local/libexec/peerip | head -n1) -OUR_PORT=$(/usr/local/libexec/sockip | tail -n1) -THEIR_PORT=$(/usr/local/libexec/peerip | tail -n1) - -log=/var/log/log.hackvr - -# some hackvr scripts use USER for commanding the player -if USER=$(ident $OUR_HOST $THEIR_HOST 113 $THEIR_PORT $OUR_PORT);then - export USER -else - printf "%s does not have an ident daemon running.\n" "$THEIR_HOST" >> $log - exit 1 -fi - -if [ ! "$USER" ];then - exit 1 -fi -printf "%s@%s connected to hackvr\n" "$USER" "$THEIR_HOST" >> $log - -last_pong=$(date +%s) -wat=true - -while true;do - while read -t 10 group action target args;do - printf "hackvr line: %s\n" "$group $action $target $args" >> $log - if [ "$group" = "$USER" -a "$action" = "pong" ];then - printf '%s@%s ponged on hackvr\n' $USER $THEIR_HOST >> $log - last_pong="$(date +%s)" - fi - if [ "$group" = "$USER" -a "$action" = "quit" ];then - break - fi - if [ "$action" = "action" ];then - if [ "$target" = "/links" ];then - printf "%s deleteallexcept %s\n" "$USER" "$USER" - off=-10 - for link in gopher://thebackupbox.net/;do - off=$[$off + 10] - printf '<%s> addshape 4 3 0 0 0 0 8 0 8 0 0\n' "$link" - printf '%s' "$link" | makelabel.sh "<$link>" 8 0 0 - printf '<%s> move 0 %d 0\n' "$link" "$off" - done - target=/ - fi - if [ $target = "/radio" ];then - printf "$USER deleteallexcept $USER\n" - cd /var/hackvr/ - ./radio.sh - target=/ - fi - if [ $target = "/ttt" ];then - printf "$USER deleteallexcept $USER\n" - cd /usr/local/src/hackvr/share/hackvr/examples/tictactoe - ./game.sh 2>/dev/null - target=/ - fi - if grep "^/dun" <<< "$target" 2>&1 >/dev/null;then - printf "$USER deleteallexcept $USER\n" - export seed="$(printf "%s\n" "$target" | cut -d/ -f3)" - cd /usr/local/src/hackvr/share/hackvr/examples/dungen - ./dunexplore.sh 2>/dev/null - target=/ - fi - if [ $target = "/multi" ];then - /var/hackvr/multi.sh - target=/ - fi - if [ $target = "/map" ];then - printf "$USER deleteallexcept $USER\n" - cd /usr/local/src/hackvr/share/hackvr/examples/anonet_map - ./map 2>/dev/null - printf '/ addshape 4 3 0 0 0 0 8 0 8 0 0\n' - while read group action target args;do - if [ "$action" = "action" ];then - if [ "$target" = "/" ];then - break - fi - fi - done - target=/ - fi - if [ $target = "/" ];then - printf "%s deleteallexcept %s\n" "$USER" "$USER" - cd /usr/local/src/hackvr/share/hackvr/examples/hackvrd - off=-10 - for name in ttt dun map multi links radio;do - off=$[$off + 10] - printf '/%s addshape 4 3 0 0 0 0 8 0 8 0 0\n' "$name" - printf '/%s' "$name" | makelabel.sh "/$name" 8 0 0 - printf '/%s move 0 %d 0\n' $name $off - done - fi - else - if $wat;then - wat=false - printf '/ addshape 4 3 0 0 0 0 8 0 8 0 0\n' - printf 'welcome' | makelabel.sh / 8 0 0 - fi - fi - done - #printf "pinging... %s@%s\n" "$USER" "$THEIR_HOST" >> /var/log/hackvr.all - #printf "%s ping %s\n" "$USER" "thebackupbox.net" - #if [ $[$(date +%s) - $last_pong] -gt 30 ];then #they probably pinged out. - # printf '# you pinged out. gotta respond to those, dude.\n' - # printf "%s@%s pinged out from hackvr\n" "$USER" "$THEIR_HOST" >> /var/log/hackvr.all - # exit 1 - #fi -done - -printf "%s@%s disconnected from hackvr\n" "$USER" "$THEIR_HOST" >> $log diff --git a/share/hackvr/examples/hackvrd/ident b/share/hackvr/examples/hackvrd/ident deleted file mode 100755 index f4e7599..0000000 --- a/share/hackvr/examples/hackvrd/ident +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -if [ $# -lt 4 ];then - echo usage: ident.sh our-host their-host 113 their-port our-port - exit 1 -fi -REMOTE_PORT="$4" -SERVER_PORT="$5" -IDENT_PORT="$3" -REMOTE_ADDR="$2" -SERVER_ADDR="$1" -username="$(printf "%s, %s\r\n" "$REMOTE_PORT" "$SERVER_PORT" | (ncat -s "$SERVER_ADDR" "$REMOTE_ADDR" "$IDENT_PORT" 2>/dev/null || echo 'ERROR:ERROR:ERROR:ERROR') | tr -d '\r' | cut -d: -f4)" -if [ "$username" ];then - printf "%s\n" "$username" -else - exit 1 -fi diff --git a/share/hackvr/examples/hackvrd/list_to_cubes.sh b/share/hackvr/examples/hackvrd/list_to_cubes.sh deleted file mode 100755 index 0dfca06..0000000 --- a/share/hackvr/examples/hackvrd/list_to_cubes.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash -# blank lines deleteallexcept epoch -# expected input format: -# -# line1 -# line2 -# line3 -# -# line1 -# line2 -j=1 -r=200 -while read -r line;do - if [ "_$line" != '_' ];then -# ../tools/obj2hackvr.pl "$line" ../meshes/cube.obj - #turn line into hex to prevent stupid shit - hexline="$(printf "%s" "$line" | xxd -p | tr -d '\n')" - printf "%s addshape 18 3 8 %d %d 0 %d %d 0 %d %d\n" "$hexline" "$j" "$r" "$[$j+8]" "$r" "$j" "$r" - cd .. - printf "%s\n" "$line" | tee /dev/stderr | makelabel.sh "$hexline" 15 $j $r - cd filebrowser - #printf "%s move 0 %d %d 0 0 0 0 0 0\n" "$hexline" "$i" "$r" - printf "%s rotate 0 %d 0\n" "$hexline" "$[i * 3]" - #somehow printf '%s\n' "$line" | ./testfont.sh and make its output belong to same group as $line.. sed? - i=$[i+10] - j=$[j+4] - else - cat camera.pos - printf "USER deleteallexcept USER\n" #deleteallexcept doesn't have gr deletions yet I think. - j=0 - i=0 - fi -done diff --git a/share/hackvr/examples/hackvrd/multi.sh b/share/hackvr/examples/hackvrd/multi.sh deleted file mode 100755 index 525f981..0000000 --- a/share/hackvr/examples/hackvrd/multi.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -printf 'user: %s joined multi\n' "$USER" >> /var/log/hackvr.all -cat /var/cache/hackvr/world_history <(echo 'root export *') \ - | egrep -v '^#|^[^ ][^ ]* *quit' \ - | grep -v 'move [a-z]' \ - | /usr/local/bin/hackvr_headless 2>/dev/null \ - | sed 's/^root_//g' -tail -f -n0 /var/cache/hackvr/world_history \ - | grep --line-buffered -v '^'"$USER"' ' & -tee -a /var/cache/hackvr/world_history >/dev/null diff --git a/share/hackvr/examples/hackvrd/radio.sh b/share/hackvr/examples/hackvrd/radio.sh deleted file mode 100755 index 7b290e9..0000000 --- a/share/hackvr/examples/hackvrd/radio.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env bash -log=/var/log/log.hackvr - -button="-2 2 1 2 2 1 2 -2 1 -2 -2 1" -bc=2 -printf "<http://thebackupbox.net:8901/> addshape 6 4 %s\n" "$button" -printf "<http://thebackupbox.net:8901/> move -5 5 0\n" -# |> -name=play -printf "%s addshape %s 4 %s\n" "$name" "$bc" "$button" -printf "play addshape 4 3 -1 1 0 1 0 0 -1 -1 0\n" -printf "play move 0 0 0\n" -# || -name=pause -printf "%s addshape %s 4 %s\n" "$name" "$bc" "$button" -printf "pause addshape 4 4 -1 1 0 -.5 1 0 -.5 -1 0 -1 -1 0\n" -printf "pause addshape 4 4 .5 1 0 1 1 0 1 -1 0 .5 -1 0\n" -printf "pause move 0 4 0\n" - -# [] -name=stop -printf "%s addshape %s 4 %s\n" "$name" "$bc" "$button" -printf "stop addshape 4 4 -1 1 0 1 1 0 1 -1 0 -1 -1 0\n" -printf "stop move 0 -4 0\n" - -# |>| -name=next -printf "%s addshape %s 4 %s\n" "$name" "$bc" "$button" -printf "next addshape 4 3 -1 1 0 .75 0 0 -1 -1 0\n" -printf "next addshape 4 4 .75 1 0 1 1 0 1 -1 0 .75 -1 0\n" -printf "next move 4 0 0\n" - -# |<| -name=prev -printf "%s addshape %s 4 %s\n" "$name" "$bc" "$button" -printf "prev addshape 4 3 -.75 0 0 1 1 0 1 -1 0\n" -printf "prev addshape 4 4 -1 1 0 -.75 1 0 -.75 -1 0 -1 -1 0\n" -printf "prev move -4 0 0\n" - -printf "exit addshape 4 4 %s\n" "$button" -printf "exit move 5 5 0\n" - -spin() { - for r in $(seq 15 15 360);do - printf "%s rotate 0 0 %s\n" "$1" "$r" - sleep .1 - done -} - -# a "listen" link to the http stream -# so anyone using hackvr_uri can open it from inside hackvr. :) - - while read group action target args;do - printf "hackvr line: %s\n" "$group $action $target" >> $log - if [ "$group" = "$USER" -a "$action" = "quit" ];then - break - fi - if [ "$action" = "action" ];then - if [ $target = "pause" ];then - spin $target & - mpc --host=21.41.41.4 --port=61666 pause 2>&1 >/dev/null 2>&1 - fi - if [ $target = "play" ];then - spin $target & - mpc --host=21.41.41.4 --port=61666 play 2>&1 >/dev/null 2>&1 - fi - if [ $target = "prev" ];then - spin $target & - mpc --host=21.41.41.4 --port=61666 prev 2>&1 >/dev/null 2>&1 - fi - if [ $target = "next" ];then - spin $target & - mpc --host=21.41.41.4 --port=61666 next 2>&1 >/dev/null 2>&1 - fi - if [ $target = "stop" ];then - spin $target & - mpc --host=21.41.41.4 --port=61666 stop 2>&1 >/dev/null 2>&1 - fi - if [ $target = "exit" ];then - spin $target - break; - fi - fi - done |