示例#1
0
        void SubSystemDisconnect(bool isLogout)
        {
            EB.Debug.Log("SparxHub: SubSystemDisconnect");

            for (int i = _subsystems.Count - 1; i >= 0; --i)
            {
                SubSystem system = _subsystems[i];
                system.Disconnect(isLogout);
                system.State = SubSystemState.Disconnected;
            }

            ApiEndPoint.StopKeepAlive();
        }
示例#2
0
        void OnEnteredBackground()
        {
            _wasLoggedIn      = State == HubState.Connected;
            _wasServiceActive = (ApiEndPoint is HttpEndPoint) && (ApiEndPoint as HttpEndPoint).ServiceActive;
            EB.Debug.Log("OnEnteredBackground: _wasLoggedIn: {0}, _wasServiceActive: {1}", _wasLoggedIn, _wasServiceActive);

            if (_wasLoggedIn)
            {
                for (int i = _managers.Count - 1; i >= 0; --i)
                {
                    Manager manager = _managers[i];
                    manager.OnEnteredBackground();
                }

                ApiEndPoint.StopKeepAlive();
            }

            _enteredBackground = Time.Now;
        }