@classmethod
    @postonly
    @multiplayer_service
    @jsonify
    def register(cls):
        remote_addr = get_remote_addr(request)

        try:
            params = request.params
            host = params.get('host', remote_addr)
            hmac = params['hmac']
            server = MultiplayerServer(params)
        except __HOLE__:
            response.status_int = 400
            return {'ok': False, 'msg': 'Missing server information.'}
        except ValueError:
            response.status_int = 400
            return {'ok': False, 'msg': 'Incorrect server information.'}

        calculated_hmac = _calculate_registration_hmac(cls.secret, remote_addr)
        if hmac != calculated_hmac:
            response.status_int = 400
            return {'ok': False, 'msg': 'Invalid server information.'}

        LOG.info('Multiplayer server registered from %s as %s:%d', remote_addr, host, server.port)

        cls.servers[host] = server

        return {'ok': True}
dataset/ETHPy150Open turbulenz/turbulenz_local/turbulenz_local/controllers/apiv1/multiplayer.py/MultiplayerController.register