protected Message handleMessage(Message msg) throws IOException {
        if (msg instanceof JoinMessage) {
            player = ((JoinMessage) msg).getPlayer();
            server.addPlayer(this);
        } else if (msg instanceof UpdateMessage) {
            UpdateMessage update = (UpdateMessage) msg;
            Player playerUpdate = update.getPlayer();
            
            if (player.getShipId() != null && ! player.getShipId().equals(playerUpdate.getShipId())) {
                // Player died or respawned or something
                
                if (player.getPlayerId() != playerUpdate.getPlayerId())
                    throw new RuntimeException("Player tried something sneaky and changed their player id");

                // Easiest way to resolve update
                // TODO this doesn't notify the server process of the new player so we should probably do a member by member copy
                player = playerUpdate;
            }
            update.applyTo(actors);
        }
        return new UpdateMessage(server, player);
    }