Esempio n. 1
0
 /**
  * @param PlayzoneMessage $playzoneMessage
  * @param WebsocketUser $wsUser
  */
 public function prepareMessageForUser(PlayzoneMessage $playzoneMessage, WebsocketUser $wsUser)
 {
     switch ($playzoneMessage->getMethod()) {
         case PlayzoneClientMessageMethod::CALL_SEND:
             $this->prepareCallSend($playzoneMessage);
             break;
         case PlayzoneClientMessageMethod::CALL_DECLINE:
             $this->prepareCallDecline($playzoneMessage);
             break;
         case PlayzoneClientMessageMethod::CALL_ACCEPT:
             $this->prepareCallAccept($playzoneMessage, $wsUser);
             break;
         case PlayzoneClientMessageMethod::CALL_DELETE:
             $this->prepareCallDelete($playzoneMessage);
             break;
         case PlayzoneClientMessageMethod::SEND_PGN_TO_OBSERVERS:
             // do nothing. send game as we receive it
             break;
     }
 }
Esempio n. 2
0
 /**
  * @param PlayzoneMessage $messageObject
  * @param ConnectionInterface $from
  */
 private function sendToGameObservers(PlayzoneMessage $messageObject, ConnectionInterface $from)
 {
     switch ($messageObject->getMethod()) {
         case PlayzoneClientMessageMethod::SEND_PGN_TO_OBSERVERS:
             $this->sendGameToGameObservers($messageObject, $from);
             break;
     }
 }