gottdad/main.go

28 lines
562 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{
PType: AdminPacketAdminJoin,
Password: "plop",
AppName: "gottdad",
AppVersion: "alpha",
}
_, err = conn.Write(p.Bytes())
failError(err, "conn.Write")
logInfoDebug("Authentication sent")
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
}