Exemplo n.º 1
0
        protected override IEnumerator ModuleInitializer()
        {
#if UNITY_EDITOR
            if (!activeInEditor)
            {
                yield break;
            }
#endif
            Debug.Log("Handshake Start ------------");
            _dialogService = _serviceResolver.Get <IGeneralDialogService>();

            _handshakeState = HandshakeLoopState.TryHandshake;

            _connectionHandler = new ConnectionHandler();
            _connectionHandler.Init(null, this);


            while (_handshakeState != HandshakeLoopState.CanContinue)
            {
                if (_handshakeState == HandshakeLoopState.TryHandshake)
                {
                    yield return(StartCoroutine(_connectionHandler.SendRequest(ConnectionHandler.RequestType.GetVersion, HandleHandshakeResponse)));
                }
                else
                {
                    yield return(new WaitForSeconds(1.0f));
                }
            }

            Debug.Log("Handshake end ------------");
            yield break;
        }
Exemplo n.º 2
0
        public void Init()
        {
            Debug.Log("SocialSync.Init");

            _coroutineFactory  = GameApplication.Instance.CoroutineFactory;
            _connectionHandler = new ConnectionHandler();
            _connectionHandler.Init(gameDB, _coroutineFactory);
            _loggerModule = CoreLogger.RegisterModule(GetType().Name);

            SocialStateData socialData = socialStateModel.GetState();

            _socialConnectionStatus = new Dictionary <SocialNetwork, bool>();
            _socialConnectionStatus.Add(SocialNetwork.Facebook, (socialData.facebookId != ""));
            _socialConnectionStatus.Add(SocialNetwork.GameCenter, (socialData.gameCenterId != ""));
            _socialConnectionStatus.Add(SocialNetwork.PlayServices, (socialData.googlePlayId != ""));
            _socialUserId = new Dictionary <SocialNetwork, string>();
            _socialUserId.Add(SocialNetwork.Facebook, socialData.facebookId);
            _socialUserId.Add(SocialNetwork.GameCenter, socialData.gameCenterId);
            _socialUserId.Add(SocialNetwork.PlayServices, socialData.googlePlayId);

            Data.DataElement connConfig = GameApplication.GetConfiguration("connection");
            if (!connConfig.IsNull)
            {
                _fakeFacebookId     = (!connConfig.ContainsKey(_configKeyFakeFacebookId)) ? "0" : (string)connConfig[_configKeyFakeFacebookId];
                _fakeGameCenterId   = (!connConfig.ContainsKey(_configKeyFakeGameCenterId)) ? "0" : (string)connConfig[_configKeyFakeGameCenterId];
                _fakePlayServicesId = (!connConfig.ContainsKey(_configKeyFakePlayServicesId)) ? "0" : (string)connConfig[_configKeyFakePlayServicesId];
            }
        }
Exemplo n.º 3
0
        public void RefreshRelationships()
        {
            ConnectionHandler connectionHandler = new ConnectionHandler();

            connectionHandler.Init(gameDB, _coroutineFactory);

            _coroutineFactory.StartCoroutine(() => _connectionHandler.SendRequest(ConnectionHandler.RequestType.RefreshRelationships, (result, response) => { }));
        }
Exemplo n.º 4
0
        public void Init()
        {
            _connectionHandler = new ConnectionHandler();
            _coroutineFactory  = GameApplication.Instance.CoroutineFactory;
            _connectionHandler.Init(_gameDB, _coroutineFactory);

            _typesToConvert = new System.Collections.Generic.HashSet <string> {
                "fan_bonus_config"
            };

            initialized = true;
        }
Exemplo n.º 5
0
 public void Init()
 {
     _connectionHandler = new ConnectionHandler();
     _coroutineFactory  = GameApplication.Instance.CoroutineFactory;
     _connectionHandler.Init(gameDB, _coroutineFactory);
 }