21 lines
337 B
Go
21 lines
337 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
)
|
|
|
|
//packet 0x0000 ping ({}byte data)
|
|
//packet 0x0001 handshake (string name)
|
|
|
|
func doPacketAction(data []byte, client *Client) {
|
|
response := make([]byte, 1024)
|
|
|
|
conn := *client.conn
|
|
write, err := conn.Write(response)
|
|
if err != nil || write != len(response) {
|
|
log.Fatal("Write failed")
|
|
return
|
|
}
|
|
|
|
}
|