예제 #1
0
파일: Game.php 프로젝트: h11Nox/slug
 /**
  * Set response
  * @param Response $response
  */
 public function send(Response $response)
 {
     $response->setFight($this);
     foreach ($this->getPlayers() as $p) {
         $p->send($response);
     }
 }
예제 #2
0
파일: Player.php 프로젝트: h11Nox/slug
 /**
  * Send
  * @param $response
  */
 public function send(Response $response)
 {
     if ($this->isConnected()) {
         $event = new UserSendEvent();
         $event->player = $this;
         $this->game->trigger('user-message', $event);
         $this->connection->send(json_encode($response->getResponseData()));
     }
 }