示例#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()));
     }
 }