maybe don't flail when games end

pull/5/head
Jordan Orelli 10 years ago
parent c321544d9c
commit d68f342040

@ -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)

Loading…
Cancel
Save