protected synchronized Message handleMessage(Message msg) throws IOException, InterruptedException {
        if (msg instanceof HelloMessage) {
            hello = (HelloMessage)msg;
            status = CONNECTING;
            // This is kind of annoying, we have to create fields for every variable we want to present to the rest of the client
            actors = new ActorSet(hello.playerId);
            newActorsQueue = new java.util.concurrent.ConcurrentLinkedQueue<Actor>();
            actors.addNewActorConsumer(newActorsQueue);
            player.setPlayerId(actors.playerId);

            this.notifyAll(); 
            while (status == CONNECTING)
                wait(); // wait for player to decide if they want to join this map

            return new JoinMessage(player);
        } if (msg instanceof UpdateMessage) {
            UpdateMessage update = (UpdateMessage) msg;
            status = CONNECTED;
            update.applyTo(actors);
        }

        rateLimit();

        return new UpdateMessage(player, newActorsQueue);
    }