main.js connection timeout reconnect

now restartState() reconnects the client and then restarts the current
game state if no error