gottdad/main.go

28 lines
625 B
Go
Raw Normal View History

2020-06-14 16:27:57 +02:00
package main
import (
2020-06-14 16:32:21 +02:00
"bufio"
2020-06-14 16:27:57 +02:00
"net"
)
func main() {
2020-06-14 16:32:21 +02:00
conn, err := net.Dial("tcp", "poop.siteop.biz:3977")
2020-06-14 16:27:57 +02:00
failError(err, "net.Dial")
logInfoDebug("Connected to poop.siteop.biz:3977")
2020-06-14 16:44:40 +02:00
//send auth
p := PacketAdminJoin{
2020-06-14 16:48:00 +02:00
Packet: Packet{PType: AdminPacketAdminJoin},
2020-06-14 16:59:55 +02:00
Password: []byte("plop"),
AppName: []byte("gottdad"),
AppVersion: []byte("alpha"),
2020-06-14 16:44:40 +02:00
}
_, err = conn.Write(p.Bytes())
failError(err, "conn.Write")
2020-06-14 16:52:22 +02:00
logInfoDebug("Authentication sent (%s)", string(p.Bytes()))
2020-06-14 16:44:40 +02:00
2020-06-14 16:32:21 +02:00
// listen for reply
message, _ := bufio.NewReader(conn).ReadString('\n')
2020-06-14 16:33:03 +02:00
logInfoDebug("Message from server: %s", message)
2020-06-14 16:27:57 +02:00
}