Ejemplo n.º 1
0
        public bool CreateSession(string cbGameObject)
        {
            if (!ConfigurationManager.CheckConfiguration())
            {
                Log.Debug("[NMGPlayMode.SessionManager] CreateSession Fail ");
                return(false);
            }

            testData = TestData.Instance;

            if (status == SessionStatus.NONE)
            {
                status = SessionStatus.INITIALIZING;

                playerId = NMGPlayerPrefs.GetPlayerId();

                if (string.IsNullOrEmpty(playerId))
                {
                    playerId = Guid.NewGuid().ToString().Replace("-", "").ToUpper();
                    NMGPlayerPrefs.SetPlayerId(playerId);
                    Log.Debug("[NMGPlayMode.SessionManager] Save new PlayerID : " + playerId);
                }

                GMC2ServiceManager.Instance.Initialize(OnCreateSession);

                CheckTermsOfServiceKit();
                return(true);
            }
            else
            {
                Log.Debug("[NMGPlayMode.SessionManager] CreateSession Fail");
                return(false);
            }
        }
Ejemplo n.º 2
0
        public void ResetSession()
        {
            gameToken     = null;
            cipherDataDic = new Dictionary <CipherType, Cipher>();
            hmacDataDic   = new Dictionary <string, string>();

            NMGPlayerPrefs.SetChannelKey(NMGChannel.EveryNetmarble, null);
            NMGPlayerPrefs.SetChannelKey(NMGChannel.Facebook, null);
            NMGPlayerPrefs.SetChannelKey(NMGChannel.Kakao, null);
            NMGPlayerPrefs.SetChannelKey(NMGChannel.Google, null);
            NMGPlayerPrefs.SetChannelKey(NMGChannel.GameCenter, null);
            NMGPlayerPrefs.SetChannelKey(NMGChannel.Naver, null);
            NMGPlayerPrefs.SetChannelKey(NMGChannel.Twitter, null);
            NMGPlayerPrefs.SetRegion(null);

            if (Configuration.GetUseFixedPlayerID())
            {
                // TODO FixedPlayerID
            }
            else
            {
                playerId = Guid.NewGuid().ToString().Replace("-", "").ToUpper();
                NMGPlayerPrefs.SetPlayerId(playerId);
                Log.Debug("[NMGPlayMode.SessionManager] Save new PlayerID : " + playerId);

                deviceKey = Guid.NewGuid().ToString().Replace("-", "").ToUpper();
                NMGPlayerPrefs.SetDeviceKey(deviceKey);
                Log.Debug("[NMGPlayMode.SessionManager] Save new deviceKey : " + deviceKey);

                InitTalkKit();
            }
        }
Ejemplo n.º 3
0
        public void OnShowView(UIViewState state, UIView.UIViewDelegate handler)
        {
            if (state == UIViewState.OPENED)
            {
                isActionTermsOfServiceView = true;
                Debug.Log("[NMGPlayMode.UIViewManager] OPENED");
            }
            else if (state == UIViewState.FAILED)
            {
                isActionTermsOfServiceView = false;
                Debug.Log("[NMGPlayMode.UIViewManager] FAILED");
            }
            else if (state == UIViewState.CLOSED)
            {
                isActionTermsOfServiceView = false;
                Debug.Log("[NMGPlayMode.UIViewManager] CLOSED");
                NMGPlayerPrefs.SetTermsOfServiceViewShowed("True");
            }
            else if (state == UIViewState.REWARDED)
            {
                isActionTermsOfServiceView = false;
                Debug.Log("[NMGPlayMode.UIViewManager] REWARDED");
            }

            if (handler != null)
            {
                handler(state);
            }
        }
Ejemplo n.º 4
0
        public void ShowTermsOfServiceView(UIView.UIViewDelegate handler)
        {
            string isShowed = NMGPlayerPrefs.GetTermsOfServiceViewShowed();

            if (!string.IsNullOrEmpty(isShowed))
            {
                Log.Debug("[NMGPlayMode.UIViewManager] Terms of service view is show only once.");

                OnShowView(UIViewState.CLOSED, handler);
                return;
            }

            if (SessionManager.SessionStatus.INITIALIZING == SessionManager.Instance.status)
            {
                SessionManager.Instance.waitForTermsOfService = true;
                SessionManager.Instance.termsOfServiceHandler = handler;
                return;
            }

            if (true == isActionTermsOfServiceView)
            {
                Log.Debug("[NMGPlayMode.UIViewManager] Terms of service view is progress.");

                OnShowView(UIViewState.FAILED, handler);
                return;
            }

            TermsOfServiceController.Show(OnShowView, handler);
        }
Ejemplo n.º 5
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));
 }
Ejemplo n.º 6
0
        public void DisconnectFromChannel(int channelCode, Session.DisconnectFromChannelDelegate handler)
        {
            NMGPlayerPrefs.SetChannelKey((NMGChannel)channelCode, null);

            Result result = new Result(Result.NETMARBLES_DOMAIN, Result.SUCCESS, "Success");

            if (handler != null)
            {
                handler(result);
            }
        }
Ejemplo n.º 7
0
        private WWW SignIn(SignInDelegate callback, Session.SignInDelegate handler)
        {
            if (GMC2ServiceManager.Instance.GetConstantCount() == 0)
            {
                if (callback != null && callback is SignInDelegate)
                {
                    Result result = new Result(Result.NETMARBLES_DOMAIN, Result.SERVICE, "GMC2 is fail");
                    Log.Debug("[NMGPlayMode.SessionManager] SignIn Fail (" + result + ")");
                    callback(result, handler);
                }
                return(null);
            }

            deviceKey = NMGPlayerPrefs.GetDeviceKey();

            if (string.IsNullOrEmpty(deviceKey))
            {
                deviceKey = Guid.NewGuid().ToString().Replace("-", "").ToUpper();
                NMGPlayerPrefs.SetDeviceKey(deviceKey);
                Log.Debug("[NMGPlayMode.SessionManager] Save new deviceKey : " + deviceKey);
            }


            // UNDONE nmDeviceKey
            // string nmDeviceKey = null;
            // androidid, uuid

            WWWForm wwwForm = new WWWForm();

            wwwForm.AddField("gameCode", ConfigurationManager.Instance.GameCode);
            wwwForm.AddField("deviceKey", deviceKey);
            wwwForm.AddField("playerId", playerId);
            wwwForm.AddField("countryCode", countryCode);

            Dictionary <string, string> headerDic = new Dictionary <string, string>();

            headerDic["Content-Type"] = "application/x-www-form-urlencoded";
            headerDic["Accept"]       = "application/json";

            string authUrl = GMC2ServiceManager.Instance.GetConstantValue("authUrl");

            if (authUrl != null)
            {
                authUrl = authUrl.Replace("http://", "https://");
            }
            authUrl += NMGConstants.SIGN_IN;

            WWW www = new WWW(authUrl, wwwForm.data, headerDic);

            CallbackManager.NetmarbleGameObject.StartCoroutine(WaitForSignIn(www, callback, handler));
            return(www);
        }
Ejemplo n.º 8
0
        private void ProcessData(string jsonString, InitializeDelegate callback)
        {
            Debug.Log("GMC2Service : " + jsonString);
            JsonData jsonData = JsonMapper.ToObject(jsonString);

            int resCode = (int)jsonData["resCode"];

            if (resCode == 0)
            {
                string countryCode = (string)jsonData["geoLocation"];
                if (countryCode != null)
                {
                    NMGPlayerPrefs.SetCountryCode(countryCode);
                }

                string clientIp = (string)jsonData["clientIp"];
                if (clientIp != null)
                {
                    NMGPlayerPrefs.SetIPAddress(clientIp);
                }

                constantDic = new Dictionary <string, string>();
                for (int i = 0; i < jsonData["result"].Count; i++)
                {
                    string keyStr   = jsonData["result"][i]["key"].ToString();
                    string valueStr = jsonData["result"][i]["value"].ToString();

                    constantDic.Add(keyStr, valueStr);
                }

                if (callback != null && callback is InitializeDelegate)
                {
                    Result result = new Result(Result.NETMARBLES_DOMAIN, Result.SUCCESS, "Success");
                    Log.Debug("[NMGPlayMode.GMC2Service] Initialize OK (" + result + ")");

                    InitTalkKit();

                    callback(result);
                }
            }
            else
            {
                if (callback != null && callback is InitializeDelegate)
                {
                    Result result = new Result(Result.NETMARBLES_DOMAIN, Result.SERVICE, jsonString);
                    Log.Debug("[NMGPlayMode.GMC2Service] Initialize Fail (" + result + ")");
                    callback(result);
                }
            }
        }
        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);
            }
        }
Ejemplo n.º 10
0
 public static void DeleteAll()
 {
     NMGPlayerPrefs.SetPlayerId(null);
     NMGPlayerPrefs.SetDeviceKey(null);
     NMGPlayerPrefs.SetRegion(null);
     NMGPlayerPrefs.SetChannelKey(NMGChannel.EveryNetmarble, null);
     NMGPlayerPrefs.SetChannelKey(NMGChannel.Facebook, null);
     NMGPlayerPrefs.SetChannelKey(NMGChannel.Kakao, null);
     NMGPlayerPrefs.SetChannelKey(NMGChannel.Google, null);
     NMGPlayerPrefs.SetChannelKey(NMGChannel.GameCenter, null);
     NMGPlayerPrefs.SetChannelKey(NMGChannel.Naver, null);
     NMGPlayerPrefs.SetChannelKey(NMGChannel.Twitter, null);
     NMGPlayerPrefs.SetCountryCode(null);
     NMGPlayerPrefs.SetLanguage(null);
     NMGPlayerPrefs.SetJoinedCountryCode(null);
     NMGPlayerPrefs.SetIPAddress(null);
 }
Ejemplo n.º 11
0
 public static void DeleteData()
 {
     NMGPlayerPrefs.DeleteAll();
     Debug.Log("Delete OK");
 }
Ejemplo n.º 12
0
        public void SelectChannelConnectOption(ChannelConnectOption option, Session.SelectChannelConnectOptionDelegate handler)
        {
            ChannelConnectOptionType type = option.Type;
            NMGChannel channel            = (NMGChannel)option.ChannelCode;
            string     playerID           = option.PlayerID;
            string     channelID          = option.ChannelID;
            string     region             = option.Region;

            if (type == ChannelConnectOptionType.Cancel)
            {
                NMGPlayerPrefs.SetChannelKey(channel, null);

                Result result = new Result(Result.NETMARBLES_DOMAIN, Result.SUCCESS, "Success");
                Log.Debug("[NMGPlayMode.SessionManager] SelectChannelConnectOption OK (" + result + ")");

                if (handler != null)
                {
                    handler(result);
                }
            }
            else if (type == ChannelConnectOptionType.CreateChannelConnection)
            {
                playerId = Guid.NewGuid().ToString().Replace("-", "").ToUpper();
                NMGPlayerPrefs.SetPlayerId(playerId);
                Log.Debug("[NMGPlayMode.SessionManager] Save new PlayerID : " + playerId);

                deviceKey = Guid.NewGuid().ToString().Replace("-", "").ToUpper();
                NMGPlayerPrefs.SetDeviceKey(deviceKey);
                Log.Debug("[NMGPlayMode.SessionManager] Save new deviceKey : " + deviceKey);

                testData.SetChannelConnectionData(playerId, deviceKey);

                ChannelConnectionData savedData = testData.GetChannelConnectionData(playerId);
                savedData.SetChannelKeyByChannel(channel, channelID);

                NMGPlayerPrefs.SetChannelKey(NMGChannel.EveryNetmarble, null);
                NMGPlayerPrefs.SetChannelKey(NMGChannel.Facebook, null);
                NMGPlayerPrefs.SetChannelKey(NMGChannel.Kakao, null);
                NMGPlayerPrefs.SetChannelKey(NMGChannel.Google, null);
                NMGPlayerPrefs.SetChannelKey(NMGChannel.GameCenter, null);
                NMGPlayerPrefs.SetChannelKey(NMGChannel.Naver, null);
                NMGPlayerPrefs.SetChannelKey(NMGChannel.Twitter, null);
                NMGPlayerPrefs.SetChannelKey(channel, channelID);

                NMGPlayerPrefs.SetRegion(region);

                selectChannelConnectOptionHandler = handler;
                SignIn(OnChannelOptionSignIn, null);
                UpdateTalkKit();
            }
            else if (type == ChannelConnectOptionType.LoadChannelConnection)
            {
                ChannelConnectionData savedData = testData.GetChannelConnectionData(playerID);

                NMGPlayerPrefs.SetPlayerId(playerID);
                NMGPlayerPrefs.SetDeviceKey(savedData.DeviceKey);
                NMGPlayerPrefs.SetRegion(region);

                NMGPlayerPrefs.SetChannelKey(NMGChannel.EveryNetmarble, null);
                NMGPlayerPrefs.SetChannelKey(NMGChannel.Facebook, null);
                NMGPlayerPrefs.SetChannelKey(NMGChannel.Kakao, null);
                NMGPlayerPrefs.SetChannelKey(NMGChannel.Google, null);
                NMGPlayerPrefs.SetChannelKey(NMGChannel.GameCenter, null);
                NMGPlayerPrefs.SetChannelKey(NMGChannel.Naver, null);
                NMGPlayerPrefs.SetChannelKey(NMGChannel.Twitter, null);
                NMGPlayerPrefs.SetChannelKey(channel, channelID);

                playerId = playerID;

                selectChannelConnectOptionHandler = handler;
                SignIn(OnChannelOptionSignIn, null);
                UpdateTalkKit();
            }

            /* else if (type == ChannelConnectOptionType.UpdateChannelConnection)
             * {
             *   NMPlayModeChannelConnectionData savedData = testData.GetChannelConnectionData(playerID);
             *   NMPlayModeChannelConnectionData savedChannelData = testData.GetChannelConnectionData(channel, channelID);
             *
             *   if (savedChannelData != null)
             *   {
             *       savedChannelData.SetChannelKeyByChannel(channel, null);
             *   }
             *
             *   savedData.SetChannelKeyByChannel(channel, channelID);
             *   NMPlayModePlayerPrefs.SetChannelKey(channel, channelID);
             *
             *   Result result = new Result(Result.NETMARBLES_DOMAIN, Result.SUCCESS, "Success");
             *   Log.Debug("[NMGPlayMode.SessionManager] SelectChannelConnectOption OK (" + result + ")");
             *
             *   if (handler != null)
             *       handler(result);
             * }*/
        }
Ejemplo n.º 13
0
        void OnConnectToChannel(Result result, NMGChannel channel, string channelKey, Session.ConnectToChannelDelegate handler)
        {
            if (result.IsSuccess())
            {
                ChannelConnectionData savedData = testData.GetChannelConnectionData(playerId);
                string channelKeyAtPlayerID     = savedData.GetChannelKeyByChannel(channel);

                ChannelConnectionData savedChannelData = testData.GetChannelConnectionData(channel, channelKey);

                if (string.IsNullOrEmpty(channelKeyAtPlayerID))
                {
                    if (savedChannelData == null)
                    {
                        // ok 연결
                        savedData.SetChannelKeyByChannel(channel, channelKey);
                        NMGPlayerPrefs.SetChannelKey(channel, channelKey);

                        Result channelResult = new Result(Result.NETMARBLES_DOMAIN, Result.SUCCESS, "Success");
                        Log.Debug("[NMGPlayMode.SessionManager] ConnectToChannel OK (" + channelResult + ")");

                        if (handler != null)
                        {
                            handler(channelResult, null);
                        }
                    }
                    else
                    {
                        // 다른pid에 연결 되어있음
                        if (channel == NMGChannel.Kakao)
                        {
                            SelectOptionInConnectToChannel(new ChannelConnectOption(ChannelConnectOptionType.LoadChannelConnection, savedChannelData.PlayerId, (int)channel, channelKey, savedChannelData.GameRegion), handler);
                            return;
                        }

                        List <ChannelConnectOption> channelConnectOptionList = new List <ChannelConnectOption>();
                        if (channel != NMGChannel.GameCenter)
                        {
                            channelConnectOptionList.Add(new ChannelConnectOption(ChannelConnectOptionType.Cancel, savedData.PlayerId, (int)channel, null, savedData.GameRegion));
                        }
                        //channelConnectOptionList.Add(new ChannelConnectOption(ChannelConnectOptionType.UpdateChannelConnection, savedData.PlayerId, channel, channelKey, savedData.GameRegion));
                        channelConnectOptionList.Add(new ChannelConnectOption(ChannelConnectOptionType.LoadChannelConnection, savedChannelData.PlayerId, (int)channel, channelKey, savedChannelData.GameRegion));

                        Result channelResult = new Result(Result.NETMARBLES_DOMAIN, Result.CONNECT_CHANNEL_OPTION_USED_CHANNELID, "Please select channel connect option.");
                        Log.Debug("[NMGPlayMode.SessionManager] ConnectToChannel Fail(" + channelResult + ")");

                        if (handler != null)
                        {
                            handler(channelResult, channelConnectOptionList);
                        }
                    }
                }
                else
                {
                    if (savedChannelData == null)
                    {
                        if (channelKeyAtPlayerID.Equals(channelKey))
                        {
                            // 나올 수 없음
                        }
                        else
                        {
                            // 채널 변경하려고 함
                            if (channel == NMGChannel.Kakao)
                            {
                                SelectOptionInConnectToChannel(new ChannelConnectOption(ChannelConnectOptionType.CreateChannelConnection, null, (int)channel, channelKey, NMGPlayerPrefs.GetRegion()), handler);
                                return;
                            }

                            List <ChannelConnectOption> channelConnectOptionList = new List <ChannelConnectOption>();
                            if (channel != NMGChannel.GameCenter)
                            {
                                channelConnectOptionList.Add(new ChannelConnectOption(ChannelConnectOptionType.Cancel, savedData.PlayerId, (int)channel, channelKeyAtPlayerID, savedData.GameRegion));
                            }
                            channelConnectOptionList.Add(new ChannelConnectOption(ChannelConnectOptionType.CreateChannelConnection, null, (int)channel, channelKey, NMGPlayerPrefs.GetRegion()));

                            Result channelResult = new Result(Result.NETMARBLES_DOMAIN, Result.CONNECT_CHANNEL_OPTION_NEW_CHANNELID, "Please select channel connect option.");
                            Log.Debug("[NMGPlayMode.SessionManager] ConnectToChannel Fail(" + channelResult + ")");

                            if (handler != null)
                            {
                                handler(channelResult, channelConnectOptionList);
                            }
                        }
                    }
                    else
                    {
                        if (channelKeyAtPlayerID.Equals(channelKey))
                        {
                            // 같은 거 ok
                            NMGPlayerPrefs.SetChannelKey(channel, channelKey);

                            Result channelResult = new Result(Result.NETMARBLES_DOMAIN, Result.SUCCESS, "Success");
                            Log.Debug("[NMGPlayMode.SessionManager] ConnectToChannel OK (" + channelResult + ")");

                            if (handler != null)
                            {
                                handler(channelResult, null);
                            }
                        }
                        else
                        {
                            //bothChannelIDsMappedPlayerIDs 각각 연결되어있음
                            if (channel == NMGChannel.Kakao)
                            {
                                SelectOptionInConnectToChannel(new ChannelConnectOption(ChannelConnectOptionType.LoadChannelConnection, savedChannelData.PlayerId, (int)channel, channelKey, savedChannelData.GameRegion), handler);
                                return;
                            }

                            List <ChannelConnectOption> channelConnectOptionList = new List <ChannelConnectOption>();
                            if (channel != NMGChannel.GameCenter)
                            {
                                channelConnectOptionList.Add(new ChannelConnectOption(ChannelConnectOptionType.Cancel, savedData.PlayerId, (int)channel, channelKeyAtPlayerID, savedData.GameRegion));
                            }
                            channelConnectOptionList.Add(new ChannelConnectOption(ChannelConnectOptionType.LoadChannelConnection, savedChannelData.PlayerId, (int)channel, channelKey, savedChannelData.GameRegion));

                            Result channelResult = new Result(Result.NETMARBLES_DOMAIN, Result.CONNECT_CHANNEL_OPTION_USED_CHANNELID, "Please select channel connect option.");
                            Log.Debug("[NMGPlayMode.SessionManager] ConnectToChannel Fail(" + channelResult + ")");

                            if (handler != null)
                            {
                                handler(channelResult, channelConnectOptionList);
                            }
                        }
                    }
                }
            }
            else
            {
                if (handler != null)
                {
                    handler(result, null);
                }
            }
        }
Ejemplo n.º 14
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);
                    }
                }
            }
        }
Ejemplo n.º 15
0
        private void ProcessData(string jsonString, SignInDelegate callback, Session.SignInDelegate handler)
        {
            JsonData jsonData = JsonMapper.ToObject(jsonString);

            int    resultCode    = (int)jsonData["resultCode"];
            string resultMessage = jsonData["resultMessage"].ToString();

            if (resultCode == 200)
            {
                JsonData    playerData = jsonData["player"];
                IDictionary playerDic  = playerData as IDictionary;

                playerId = playerDic["playerId"].ToString();

                string region = null;
                if (playerDic.Contains("gameRegion"))
                {
                    region = playerDic["gameRegion"].ToString();
                }
                NMGPlayerPrefs.SetRegion(region);
                Log.Debug("[NMGPlayMode.SessionManager] Save new region : " + region);

                string joinedCountryCode = null;

                if (playerDic.Contains("joinedCountryCode"))
                {
                    joinedCountryCode = playerDic["joinedCountryCode"].ToString();
                }
                NMGPlayerPrefs.SetJoinedCountryCode(joinedCountryCode);
                Log.Debug("[NMGPlayMode.SessionManager] Save new JoinedCountryCode : " + joinedCountryCode);

                JsonData resultData = jsonData["resultData"];
                gameToken = resultData["gameToken"].ToString();

                JsonData keyInfoData = resultData["cipherKeyList"]["keyInfos"];

                for (int i = 0; i < keyInfoData.Count; i++)
                {
                    string cipherType = keyInfoData[i]["cipherType"].ToString();
                    string secretKey  = keyInfoData[i]["secretKey"].ToString();

                    Cipher cipher = null;
                    if (cipherType == "CIPHER_RC4_40")
                    {
                        cipher = new Cipher(CipherType.RC4_40, secretKey, null);
                    }
                    else if (cipherType == "CIPHER_AES_128_CBC")
                    {
                        string aesInitVec = keyInfoData[i]["aesInitVec"].ToString();
                        cipher = new Cipher(CipherType.AES_128_CBC, secretKey, aesInitVec);
                    }

                    if (cipher != null)
                    {
                        cipherDataDic[cipher.CipherType] = cipher;
                    }
                }

                JsonData hmacInfoData = resultData["hmacInfoList"]["hmacInfos"];

                for (int i = 0; i < hmacInfoData.Count; i++)
                {
                    string hmacType = hmacInfoData[i]["hmacType"].ToString();
                    string hmacKey  = hmacInfoData[i]["hmacKey"].ToString();
                    hmacDataDic[hmacType] = hmacKey;
                }

                if (callback != null && callback is SignInDelegate)
                {
                    testData.SetChannelConnectionData(playerId, deviceKey);
                    CheckConnectedChannelAndAutoSignin(playerId);

                    // Talk
                    SignedTalkKit();

                    Result result = new Result(Result.NETMARBLES_DOMAIN, Result.SUCCESS, "Success");
                    Log.Debug("[NMGPlayMode.SessionManager] SignIn OK (" + result + ")");

                    callback(result, handler);
                }
            }
            else
            {
                if (callback != null && callback is SignInDelegate)
                {
                    Result result = new Result(Result.NETMARBLES_DOMAIN, Result.SERVICE, "ErrorCode(" + resultCode + "), ErrorMessage(" + resultMessage + ")");
                    Log.Debug("[NMGPlayMode.SessionManager] SignIn Fail (" + result + ")");
                    callback(result, handler);
                }
            }
        }