예제 #1
0
        public void saveLocalData(List <mailData> list, int type)
        {
            int num = list.Count - 100;

            if (num > 0)
            {
                for (int i = 0; i < num; i++)
                {
                    list.Remove(list[0]);
                }
            }
            string str = "";

            foreach (mailData data in list)
            {
                str = str + data.str;
            }
            switch (type)
            {
            case 3: FileMgr.saveString(FileMgr.TYPE_MAIL, "fam", str); break;

            case 4: FileMgr.saveString(FileMgr.TYPE_MAIL, "per", str); break;

            default:
                break;
            }
        }
예제 #2
0
        public void saveLocalData(List <mailData> list, int type)
        {
            int  num  = list.Count - 100;
            bool flag = num > 0;

            if (flag)
            {
                for (int i = 0; i < num; i++)
                {
                    list.Remove(list[0]);
                }
            }
            string text = "";

            foreach (mailData current in list)
            {
                text += current.str;
            }
            if (type != 3)
            {
                if (type == 4)
                {
                    FileMgr.saveString(FileMgr.TYPE_MAIL, "per", text);
                }
            }
            else
            {
                FileMgr.saveString(FileMgr.TYPE_MAIL, "fam", text);
            }
        }
예제 #3
0
		public void save()
		{
			bool doneId = NewbieModel.getDoneId(this.id);
			if (!doneId)
			{
				string text = FileMgr.loadString(FileMgr.TYPE_NEWBIE, "n");
				bool flag = text == "";
				if (flag)
				{
					text = this.id.ToString();
				}
				else
				{
					text = text + "," + this.id;
				}
				FileMgr.saveString(FileMgr.TYPE_NEWBIE, "n", text);
			}
		}
예제 #4
0
        public void save()
        {
            if (NewbieModel.getDoneId(id))
            {
                return;
            }
            string str = FileMgr.loadString(FileMgr.TYPE_NEWBIE, "n");

            if (str == "")
            {
                str = id.ToString();
            }
            else
            {
                str += "," + id;
            }
            FileMgr.saveString(FileMgr.TYPE_NEWBIE, "n", str);
        }
예제 #5
0
        public void init()
        {
            if (isInited)
            {
                return;
            }
            isInited = true;
            if (HttpAppMgr.instance != null)
            {
                HttpAppMgr.instance.addEventListener(HttpAppMgr.EVENT_GET_GIFT_CARD, getGiftCard);
                E_mailProxy.getInstance();
            }
            timeSmp = muNetCleint.instance.CurServerTimeStamp;
            //timeSmp=ConvertDateTimeInt(nowTime);
            debug.Log(timeSmp.ToString());
            perLocalStr.Clear();
            famLocalStr.Clear();

            //bool b = PlayeLocalInfo.checkKey("aa");
            //if (b)
            //{
            //    string st = PlayeLocalInfo.loadString("aa");

            //}
            //else
            //{
            //    PlayeLocalInfo.saveString("aa", "aaaaaaaaaaaaaaa");
            //}

            string perStr = "";

            perStr = FileMgr.loadString(FileMgr.TYPE_MAIL, "per");
            string famStr = "";

            famStr = FileMgr.loadString(FileMgr.TYPE_MAIL, "fam");

            if (perStr != "" && perStr != " ")
            {
                string[] msgPer = perStr.Split(sep2, StringSplitOptions.None);

                try
                {
                    foreach (string str in msgPer)
                    {
                        string[] arr = str.Split(sep1, StringSplitOptions.None);
                        debug.Log(arr[0] + 22);
                        //frmcid+frmsex+cid+time+frmname+msg
                        if (arr[0] != "" && arr[0] != " ")
                        {
                            if (int.Parse(arr[6]) + _15days > timeSmp)
                            {
                                mailData data = new mailData();
                                data.frmcid  = int.Parse(arr[0]);
                                data.frmsex  = int.Parse(arr[1]);
                                data.cid     = int.Parse(arr[2]);
                                data.time    = arr[3];
                                data.frmname = arr[4];
                                data.msg     = arr[5];
                                data.str     = str + "#)#&";
                                if (E_mailModel.getInstance().personalMailDic.ContainsKey(data.frmcid))
                                {
                                    E_mailModel.getInstance().personalMailDic[data.frmcid].Add(data);
                                }
                                else
                                {
                                    List <mailData> list = new List <mailData>();
                                    list.Add(data);
                                    E_mailModel.getInstance().personalMailDic.Add(data.frmcid, list);
                                }
                                perLocalStr.Add(data);
                            }
                        }
                    }
                    saveLocalData(perLocalStr, 4);
                }
                catch (System.Exception ex)
                {
                    FileMgr.saveString(FileMgr.TYPE_MAIL, "per", " ");
                    FileMgr.saveString(FileMgr.TYPE_MAIL, "fam", " ");
                }
            }
            if (famStr != "" && famStr != " ")
            {
                string[] msgFam = famStr.Split(sep2, StringSplitOptions.None);
                foreach (string str in msgFam)
                {
                    string[] arr = str.Split(sep1, StringSplitOptions.None);
                    if (arr[0] != "" && arr[0] != " ")
                    {
                        if (int.Parse(arr[6]) + _15days > timeSmp)
                        {
                            mailData data = new mailData();
                            //frmcid+frmsex+cid+time+frmname+msg
                            data.frmcid  = int.Parse(arr[0]);
                            data.frmsex  = int.Parse(arr[1]);
                            data.cid     = int.Parse(arr[2]);
                            data.time    = arr[3];
                            data.frmname = arr[4];
                            data.msg     = arr[5];
                            data.clanc   = int.Parse(arr[7]);
                            data.str     = str + "#)#&";
                            familyMailDic.Add(data);
                            famLocalStr.Add(data);
                        }
                    }
                }
                saveLocalData(famLocalStr, 3);
            }
            UIClient.instance.addEventListener(UI_EVENT.ON_LOAD_ITEMS, onEndLoadItem);
        }
예제 #6
0
        public void init()
        {
            bool flag = this.isInited;

            if (!flag)
            {
                this.isInited = true;
                bool flag2 = HttpAppMgr.instance != null;
                if (flag2)
                {
                    HttpAppMgr.instance.addEventListener(HttpAppMgr.EVENT_GET_GIFT_CARD, new Action <GameEvent>(this.getGiftCard));
                    BaseProxy <E_mailProxy> .getInstance();
                }
                this.timeSmp = muNetCleint.instance.CurServerTimeStamp;
                debug.Log(this.timeSmp.ToString());
                this.perLocalStr.Clear();
                this.famLocalStr.Clear();
                string text  = FileMgr.loadString(FileMgr.TYPE_MAIL, "per");
                string text2 = "";
                text2 = FileMgr.loadString(FileMgr.TYPE_MAIL, "fam");
                bool flag3 = text != "" && text != " ";
                if (flag3)
                {
                    string[] array = text.Split(this.sep2, StringSplitOptions.None);
                    try
                    {
                        string[] array2 = array;
                        for (int i = 0; i < array2.Length; i++)
                        {
                            string   text3  = array2[i];
                            string[] array3 = text3.Split(this.sep1, StringSplitOptions.None);
                            debug.Log(array3[0] + 22);
                            bool flag4 = array3[0] != "" && array3[0] != " ";
                            if (flag4)
                            {
                                bool flag5 = int.Parse(array3[6]) + 1296000 > this.timeSmp;
                                if (flag5)
                                {
                                    mailData mailData = new mailData();
                                    mailData.frmcid  = int.Parse(array3[0]);
                                    mailData.frmsex  = int.Parse(array3[1]);
                                    mailData.cid     = int.Parse(array3[2]);
                                    mailData.time    = array3[3];
                                    mailData.frmname = array3[4];
                                    mailData.msg     = array3[5];
                                    mailData.str     = text3 + "#)#&";
                                    bool flag6 = ModelBase <E_mailModel> .getInstance().personalMailDic.ContainsKey(mailData.frmcid);

                                    if (flag6)
                                    {
                                        ModelBase <E_mailModel> .getInstance().personalMailDic[mailData.frmcid].Add(mailData);
                                    }
                                    else
                                    {
                                        List <mailData> list = new List <mailData>();
                                        list.Add(mailData);
                                        ModelBase <E_mailModel> .getInstance().personalMailDic.Add(mailData.frmcid, list);
                                    }
                                    this.perLocalStr.Add(mailData);
                                }
                            }
                        }
                        this.saveLocalData(this.perLocalStr, 4);
                    }
                    catch (Exception var_15_26F)
                    {
                        FileMgr.saveString(FileMgr.TYPE_MAIL, "per", " ");
                        FileMgr.saveString(FileMgr.TYPE_MAIL, "fam", " ");
                    }
                }
                bool flag7 = text2 != "" && text2 != " ";
                if (flag7)
                {
                    string[] array4 = text2.Split(this.sep2, StringSplitOptions.None);
                    string[] array5 = array4;
                    for (int j = 0; j < array5.Length; j++)
                    {
                        string   text4  = array5[j];
                        string[] array6 = text4.Split(this.sep1, StringSplitOptions.None);
                        bool     flag8  = array6[0] != "" && array6[0] != " ";
                        if (flag8)
                        {
                            bool flag9 = int.Parse(array6[6]) + 1296000 > this.timeSmp;
                            if (flag9)
                            {
                                mailData mailData2 = new mailData();
                                mailData2.frmcid  = int.Parse(array6[0]);
                                mailData2.frmsex  = int.Parse(array6[1]);
                                mailData2.cid     = int.Parse(array6[2]);
                                mailData2.time    = array6[3];
                                mailData2.frmname = array6[4];
                                mailData2.msg     = array6[5];
                                mailData2.clanc   = int.Parse(array6[7]);
                                mailData2.str     = text4 + "#)#&";
                                this.familyMailDic.Add(mailData2);
                                this.famLocalStr.Add(mailData2);
                            }
                        }
                    }
                    this.saveLocalData(this.famLocalStr, 3);
                }
                UIClient.instance.addEventListener(9001u, new Action <GameEvent>(this.onEndLoadItem));
            }
        }