示例#1
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];
            }
        }
示例#2
0
        public IStateData Clone()
        {
            SocialStateData c = new SocialStateData();

            c.playerId     = playerId;
            c.playerName   = playerName;
            c.facebookId   = facebookId;
            c.facebookName = facebookName;
            c.gameCenterId = gameCenterId;
            c.googlePlayId = googlePlayId;
            c.email        = email;
            c.profileImage = (AssetData)profileImage.Clone();
            c.properties   = properties == null ? new List <GenericPropertyData>() : new List <GenericPropertyData>(properties.Clone());

            return(c);
        }