Exemplo n.º 1
0
        // --------------- Actions handlers -----------------
        void OnServerRegisterTurnActions(NetworkMessage netMsg)
        {
            ClientRegisterTurnActionsMessage msg = netMsg.ReadMessage <ClientRegisterTurnActionsMessage>();

            Debug.Log("Server received OnServerRegisterTurnAction " + msg.userName);
            GameLogicServer game = games[msg.gameId];

            game.registerPlayerAction(game.getPlayerByUserId(msg.userId), msg.actions);
        }
Exemplo n.º 2
0
        // --------------- Actions handlers -----------------

        public void SyncTurnActions(GameLogicClient game)
        {
            ClientRegisterTurnActionsMessage msg = new ClientRegisterTurnActionsMessage();

            msg.gameId   = game.gameId;
            msg.userId   = user.userId;
            msg.userName = user.userName;
            msg.actions  = game.generateTurnActionsJSON();
            client.Send(ClientRegisterTurnActionsMessage.ID, msg);
            Debug.Log("Client sent RegisterTurnActions");
        }