              if (msg.id == id) {
                    port.send(msg.msg);
                }
            }
        }

        function connectPlayerPorts(server, id, app) {
            for (let name in app.ports) {
                let appPort = app.ports[name];

                if (name.match(/^send_/)) {
                    let targetName = name.replace(/send_/, 'recv_');
                    let serverPort = server.ports[targetName];
                    appPort.subscribe(addId(id, serverPort));
            