Lag -> Ping. Check ping every 1 second. Also: saner network code.