| | |
| | | }
|
| | | public override void Init()
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | |
| | | WeekPartyDayInfoClass WeekPartyDayInfo = new WeekPartyDayInfoClass();
|
| | | WeekPartyDayInfo.DayIndex = (int)DayInfo.DayIndex;
|
| | | WeekPartyDayInfo.Point = (int)DayInfo.Point;
|
| | | WeekPartyDayInfo.AwardRecord = (int)DayInfo.AwardRecord; |
| | | WeekPartyDayInfo.AwardRecord = (int)DayInfo.AwardRecord;
|
| | | if (WeekPartyDayInfoDic.ContainsKey((int)DayInfo.DayIndex))
|
| | | {
|
| | | var dit = WeekPartyDayInfoDic[(int)DayInfo.DayIndex];
|
| | | dit.DayIndex= (int)DayInfo.DayIndex; |
| | | dit.Point = (int)DayInfo.Point; |
| | | dit.AwardRecord= (int)DayInfo.AwardRecord;
|
| | | dit.DayIndex = (int)DayInfo.DayIndex;
|
| | | dit.Point = (int)DayInfo.Point;
|
| | | dit.AwardRecord = (int)DayInfo.AwardRecord;
|
| | | for (int j = 0; j < DayInfo.ACount; j++)
|
| | | {
|
| | | var taskList = DayInfo.TaskList[j];
|
| | | int Index = dit.ActionType.FindIndex(s=>s.TemplateID== taskList.TemplateID);
|
| | | int Index = dit.ActionType.FindIndex(s => s.TemplateID == taskList.TemplateID);
|
| | | if (Index != -1)
|
| | | {
|
| | | dit.ActionType[Index].CurTimes = (int)taskList.CurTimes;
|
| | |
| | | }
|
| | | public int GetRewardNumber(int Day, int ID)//获取领奖次数
|
| | | {
|
| | | int Num =0;
|
| | | int Num = 0;
|
| | | if (WeekPartyDayInfoDic.ContainsKey(Day))
|
| | | {
|
| | | var WeekPartyDay = WeekPartyDayInfoDic[Day];
|
| | |
| | | {
|
| | | hour = 5;
|
| | | }
|
| | | DateTime time1 = new DateTime(time.Year, time.Month, time.Day, hour,0,0);
|
| | | DateTime time1 = new DateTime(time.Year, time.Month, time.Day, hour, 0, 0);
|
| | | DateTime time2 = new DateTime(TimeUtility.ServerNow.Year, TimeUtility.ServerNow.Month, TimeUtility.ServerNow.Day, TimeUtility.ServerNow.Hour, TimeUtility.ServerNow.Minute, TimeUtility.ServerNow.Second);
|
| | | TimeSpan ts = time2.Subtract(time1);
|
| | | Day = (int)ts.TotalDays;
|
| | |
| | | {
|
| | | Day = 0;
|
| | | }
|
| | | // DebugEx.LogError("输出当前的天数" + Day);
|
| | | if (DayNow != Day && Day<7)
|
| | | // DebugEx.LogError("输出当前的天数" + Day);
|
| | | if (DayNow != Day && Day < 7)
|
| | | {
|
| | | DayNow = Day;
|
| | | if (WeekPartyDayInfoUpdate != null)
|
| | |
| | | WeekPartyDayInfoUpdate();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | public void SendGetWeekParty(int day, int temdayplateID)//领取周狂欢活动奖励
|
| | |
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | List<WeekPartyItemClass> List = new List<WeekPartyItemClass>();
|
| | | private RedPointState SetRedPointState(int day)//红点状态设置
|
| | | {
|
| | | if (!WeekPartyDayDic.ContainsKey(day) || !WeekPartyDayInfoDic.ContainsKey(day)|| day>DayNow)
|
| | | if (!WeekPartyDayDic.ContainsKey(day) || !WeekPartyDayInfoDic.ContainsKey(day) || day > DayNow)
|
| | | {
|
| | | return RedPointState.None;
|
| | | }
|
| | |
| | | WeekPartyDay = WeekPartyDayDic[key];
|
| | | }
|
| | | }
|
| | | for (int i = 0; i < WeekPartyDay.WeekPartyItem.Length; i++)//积分奖励
|
| | | List.Clear();
|
| | | for (int i = 0; i < WeekPartyDay.WeekPartyItem.Length; i++)
|
| | | {
|
| | | var item = WeekPartyDay.WeekPartyItem[i];
|
| | | List.Add(item);
|
| | | }
|
| | | List.Sort(Compare);
|
| | |
|
| | | for (int i = 0; i < List.Count; i++)//积分奖励
|
| | | {
|
| | | var item = List[i];
|
| | | int type = i;
|
| | | bool IsBool = IsDayReward(day, type);
|
| | | if (point >= item.NeedPoint && !IsBool)
|
| | |
| | | }
|
| | | return RedPointState.None;
|
| | | }
|
| | |
|
| | | public int GetWeekDay(int dayIndex)//获取周几
|
| | | int Compare(WeekPartyItemClass x, WeekPartyItemClass y)//数组排列
|
| | | {
|
| | | if (x.NeedPoint.CompareTo(y.NeedPoint) != 0)
|
| | | {
|
| | | return x.NeedPoint.CompareTo(y.NeedPoint);
|
| | | }
|
| | | return 1;
|
| | | }
|
| | | public int GetWeekDay(int dayIndex)//获取周几
|
| | | {
|
| | | int weekDay = 1;
|
| | | var time = TimeDayBeginAndOver[0];
|
| | |
| | | return weekDay;
|
| | | }
|
| | | DateTime time1 = new DateTime(time.Year, time.Month, time.Day);
|
| | | var time2= time1.AddDays(dayIndex);
|
| | | var time2 = time1.AddDays(dayIndex);
|
| | | var dt = time2.DayOfWeek.ToString();
|
| | | switch (dt)
|
| | | {
|
| | |
| | | return weekDay;
|
| | | }
|
| | |
|
| | | public void GetIsOpen()
|
| | | public void GetIsOpen()
|
| | | {
|
| | | var time1 = TimeDayBeginAndOver[0];
|
| | | var time2 = TimeDayBeginAndOver[1];
|
| | |
| | | {
|
| | | hour = 5;
|
| | | }
|
| | | DateTime timeStar = new DateTime(time1.Year, time1.Month, time1.Day, hour,0,0);
|
| | | DateTime timeStar = new DateTime(time1.Year, time1.Month, time1.Day, hour, 0, 0);
|
| | | DateTime timeEnd = new DateTime(time2.Year, time2.Month, time2.Day, hour, 0, 0);
|
| | | DateTime timeNow= new DateTime(TimeUtility.ServerNow.Year, TimeUtility.ServerNow.Month, TimeUtility.ServerNow.Day, TimeUtility.ServerNow.Hour, TimeUtility.ServerNow.Minute, TimeUtility.ServerNow.Second);
|
| | | DateTime timeNow = new DateTime(TimeUtility.ServerNow.Year, TimeUtility.ServerNow.Month, TimeUtility.ServerNow.Day, TimeUtility.ServerNow.Hour, TimeUtility.ServerNow.Minute, TimeUtility.ServerNow.Second);
|
| | | int PlayerLv = PlayerDatas.Instance.baseData.LV;
|
| | | if (PlayerLv >= LimitLV && timeNow >= timeStar && timeNow < timeEnd && !isOpenNow)
|
| | | {
|