Example #1
0
//         public void setLanguageWeb (string xmlText, string language) {
//             var xml = new XmlDocument();
//             xml.Load(new StringReader(xmlText));
//
//             Strings = new Dictionary();
//             XmlNodeList XmlList = xml.GetElementsByTagName("languages")[0].ChildNodes;
//             for (int i = 0; i < XmlList.Count; i++)
//             {
//                 XmlElement xmlItem = (XmlElement)XmlList[i];
//                 string strkey = xmlItem.GetAttribute("name");
//                 Strings.Add(xmlItem.GetAttribute("name"), xmlItem.InnerText);
//
//             }
//         }


        public string getString(string name)
        {
            if (!Strings.ContainsKey(name))
            {
                GuLog.Warning("The string does not exist: " + name);

                return(string.Empty);
            }

            return((string)Strings[name]);
        }
Example #2
0
        public void endTimedEvent(string eventId)
        {
            if (!isInit)
            {
                GuLog.Warning("Flurry not init" + eventId);
                return;
            }

            nativeFlurryUtils.CallStatic("endTimedEvent", eventId);
            Debug.LogFormat("{0} ---->> FlurryUtils.endTimedEvent: {1}",
                            System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff"), eventId);
        }
Example #3
0
        public void logTimeEvent(string eventId, string paramValue)
        {
            if (!isInit)
            {
                GuLog.Warning("Flurry not init" + eventId);
                return;
            }

            nativeFlurryUtils.CallStatic("logTimeEvent", eventId, paramValue);
            Debug.LogFormat("{0} ---->> FlurryUtils.logTimeEvent: {1}, {2}",
                            System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff"), eventId, paramValue);
        }
Example #4
0
        public void setUserId(string userId)
        {
            if (!isInit)
            {
                GuLog.Warning("Flurry not init" + userId);
                return;
            }

            nativeFlurryUtils.CallStatic("setUserId", userId);
            Debug.LogFormat("{0} ---->> FlurryUtils.setUserId: {1}",
                            System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff"), userId);
        }
Example #5
0
        public void setGender(bool isMan)
        {
            if (!isInit)
            {
                GuLog.Warning("Flurry not init" + isMan);
                return;
            }

            nativeFlurryUtils.CallStatic("setGender", isMan);
            Debug.LogFormat("{0} ---->> FlurryUtils.setGender: {1}",
                            System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff"), isMan);
        }
Example #6
0
        public void setAge(int age)
        {
            if (!isInit)
            {
                GuLog.Warning("Flurry not init" + age);
                return;
            }

            nativeFlurryUtils.CallStatic("setAge", age);
            Debug.LogFormat("{0} ---->> FlurryUtils.setAge: {1}",
                            System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff"), age);
        }
        void AfterDownFromHttp(WWW www)
        {
            currCoroutine = null;
            if (www.isDone && string.IsNullOrEmpty(www.error))
            {
                byte[] bytes    = www.bytes;
                string fullName = cachePath.GetSpriteFullName(GetCurrentRequirment().infoUrl.filename);
                cachePath.DeleteCacheFile(fullName);
                cachePath.WriteCacheFile(fullName, bytes);

                Sprite loadedSprite = Sprite.Create(www.texture, new Rect(0, 0, www.texture.width, www.texture.height), Vector2.zero);
                //mapImageName2Sprite.Remove(GetCurrentRequirment().infoUrl.filename);
                //mapImageName2Sprite.Add(GetCurrentRequirment().infoUrl.filename, loadedSprite);

                if (GetCurrentRequirment().imageTarget != null)
                {
                    GetCurrentRequirment().imageTarget.sprite = loadedSprite;
                }

                GetMapImageName2crc().Remove(GetCurrentRequirment().infoUrl.filename);
                GetMapImageName2crc().Add(GetCurrentRequirment().infoUrl.filename, GetCurrentRequirment().infoUrl.crc);

                localDataRepository.saveObject <Dictionary <string, string> >(ImageName2crc(), GetMapImageName2crc());
                if (GetCurrentRequirment().downLoadResultCB != null)
                {
                    GetCurrentRequirment().downLoadResultCB(GetCurrentRequirment().infoUrl, true);
                }
                GuLog.Warning("<><SpriteDownloadManager>download OK, save at:" + fullName);
            }
            else
            {
                DefaultSprite();
                if (GetCurrentRequirment().downLoadResultCB != null)
                {
                    GetCurrentRequirment().downLoadResultCB(GetCurrentRequirment().infoUrl, false);
                }
                GuLog.Warning("<><SpriteDownloadManager>download fail" + www.url);
            }
            ProcessNext();
        }
        private void saveData(RegisterResponseData info)
        {
            if (!string.IsNullOrEmpty(info.x_child_sn))
            {
                //Debug.LogFormat("--------SaveSN--------RegisterCupService.saveData: {0}", info.x_child_sn);
                mLocalChildInfoAgent.saveChildSN(info.x_child_sn);
                FlurryUtil.LogEvent("Pair_Get_Childsn_Sunccess_Event");
            }
            else
            {
                FlurryUtil.LogEvent("Pair_Get_Childsn_Fail_Event");
                GuLog.Warning("pair data childsn is null");
            }

            //删除本地数据
            this.LocalPetInfoAgent.Clear();
            GuLog.Debug("<><RegisterCupService>Clear currentPet");
            this.LocalUnlockedPetsAgent.Clear();
            GuLog.Debug("<><RegisterCupService>Clear unlockedPets");

            //保存网络数据
            //mLocalCupAgent.saveCupToken(CupBuild.getCupSn(), info.token);
            mNativeDataManager.saveToken(info.token);
            mLocalCupAgent.saveCupID(CupBuild.getCupSn(), info.x_cup_sn);
            LocalPetInfoAgent.saveCurrentPet(info.pet_model);
            //重新保存语言数据
            this.PlayerDataManager.SaveLanguage(this.PlayerDataManager.Language);

            if (info.timestamp > 0)
            {
                mTimeManager.setServerTime(info.timestamp * (1000L));
            }

            if (!string.IsNullOrEmpty(info.timezone))
            {
                mTimeManager.setTimeZone(info.timezone);
            }
        }
Example #9
0
        void AfterDownFromHttp(WWW www)
        {
            currCoroutine = null;
            if (www.isDone && string.IsNullOrEmpty(www.error))
            {
                byte[] bytes    = www.bytes;
                string fullName = cachePath.GetAudioFullName(GetCurrentRequirment().infoUrl.filename);
                cachePath.DeleteCacheFile(fullName);
                cachePath.WriteCacheFile(fullName, bytes);

                if (GetCurrentRequirment().sourceTarget != null)
                {
                    GetCurrentRequirment().sourceTarget.clip = www.GetAudioClip(false, true);
                    GetCurrentRequirment().sourceTarget.Play();
                    this.OnStartPlay();
                }

                GetMapImageName2crc().Remove(GetCurrentRequirment().infoUrl.filename);
                GetMapImageName2crc().Add(GetCurrentRequirment().infoUrl.filename, GetCurrentRequirment().infoUrl.crc);

                localDataRepository.saveObject <Dictionary <string, string> >(ImageName2crc(), GetMapImageName2crc());
                if (GetCurrentRequirment().downLoadResultCB != null)
                {
                    GetCurrentRequirment().downLoadResultCB(GetCurrentRequirment().infoUrl, true);
                }
                GuLog.Debug("<><AudioDownloadManager>download OK, save at: " + fullName);
            }
            else
            {
                if (GetCurrentRequirment().downLoadResultCB != null)
                {
                    GetCurrentRequirment().downLoadResultCB(GetCurrentRequirment().infoUrl, false);
                }
                GuLog.Warning("<><AudioDownloadManager>download fail: " + www.url);
            }
            ProcessNext();
        }