Ejemplo n.º 1
0
        // --------------- Turns handlers -----------------

        private void OnServerReadyToPlay(NetworkMessage netMsg)
        {
            ClientReadyToPlayMessage msg = netMsg.ReadMessage <ClientReadyToPlayMessage>();

            Debug.Log("Server received OnServerReadyToPlay from user " + msg.userName + " in game " + msg.gameId);
            GameLogicServer game = games[msg.gameId];

            game.registerPlayerReady(game.getPlayerByUserId(msg.userId));
        }
Ejemplo n.º 2
0
        public void ClientReadyToPlay()
        {
            ClientReadyToPlayMessage msg = new ClientReadyToPlayMessage();

            msg.userId   = user.userId;
            msg.userName = user.userName;
            msg.gameId   = user.currentGameId;
            client.Send(ClientReadyToPlayMessage.ID, msg);
            Debug.Log("Sent ClientReadyToPlayMessage.");
        }