Exemplo n.º 1
0
        static int Main(string[] args)
        {
            bc = new BrainCloudWrapper("RelayExampleAppProd");
            bc.ResetStoredProfileId();

            // Comment this line, and uncomment the next one. Fill in you ids
            InitBCFromIdsTXT();
            //bc.Init("https://sharedprod.braincloudservers.com/dispatcherv2", "your app secret", "your app id", "1.0");

            bc.Client.EnableLogging(true);
            bc.AuthenticateAnonymous(onAuthenticated, onFailed);

            // Main event loop running at 60fps as a game would.
            var startTime = DateTime.Now;

            while (isRunning)
            {
                bc.Update();
                Thread.Sleep(16);
                if ((DateTime.Now - startTime).TotalSeconds >= 120.0) // Run for 2mins
                {
                    isRunning = false;
                }
            }

            return(returnCode);
        }
Exemplo n.º 2
0
        private void Spin()
        {
            var timeBefore = DateTime.Now;

            while (!m_done && (DateTime.Now - timeBefore).TotalSeconds < (double)m_timeToWaitSecs)
            {
                _bc.Update();
                Thread.Sleep(16);
            }
        }
Exemplo n.º 3
0
        private void Spin()
        {
            long maxWait = m_timeToWaitSecs * 1000;

            while (!m_done && maxWait > 0)
            {
                _bc.Update();
                Thread.Sleep(10);
                maxWait -= 10;
            }
        }
    public IEnumerator Spin(BrainCloudWrapper wrapper)
    {
        var timeBefore = DateTime.Now;

        while (!m_done && (DateTime.Now - timeBefore).TotalSeconds < m_timeToWaitSecs)
        {
            if (wrapper)
            {
                wrapper.Update();
            }
            yield return(new WaitForFixedUpdate());
        }
    }
Exemplo n.º 5
0
        // update brainCloud
        public void Update()
        {
            if (m_bcWrapper != null)
            {
                m_bcWrapper.Update();

                if (State.screenState == ScreenState.Game)
                {
                    // Update shockwaves
                    State.form.UpdateShockwaves();
                }
            }
            if (m_dead)
            {
                m_dead = false;

                // We differ destroying BC because we cannot destroy it within a callback
                UninitBC();
            }
        }
Exemplo n.º 6
0
 public bool RunCallbacks()
 {
     wrapper.Update();
     return(remote_loading_in_progress);
 }