|
|
|
@ -49,6 +49,7 @@ func handleConnection(conn *Connection) {
|
|
|
|
|
} else {
|
|
|
|
|
fmt.Fprintf(conn, "you are in the system %s. There are %d planets here.\n", system.name, system.planets)
|
|
|
|
|
}
|
|
|
|
|
READING:
|
|
|
|
|
for {
|
|
|
|
|
line, err := conn.ReadString('\n')
|
|
|
|
|
switch err {
|
|
|
|
@ -58,6 +59,8 @@ func handleConnection(conn *Connection) {
|
|
|
|
|
break
|
|
|
|
|
default:
|
|
|
|
|
log_error("failed to read line from player %s: %v", conn.PlayerName(), err)
|
|
|
|
|
time.Sleep(time.Second)
|
|
|
|
|
continue READING
|
|
|
|
|
}
|
|
|
|
|
line = strings.TrimSpace(line)
|
|
|
|
|
|
|
|
|
|