Exemple #1
0
 public string GetChannelID(int channel)
 {
     if (string.IsNullOrEmpty(gameToken))
     {
         Log.Debug("[NMGPlayMode.SessionManager] Not SignIned return null");
         return(null);
     }
     return(NMGPlayerPrefs.GetChannelKey((NMGChannel)channel));
 }
        public void SignIn(SessionManager.ConnectToChannelDelegate callback, Session.ConnectToChannelDelegate handler)
        {
            string appleGameCenterKey = NMGPlayerPrefs.GetChannelKey(NMGChannel.GameCenter);

            if (!string.IsNullOrEmpty(appleGameCenterKey))
            {
                Result result = new Result(Result.NETMARBLES_DOMAIN, Result.SUCCESS, "Success");
                callback(result, NMGChannel.GameCenter, appleGameCenterKey, handler);
            }
            else
            {
                ChannelLoginController.Show(NMGChannel.GameCenter, appleGameCenterUserList, callback, handler);
            }
        }
Exemple #3
0
        private void CheckConnectedChannelAndAutoSignin(string playerId)
        {
            ChannelConnectionData savedData = testData.GetChannelConnectionData(playerId);

            if (string.IsNullOrEmpty(savedData.EmailKey))
            {
                NMGPlayerPrefs.SetChannelKey(NMGChannel.EveryNetmarble, null);
            }
            else
            {
                if (!string.IsNullOrEmpty(NMGPlayerPrefs.GetChannelKey(NMGChannel.EveryNetmarble)))
                {
                    string emailIdKey    = savedData.EmailKey;
                    string localSavedKey = NMGPlayerPrefs.GetChannelKey(NMGChannel.EveryNetmarble);

                    if (emailIdKey.Equals(localSavedKey))
                    {
                        AutoChannelSignin(NMGChannel.EveryNetmarble, emailIdKey);
                    }
                }
            }

            if (string.IsNullOrEmpty(savedData.FacebookKey))
            {
                NMGPlayerPrefs.SetChannelKey(NMGChannel.Facebook, null);
            }
            else
            {
                if (!string.IsNullOrEmpty(NMGPlayerPrefs.GetChannelKey(NMGChannel.Facebook)))
                {
                    string facebookKey   = savedData.FacebookKey;
                    string localSavedKey = NMGPlayerPrefs.GetChannelKey(NMGChannel.Facebook);

                    if (facebookKey.Equals(localSavedKey))
                    {
                        AutoChannelSignin(NMGChannel.Facebook, facebookKey);
                    }
                }
            }

            if (string.IsNullOrEmpty(savedData.GoogleKey))
            {
                NMGPlayerPrefs.SetChannelKey(NMGChannel.Google, null);
            }
            else
            {
                if (!string.IsNullOrEmpty(NMGPlayerPrefs.GetChannelKey(NMGChannel.Google)))
                {
                    string googleKey     = savedData.GoogleKey;
                    string localSavedKey = NMGPlayerPrefs.GetChannelKey(NMGChannel.Google);

                    if (googleKey.Equals(localSavedKey))
                    {
                        AutoChannelSignin(NMGChannel.Google, googleKey);
                    }
                }
            }


            if (string.IsNullOrEmpty(savedData.NaverKey))
            {
                NMGPlayerPrefs.SetChannelKey(NMGChannel.Naver, null);
            }
            else
            {
                if (!string.IsNullOrEmpty(NMGPlayerPrefs.GetChannelKey(NMGChannel.Naver)))
                {
                    string naverKey      = savedData.NaverKey;
                    string localSavedKey = NMGPlayerPrefs.GetChannelKey(NMGChannel.Naver);

                    if (naverKey.Equals(localSavedKey))
                    {
                        AutoChannelSignin(NMGChannel.Naver, naverKey);
                    }
                }
            }

            if (string.IsNullOrEmpty(savedData.TwitterKey))
            {
                NMGPlayerPrefs.SetChannelKey(NMGChannel.Twitter, null);
            }
            else
            {
                if (!string.IsNullOrEmpty(NMGPlayerPrefs.GetChannelKey(NMGChannel.Twitter)))
                {
                    string twitterKey    = savedData.TwitterKey;
                    string localSavedKey = NMGPlayerPrefs.GetChannelKey(NMGChannel.Twitter);

                    if (twitterKey.Equals(localSavedKey))
                    {
                        AutoChannelSignin(NMGChannel.Twitter, twitterKey);
                    }
                }
            }
        }