Process Snoopy response

@param \Snoopy $snoopy
@return string
@throws \ActiveCollab\Exceptions\CallFailed
187742
private function processSnoopyResponse(\Snoopy &$snoopy) {
      if($snoopy->status != 200) {
        throw new CallFailed($snoopy->status, $snoopy->results);
      } else {
        return $snoopy->results;
      } // if
    }
1286635
public function processResponse()
    {

        // Grab the result from the parent
        /** @type array $result */
        $result = parent::processResponse();

        // Move some stuff around
        $this->renameResult($result, 'OwningPlayerName', 'hostname');
        $this->renameResult($result, 'p1073741825', 'mapname');
        $this->renameResult($result, 'p1073741826', 'gametype');
        $this->renameResult($result, 'p1073741827', 'servername');
        $this->renameResult($result, 'p1073741828', 'custom_mutators');
        $this->renameResult($result, 'gamemode', 'open');
        $this->renameResult($result, 's32779', 'gamemode');
        $this->renameResult($result, 's0', 'bot_skill');
        $this->renameResult($result, 's6', 'pure_server');
        $this->renameResult($result, 's7', 'password');
        $this->renameResult($result, 's8', 'vs_bots');
        $this->renameResult($result, 's10', 'force_respawn');
        $this->renameResult($result, 'p268435704', 'frag_limit');
        $this->renameResult($result, 'p268435705', 'time_limit');
        $this->renameResult($result, 'p268435703', 'numbots');
        $this->renameResult($result, 'p268435717', 'stock_mutators');

        // Put custom mutators into an array
        if (isset($result['custom_mutators'])) {
            $result['custom_mutators'] = explode("\x1c", $result['custom_mutators']);
        }

        // Delete some unknown stuff
        $this->deleteResult($result, ['s1', 's9', 's11', 's12', 's13', 's14']);

        // Return the result
        return $result;
    }
1158367
public function processResponse()
    {
        // Will hold the results when complete
        $results = [];

        // Holds sorted response packets
        $packets = [];

        // We need to pre-sort these for split packets so we can do extra work where needed
        foreach ($this->packets_response as $response) {
            $buffer = new Buffer($response);

            // Get the header of packet (long)
            $header = $buffer->readInt32Signed();

            // Single packet
            if ($header == -1) {
                // We need to peek and see what kind of engine this is for later processing
                if ($buffer->lookAhead(1) == "\x6d") {
                    $this->source_engine = self::GOLDSOURCE_ENGINE;
                }

                $packets[] = $buffer->getBuffer();
                continue;
            } else {
                // Split packet

                // Packet Id (long)
                $packet_id = $buffer->readInt32Signed() + 10;

                // Add the buffer to the packet as another array
                $packets[$packet_id][] = $buffer->getBuffer();
            }
        }

        // Free up memory
        unset($response, $packet_id, $buffer, $header);

        // Now that we have the packets sorted we need to iterate and process them
        foreach ($packets as $packet_id => $packet) {
            // We first need to off load split packets to combine them
            if (is_array($packet)) {
                $buffer = new Buffer($this->processPackets($packet_id, $packet));
            } else {
                $buffer = new Buffer($packet);
            }

            // Figure out what packet response this is for
            $response_type = $buffer->read(1);

            // Figure out which packet response this is
            if (!array_key_exists($response_type, $this->responses)) {
                throw new Exception(__METHOD__ . " response type '{$response_type}' is not valid");
            }

            // Now we need to call the proper method
            $results = array_merge(
                $results,
                call_user_func_array([$this, $this->responses[$response_type]], [$buffer])
            );

            unset($buffer);
        }

        // Free up memory
        unset($packets, $packet, $packet_id, $response_type);

        return $results;
    }
372605
protected function failedAction(Context $context)
    {
        $input = function () use ($context) {
            return [$context];
        };

        return $this->newInstance(
            $input,
            [$this->matcher, 'getName'],
            $this->failResponder
        );
    }
4606
public function process(ServerRequestInterface $request): ResponseInterface
    {
        /** @var Middleware $middleware */
        $middleware = current($this->middlewares);
        next($this->middlewares);

        // return $middleware->process($request, $this);
        try {
            $response = $middleware->process($request, $this);
        } catch (Throwable $error) {
            // next lines
        }
        if (!isset($response)) {
            $response = App::response();
        }

        if (isset($error) && $response instanceof Response) {
            $response->setError($error);
        }
        return $response;
    }
728198
public function handle($uri = null)
    {
        try {
            $returnedResponse = parent::handle($uri);
            return $this->handleWeb($returnedResponse);
        } catch (Throwable $e) {
            /** @noinspection PhpUnhandledExceptionInspection */
            return $this->handleException($e);
        }
    }
1045260
protected function processResponse($str)
    {

        if (!empty($this->encryption_key)) {
            $str = $this->encryptor->decrypt($str);
        }

        $this->logResponse($str);

        //check if response body is serialized json_response object and just unserialize and return if it is
        if ($this->php_serialize_response && !empty($str)) {

            try {
                $serialized = \unserialize($str);
                if ($serialized !== false) {
                    $response = $serialized;
                }
            } catch (\Exception $e) {

                if ($this->debug) {
                    echo $body;
                }
            }
        }

        //Not sure about this?
        $str = \utf8_encode($str);

        if (!isset($response)) {
            $response = new \sb\JSON\RPC2\Response($str);
        }

        return $response;
    }
436722
public function process($response)
    {
        if ($this->checkFlags(self::CONNECTED)) {
            return call_user_func($this->processCallback, $this, $response);
        }

        if ($this->checkFlags(self::STREAM_CONTEXT)) {
            return call_user_func($this->streamCallback, $this, $response);
        }

        // TODO: we should handle invalid states in a different manner.
        throw new RuntimeException("Invalid connection state: $this");
    }
816645
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        if ($this->checkRequest($request)) {
            try {
                $rawBody = \base64_decode($request->getBody()->getContents());
                if ($rawBody === '') {
                    $request = $request->withParsedBody([])
                        ->withAttribute('ncryptf-decrypted-body', '')
                        ->withAttribute('ncryptf-version', 2)
                        ->withAttribute('ncryptf-request-public-key', \base64_decode($request->getHeaderLine('x-pubkey')));
                } else {
                    $version = Response::getVersion($rawBody);
                    $key = $this->getEncryptionKey($request);

                    $body = $this->decryptRequest($key, $request, $rawBody, $version);

                    $request = $request->withParsedBody(\json_decode($body, true))
                        ->withAttribute('ncryptf-decrypted-body', $body)
                        ->withAttribute('ncryptf-version', $version)
                        ->withAttribute('ncryptf-request-public-key', $version === 2 ? Response::getPublicKeyFromResponse($rawBody) : \base64_decode($request->getHeaderLine('x-pubkey')));
                }
            } catch (DecryptionFailedException | InvalidArgumentException | InvalidSignatureException | InvalidChecksumException | Exception $e) {
                return $this->createResponse(400);
            }
        }

        // Only attempt to process this request if it is a vnd.25519+json or vnd.ncryptf+json request
        // Otherwise, continue with normal processing
        return $handler->handle($request);
    }
706818
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $response = new \GuzzleHttp\Psr7\Response();
        $controller = $this->getController(
            new \phpGone\Router\Routeur(),
            $request
        );
        if (is_null($controller)) {
            return $handler->handle($request);
        }
        ob_start();
        $controller->execute();
        $responseController = ob_get_clean();
        $response->getBody()->write($responseController);
        return $response;
    }
831766
public function process(File $sniffedFile, $index)
    {
        if (!$this->hasMethodDocBlock($sniffedFile, $index))
        {
            return;
        }

        $numberOfLineFeeds = $this->numberOfLineFeedsBetweenDocBlockAndDeclaration($sniffedFile, $index);
        if ($numberOfLineFeeds > 1)
        {
            $this->addWarning($sniffedFile, $index, 'No empty lines between a method declaration and its docblock.');
        }
        elseif ($numberOfLineFeeds === 0)
        {
            $this->addWarning($sniffedFile, $index, 'The method and its docblock can\'t be in the same line.');
        }
    }
1268583
static private function _process(\Lollipop\HTTP\Request $req, \Lollipop\HTTP\Response $res) {
        if (is_null(self::$_kernel)) {
            $active = self::$_active_route;
            $top = function(\Lollipop\HTTP\Request $req, \Lollipop\HTTP\Response $res) use ($active) {
                return Route::resolve($active['callback'], $req, $res, $active['arguments']);
            };
            self::$_kernel = $top;
        }
        
        // Create a new address for the top callable
        $start = self::$_kernel;
        
        // Start dequeue
        self::$_busy = true;
        $new_response = $start($req, $res);
        self::$_busy = false;
        
        // Just want to make sure that processed response from middlewares
        // are instance of \Calf\HTTP\Response
        if ($new_response instanceof \Lollipop\HTTP\Response) {
            $res = $new_response;
        } else {
            $res->set($new_response);
        }

        return $res;
    }
36786
public function processResponse($resp = '')
    {
        preg_match_all("/<EPAYMENT>(.*?)<\/EPAYMENT>/", $resp, $matches);
        $data = explode("|", $matches[1][0]);
        if (is_array($data)) {
            if (count($data) > 0) {
                $counter = 1;
                foreach ($data as $dataValue) {
                    $this->debugMessage[] = 'EPAYMENT_ELEMENT_' . $counter .': ' . $dataValue;
                    $counter++;
                }
            }
        }
        return $this->nameData($data);
    }
229667
public function processResponse()
    {
        $rawResponse = $this->rawResponse;

        if (empty($rawResponse)) {
            return;
        }

        $responseData = unpack("Ccommand/Cstatus/Nidentifier", $rawResponse);

        $this->validateResponse($responseData);

        $statusCode = $responseData['status'];
        $errorDescription = self::$responseDescription[$statusCode];

        if (
               $statusCode == self::ERROR_INVALID_TOKEN_SIZE
            || $statusCode == self::ERROR_INVALID_TOKEN
        ) {
            $recipients = $this->recipients;
            $recipients->current()->setIdentifierStatus(RecipientDevice::DEVICE_NOT_REGISTERED);

            throw new InvalidRecipientException($errorDescription, $recipients);
        }

        throw new DispatchMessageException($errorDescription, $statusCode);
    }
397047
public function processResponse($curlResponse, $curlInfo, $curlError)
    {
        // print "\n" . $curlResponse;
        switch ($curlInfo['http_code']) {
            case '200':
                $responseObject = $this->_XML2Array($curlResponse);
                $ver = "Ver1.0";
                return $responseObject->$ver;
                break;
            case '500':
                $faultString = $this->_XMLFault2String($curlResponse);
                throw new HpsException($faultString);
                break;
            default:
                throw new HpsException('Unexpected response');
                break;
        }
    }
1268487
public function process(
        ServerRequestInterface $p_request,
        RequestHandlerInterface $p_handler
    ): ResponseInterface {
        return call_user_func_array([$this->object, $this->function], [$p_request]);
    }
82390
protected function process($context, $data)
	{
		// Make sure the given context is all uppercase.
		$context = strtoupper($context);

		// Ensure the given context is configured before processing.
		if(is_null($this->getConfiguration($context)))
		{
			return new Payload(null, strtolower($context . '_not_configured'));
		}

		//  Finally, process the data.
		return $this->processor->process($data, $this->getConfiguration($context)['keys'], $this->getConfiguration($context)['rules'], $this->getConfiguration($context)['defaults']);
	}