| | |
| | | hangUpPushlist.Add((int)PushNotifyType.PrivateChat);
|
| | | hangUpPushlist.Add((int)PushNotifyType.TJDead);
|
| | | hangUpPushlist.Add((int)PushNotifyType.TJWGTimeNoEnough);
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | |
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | public void SetActivityPushKey()
|
| | |
| | | {
|
| | | DailyQuestOpenTime dailyQuestOpenTime;
|
| | | dailyModel.TryGetOpenTime(dailyId, out dailyQuestOpenTime);
|
| | | foreach (var weekday in dailyQuestOpenTime.openTimes.Keys)
|
| | |
|
| | | for (int i = 0; i < 7; i++)
|
| | | {
|
| | | List<HourMinute> hourMinutelist = dailyQuestOpenTime.openTimes[weekday];
|
| | | for (int i = 0; i < hourMinutelist.Count; i++)
|
| | | var hourMinutelist = dailyQuestOpenTime.GetHourMinuteByWeek(i);
|
| | | if (hourMinutelist != null)
|
| | | {
|
| | | string key = StringUtility.Contact(dailyId,weekday,hourMinutelist[i].hourBegin);
|
| | | keylist.Add(key);
|
| | | for (int j = 0; j < hourMinutelist.Count; j++)
|
| | | {
|
| | | var key = StringUtility.Contact(dailyId, i, hourMinutelist[i].hourBegin);
|
| | | keylist.Add(key);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | public void RemoveActivityPushByKey(int dailyId, string pushKey)
|
| | | {
|
| | | if(pushAtcivityKeyDict[dailyId].Contains(pushKey))
|
| | | if (pushAtcivityKeyDict[dailyId].Contains(pushKey))
|
| | | {
|
| | | SDKUtility.Instance.GeTui_RemoveLocalMessage(pushKey);
|
| | | }
|
| | |
| | | string content = Language.Get("SetUpPrivate102", UIHelper.ServerStringTrim(PlayerDatas.Instance.baseData.PlayerName).TrimEnd(), config.Title);
|
| | | List<JsonData> pushNotifylist = new List<JsonData>();
|
| | | List<string> pushKeylist = null;
|
| | | List<int> pushNotifyTimelist = GetPushNotifyTime(dailyId,out pushKeylist);
|
| | | List<int> pushNotifyTimelist = GetPushNotifyTime(dailyId, out pushKeylist);
|
| | | for (int i = 0; i < pushNotifyTimelist.Count; i++)
|
| | | {
|
| | | if(i < pushKeylist.Count)
|
| | | if (i < pushKeylist.Count)
|
| | | {
|
| | | JsonData _params = new JsonData();
|
| | | _params["code"] = 2005;
|
| | |
| | | return pushNotifylist;
|
| | | }
|
| | |
|
| | | private List<int> GetPushNotifyTime(int dailyId,out List<string> pushKey)
|
| | | private List<int> GetPushNotifyTime(int dailyId, out List<string> pushKey)
|
| | | {
|
| | | List<int> pushDelaySecond = new List<int>();
|
| | | pushKey = new List<string>();
|
| | | DailyQuestOpenTime dailyQuestOpenTime;
|
| | | dailyModel.TryGetOpenTime(dailyId, out dailyQuestOpenTime);
|
| | | foreach (var weekday in dailyQuestOpenTime.openTimes.Keys)
|
| | |
|
| | | for (int weekDay = 0; weekDay < 7; weekDay++)
|
| | | {
|
| | | int day = weekday > 0 ? weekday : 7;
|
| | | int curDay = (int)TimeUtility.ServerNow.DayOfWeek > 0 ? (int)TimeUtility.ServerNow.DayOfWeek : 7;
|
| | | List <HourMinute> hourMinutelist = dailyQuestOpenTime.openTimes[weekday];
|
| | | int remainDay = day - curDay;
|
| | | if (remainDay < 0)
|
| | | var hourMinutelist = dailyQuestOpenTime.GetHourMinuteByWeek(weekDay);
|
| | | if (hourMinutelist != null)
|
| | | {
|
| | | remainDay = 7 + remainDay;
|
| | | }
|
| | | for (int i = 0; i < hourMinutelist.Count; i++)
|
| | | {
|
| | | int remainHour = hourMinutelist[i].hourBegin - TimeUtility.ServerNow.Hour;
|
| | | int remainMinute = hourMinutelist[i].minuteBegin - TimeUtility.ServerNow.Minute;
|
| | | if(remainDay <= 0)
|
| | | int day = weekDay > 0 ? weekDay : 7;
|
| | | int curDay = (int)TimeUtility.ServerNow.DayOfWeek > 0 ? (int)TimeUtility.ServerNow.DayOfWeek : 7;
|
| | | int remainDay = day - curDay;
|
| | | if (remainDay < 0)
|
| | | {
|
| | | if (remainHour < 0)
|
| | | remainDay = 7 + remainDay;
|
| | | }
|
| | | for (int i = 0; i < hourMinutelist.Count; i++)
|
| | | {
|
| | | int remainHour = hourMinutelist[i].hourBegin - TimeUtility.ServerNow.Hour;
|
| | | int remainMinute = hourMinutelist[i].minuteBegin - TimeUtility.ServerNow.Minute;
|
| | | if (remainDay <= 0)
|
| | | {
|
| | | remainDay = 7;
|
| | | if (remainHour < 0)
|
| | | {
|
| | | remainDay = 7;
|
| | | }
|
| | | else if (remainHour == 0 && remainMinute < 0)
|
| | | {
|
| | | remainDay = 7;
|
| | | }
|
| | | }
|
| | | else if (remainHour == 0 && remainMinute < 0)
|
| | | int remainSecond = remainDay * 24 * 60 * 60 + remainHour * 60 * 60 + remainMinute * 60;
|
| | | if (remainSecond > 120)
|
| | | {
|
| | | remainDay = 7;
|
| | | string key = StringUtility.Contact(dailyId, weekDay, hourMinutelist[i].hourBegin);
|
| | | pushKey.Add(key);
|
| | | pushDelaySecond.Add(remainSecond);
|
| | | }
|
| | | }
|
| | | int remainSecond = remainDay * 24 * 60 * 60 + remainHour * 60 * 60 + remainMinute * 60;
|
| | | if (remainSecond > 120)
|
| | | {
|
| | | string key = StringUtility.Contact(dailyId,weekday,hourMinutelist[i].hourBegin);
|
| | | pushKey.Add(key);
|
| | | pushDelaySecond.Add(remainSecond);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | return pushDelaySecond;
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | int pushSet = Convert.ToInt32(pushSB.ToString(),2);
|
| | | int pushSet = Convert.ToInt32(pushSB.ToString(), 2);
|
| | | SendPushNotifyQuest(pushSet);
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | if (i < hangUpPushlist.Count)
|
| | | {
|
| | | if (vipLv > 0 |
| | | if (vipLv > 0
|
| | | && !vipModel.IsVipExperience())
|
| | | {
|
| | | pushSetDict[indexlist[i]] = true;
|
| | | }
|
| | | else if(vipLv < 1
|
| | | else if (vipLv < 1
|
| | | && !vipModel.IsVipExperience())
|
| | | {
|
| | | pushSetDict[indexlist[i]] = false;
|
| | |
| | | {
|
| | | pushSetDict[indexlist[i]] = true;
|
| | | }
|
| | | else if(!vipModel.IsVipExperience() |
| | | else if (!vipModel.IsVipExperience()
|
| | | && PlayerDatas.Instance.baseData.VIPLv < 1)
|
| | | {
|
| | | pushSetDict[indexlist[i]] = false;
|
| | |
| | | }
|
| | | int pushSet = Convert.ToInt32(pushSB.ToString(), 2);
|
| | | SendPushNotifyQuest(pushSet);
|
| | | LocalSave.SetBool(VIPEXPERIENCERECORD,vipModel.IsVipExperience());
|
| | | LocalSave.SetBool(VIPEXPERIENCERECORD, vipModel.IsVipExperience());
|
| | | }
|
| | |
|
| | | public void RefreshPushSet(int switchIndex, bool isOpen)
|
| | |
| | | DailyQuestOpenTime dailyQuestOpenTime;
|
| | | dailyModel.TryGetOpenTime(quests[i], out dailyQuestOpenTime);
|
| | | var config = Config.Instance.Get<DailyQuestConfig>(quests[i]);
|
| | | if(isFunclimit)
|
| | | if (isFunclimit)
|
| | | {
|
| | | if (dailyQuestOpenTime.IsValidServerOpenTime() && FuncOpen.Instance.IsFuncOpen(config.UnLockFuncID))
|
| | | {
|
| | |
| | | week = dailyQuestOpenTime.ToOpenTimeString();
|
| | | title = config.Title;
|
| | | time = "";
|
| | | foreach (var weekday in dailyQuestOpenTime.openTimes.Keys)
|
| | |
|
| | | for (int i = 0; i < 7; i++)
|
| | | {
|
| | | List<HourMinute> hourMinutelist = dailyQuestOpenTime.openTimes[weekday];
|
| | | time = StringUtility.Contact(hourMinutelist[0].hourBegin > 9 ? hourMinutelist[0].hourBegin.ToString() : "0" + hourMinutelist[0].hourBegin, ":", hourMinutelist[0].minuteBegin > 9 ? hourMinutelist[0].minuteBegin.ToString() : "0" + hourMinutelist[0].minuteBegin);
|
| | | break;
|
| | | var hourMinutelist = dailyQuestOpenTime.GetHourMinuteByWeek(i);
|
| | | if (hourMinutelist != null)
|
| | | {
|
| | | time = StringUtility.Contact(hourMinutelist[0].hourBegin > 9 ? hourMinutelist[0].hourBegin.ToString() : "0" + hourMinutelist[0].hourBegin, ":", hourMinutelist[0].minuteBegin > 9 ? hourMinutelist[0].minuteBegin.ToString() : "0" + hourMinutelist[0].minuteBegin);
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | pushSB.Length = 0;
|
| | | List<int> indexlist = pushSetDict.Keys.ToList();
|
| | | for(int i = indexlist.Count - 1; i > -1; i--)
|
| | | for (int i = indexlist.Count - 1; i > -1; i--)
|
| | | {
|
| | | if (pushSetDict[indexlist[i]])
|
| | | {
|
| | |
| | | DailyQuestOpenTime openTime;
|
| | | dailyModel.TryGetOpenTime(dailyId, out openTime);
|
| | | var dayOfWeek = (int)TimeUtility.ServerNow.DayOfWeek;
|
| | | if (openTime.openTimes.ContainsKey(dayOfWeek))
|
| | | var hourMinutes = openTime.GetHourMinuteByWeek(dayOfWeek);
|
| | | if (hourMinutes != null)
|
| | | {
|
| | | var hourMinutes = openTime.openTimes[dayOfWeek];
|
| | | for (int i = 0; i < hourMinutes.Count; i++)
|
| | | {
|
| | | var minutes = TimeUtility.ServerNow.Hour * 60 + TimeUtility.ServerNow.Minute;
|
| | |
| | | if (minuteOffset <= 2 && minuteOffset > 0)
|
| | | {
|
| | | string key = StringUtility.Contact(dailyId, dayOfWeek, hourMinutes[i].hourBegin);
|
| | | RemoveActivityPushByKey(dailyId,key);
|
| | | RemoveActivityPushByKey(dailyId, key);
|
| | | }
|
| | | }
|
| | | }
|