public function beforeSend(Server $server)
    {

        // Build the server code
        $this->server_code = implode('', array_map('chr', explode('.', $server->ip()))) .
                             pack("S", $server->portClient());

        // Loop over the packets and update them
        foreach ($this->packets as $packetType => $packet) {
            // Fill out the packet with the server info
            $this->packets[$packetType] = sprintf($packet, $this->server_code);
        }
    }
public function beforeSend(Server $server)
    {

        // Build the server code
        $this->server_code = implode('', array_map('chr', explode('.', $server->ip()))) .
                             pack("S", $server->portClient());

        // Loop over the packets and update them
        foreach ($this->packets as $packetType => $packet) {
            // Fill out the packet with the server info
            $this->packets[$packetType] = sprintf($packet, $this->server_code);
        }
    }
public function beforeSend ( Server $ server ) { // Build the server code $ this -> server_code = implode ( '' , array_map ( 'chr' , explode ( '.' , $ server -> ip ( ) ) ) ) . pack ( "S" , $ server -> portClient ( ) ) ; // Loop over the packets and update them foreach ( $ this -> packets as $ packetType => $ packet ) { // Fill out the packet with the server info $ this -> packets [ $ packetType ] = sprintf ( $ packet , $ this -> server_code ) ; } }
Handle some work before sending the packets out to the server

@param \GameQ\Server $server
Handle some work before sending the packets out to the server