Esempio n. 1
0
    public void AddInput()
    {
        if (m_uigInputGenerator == null)
        {
            return;
        }

        //check if in active game state
        if (m_glsGameState == GameLoopState.ACTIVE)
        {
            if (m_uigInputGenerator.HasNewInputs)
            {
                m_uigInputGenerator.UpdateInputState();

                //send input to other connections
                m_ntcNetworkConnection.TransmitPacketToAll(new InputPacket(m_uigInputGenerator.m_bCurrentInput, m_simGameSim.m_iLatestTick));

                m_simGameSim.AddInput(m_ntcNetworkConnection.m_bPlayerID, new InputKeyFrame()
                {
                    m_iInput = m_uigInputGenerator.m_bCurrentInput, m_iTick = m_simGameSim.m_iLatestTick
                });
            }
        }
    }