28 lines
593 B
Go
28 lines
593 B
Go
package main
|
|
|
|
import (
|
|
"bufio"
|
|
"net"
|
|
)
|
|
|
|
func main() {
|
|
conn, err := net.Dial("tcp", "poop.siteop.biz:3977")
|
|
failError(err, "net.Dial")
|
|
logInfoDebug("Connected to poop.siteop.biz:3977")
|
|
|
|
//send auth
|
|
p := PacketAdminJoin{
|
|
Packet: Packet{PType: AdminPacketAdminJoin},
|
|
Password: "plop",
|
|
AppName: "gottdad",
|
|
AppVersion: "alpha",
|
|
}
|
|
_, err = conn.Write(p.Bytes())
|
|
failError(err, "conn.Write")
|
|
logInfoDebug("Authentication sent (%v)", p.Bytes())
|
|
|
|
// listen for reply
|
|
message, _ := bufio.NewReader(conn).ReadString('\n')
|
|
logInfoDebug("Message from server: %s", message)
|
|
}
|