public function onServer($command, $callback, $priority = 0)
    {
        $handler = new EventListener(null, $callback);
        $this->dispatcher->addListener('server.' . $command, array($handler, 'testAndExecute'), $priority);

        return $this;
    }
public function onServer($command, $callback, $priority = 0)
    {
        $handler = new EventListener(null, $callback);
        $this->dispatcher->addListener('server.' . $command, array($handler, 'testAndExecute'), $priority);

        return $this;
    }
public function onServer ( $ command , $ callback , $ priority = 0 ) { $ handler = new EventListener ( null , $ callback ) ; $ this -> dispatcher -> addListener ( 'server.' . $ command , array ( $ handler , 'testAndExecute' ) , $ priority ) ; return $ this ; }
Adds event handler to the list of server messages.

@param string   $command  Server command to listen to
@param callable $callback The callback to run when event occurs
@param int      $priority The priority of this event handler

@return $this
Adds event handler to the list of server messages .