Quit revealing minecraft port forwards to the world
This commit is contained in:
parent
925ee29b5d
commit
44992d81a0
12
install
12
install
|
@ -4,6 +4,18 @@ DESTDIR=${1:-/home/neale/public_html}
|
||||||
|
|
||||||
cd $(dirname $0)
|
cd $(dirname $0)
|
||||||
|
|
||||||
|
older () {
|
||||||
|
tgt=$1
|
||||||
|
[ -f "$tgt" ] || exit 0
|
||||||
|
|
||||||
|
for src in "$@"; do
|
||||||
|
[ "$src" -nt "$tgt" ] && return 0
|
||||||
|
done
|
||||||
|
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
html () {
|
html () {
|
||||||
target=$DESTDIR/${1%mdwn}html
|
target=$DESTDIR/${1%mdwn}html
|
||||||
if older $target $1 tmpl/*; then
|
if older $target $1 tmpl/*; then
|
||||||
|
|
11
mp.cgi.go
11
mp.cgi.go
|
@ -8,10 +8,9 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var hosts = []HostEntry{
|
var hosts = []HostEntry{
|
||||||
{"h.woozle.org:30919", "Ginnie (tablet)"},
|
{"h.woozle.org:26548", "Ginnie (tablet)"},
|
||||||
{"h.woozle.org:44321", "Ginnie"},
|
{"g.dirtbags.net:44321", "Ginnie"},
|
||||||
{"h.woozle.org:58000", "Amy"},
|
{"n.dirtbags.net:29837", "Neale"},
|
||||||
{"h.woozle.org:29837", "Neale"},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const MAGIC = "\x00\xff\xff\x00\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\x12\x34\x56\x78"
|
const MAGIC = "\x00\xff\xff\x00\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\x12\x34\x56\x78"
|
||||||
|
@ -51,7 +50,7 @@ type HostEntry struct {
|
||||||
func ping(results chan<- string, e HostEntry) {
|
func ping(results chan<- string, e HostEntry) {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
if isAlive(e.host) {
|
if isAlive(e.host) {
|
||||||
results <- fmt.Sprintf("%s is playing at %s", e.owner, e.host)
|
results <- e.owner
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +72,7 @@ func main() {
|
||||||
fmt.Println("<style type=\"text/css\">#a{font-size: 120%; background: silver;}</style>")
|
fmt.Println("<style type=\"text/css\">#a{font-size: 120%; background: silver;}</style>")
|
||||||
fmt.Println("<title>Minecraft PE ping</title></head>")
|
fmt.Println("<title>Minecraft PE ping</title></head>")
|
||||||
fmt.Println("<body>")
|
fmt.Println("<body>")
|
||||||
fmt.Println("<h1>Are The Picketts playing Minecraft PE?</h1>")
|
fmt.Println("<h1>Who is playing Minecraft PE?</h1>")
|
||||||
fmt.Println("<ul id=\"a\">")
|
fmt.Println("<ul id=\"a\">")
|
||||||
count := 0
|
count := 0
|
||||||
for msg := range results {
|
for msg := range results {
|
||||||
|
|
Loading…
Reference in New Issue