Example #1
0
 /**
  * @return ProtoRequest
  */
 public function toProto()
 {
     $proto = new ProtoRequest();
     $proto->setRequestType($this->getType());
     $proto->setRequestMessage($this->getRequestMessage()->toStream()->getContents());
     return $proto;
 }
 /**
  * ServerRequest constructor.
  *
  * It require a request type and a message
  * The request type is a request like: GET_PLAYER
  * you can find all request in POGOProtos\Networking\Requests
  * The message is a container with all information required
  *
  * @param $type
  * @param null $message
  */
 function __construct($type, $message = null)
 {
     $requestOuterClass = new Request();
     $requestOuterClass->setRequestType($type);
     $requestOuterClass->setRequestMessage($message->toProtobuf());
     $this->request = $requestOuterClass;
     $this->requestType = $type;
 }