Exemplo n.º 1
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);
                }
            }
        }
Exemplo n.º 2
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);
 }