-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: hackvr
action: commit
revision:
path_from:
revision_from: 9f4b99177d8e563f5cfceaf34277d79a681c41f7:
path_to:
revision_to:

git.thebackupbox.net

hackvr

git://git.thebackupbox.net/hackvr

commit 9f4b99177d8e563f5cfceaf34277d79a681c41f7
Author: epochqwert <epoch@hacking.allowed.org>
Date:   Thu Feb 7 08:47:30 2019 +0000

    changed listen.sh to not use named pipes and game.sh to not use uniq since it was causing a single line delay... because that's how it work.

diff --git a/share/hackvr/examples/tictactoe/game.sh b/share/hackvr/examples/tictactoe/game.sh

index 8c741fceb2a98403b19a05df5a53a6929c61877d..

index ..68df4987df75509596739d404d172be88fd0fdeb 100755

--- a/share/hackvr/examples/tictactoe/game.sh
+++ b/share/hackvr/examples/tictactoe/game.sh
@@ -1,10 +1,10 @@
 #!/usr/bin/env bash
 turn=$( expr $RANDOM % 2)
-cat camera.pos
+cat camera.pos board
 echo "go. player: $turn" >&2
-stdbuf -oL uniq \
-  | grep --line-buffered action \
-  | stdbuf -oL cut '-d ' -f1,3 | while read user group;do
+grep --line-buffered action \
+  | while read user derp group;do
+    echo FUCK >&2
     if grep "_reset" <<<$group >/dev/null;then
      printf "%s deleteallexcept .\n" "$user"
      cat board
diff --git a/share/hackvr/examples/tictactoe/listen.sh b/share/hackvr/examples/tictactoe/listen.sh

index 0318cd2e27c4be98bbbc436d2afb3ddf006a96ed..

index ..deac68556c5ef0a324c5fd94fac9026225f60cd3 100755

--- a/share/hackvr/examples/tictactoe/listen.sh
+++ b/share/hackvr/examples/tictactoe/listen.sh
@@ -1,19 +1,11 @@
-#!/bin/sh
+#!/usr/bin/env bash

-#mabe not. might be buggier.
-#cat board p1out | ncat -lp 1050 > p1in &
-#cat board p2out | ncat -lp 1051 > p2in &
-echo listening in port 1050 for player 1 and 1051 for player 2
+#to finish out any that might still be listening
+nc -z 127.0.0.1 1050
+nc -z 127.0.0.1 1051

-mknod pin p
-mknod p1out p
-mknod p2out p
+echo hackvr://$(hostname).$(domainname):1050/ player 1
+echo hackvr://$(hostname).$(domainname):1051/ player 2

-cat board p1out | ncat -lp 1050 > pin &
-cat board p2out | ncat -lp 1051 > pin &
-
-cat pin | ./game.sh | tee p1out p2out
-
-rm pin
-rm p1out
-rm p2out
+coproc ./game.sh
+tee >(ncat -lp 1050 >&"${COPROC[1]}") >(ncat -lp 1051 >&"${COPROC[1]}") >/dev/null <&"${COPROC[0]}"

-----END OF PAGE-----

-- Response ended

-- Page fetched on Sun Jun 2 16:31:20 2024