Exemple #1
0
    // -------------------------------------------------------------------------------------------------------------------

    private bool HandleOneOfMyCommands()
    {
        // Check for an empty queue
        if (m_commandQueueMine.Count == 0)
        {
            new GeneralCommands.EmptyCommand(); // This will add an empty command to the queue
        }
        Command command = m_commandQueueMine.Dequeue();

        m_pendingCommands.AddCommand(command, PhotonNetwork.player.ID, m_lockStepTurnId, m_lockStepTurnId);
        m_confirmedCommands.AddCommand(PhotonNetwork.player, m_lockStepTurnId, m_lockStepTurnId); // confirm our own action

        //send action to all other players
        logger.Debug("Sent " + (command.GetType().Name) + " command for turn " + m_lockStepTurnId);
        m_nv.RPC("RecieveCommand", PhotonTargets.Others, m_lockStepTurnId, PhotonNetwork.player.ID, command.objectNameToCommand, command.Serialize());

        return(true);
    }