Reworked the client to connect to the server