少年修仙传客户端代码仓库
hch
2025-06-12 204ef05a831c9484e2abc561d27ecbff7c797453
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Tuesday, January 08, 2019
//--------------------------------------------------------
using System;
using System.Collections.Generic;
 
using vnxbqy.UI;
using System.Linq;
 
 
public class ActionTypeClass
{
    public int TemplateID;    // 模板ID
    public int CurTimes;    //已完成次数
    public int GotTimes;    //已领取次数
}
public class WeekPartyDayInfoClass
{
    public int DayIndex;//第X天
    public int Point;//积分
    public int AwardRecord;//领奖记录
    public List<ActionTypeClass> ActionType;//领奖信息
}
public class TimeDayClass
{
    public int Year;
    public int Month;
    public int Day;
    public string TimeStr;
}
public class WeekPartyItemClass
{
    public int NeedPoint; // 领奖需要积分
    public int ItemID;   // 物品ID
    public int ItemCnt;   // 物品数量
    public int IsBind;    // 是否绑定
}
 
public class WeekPartyDayClass
{
    public int Day;
    public int[] TemplateList;// 模板列表
    public WeekPartyItemClass[] WeekPartyItem;//奖励列表  
}
 
public class WeekPartyActionClass//模板信息
{
    public int TemplateID;   // 模板ID
    public int ActionType;    // 活动类别
    public int TotalTimes;    // 可完成的总次数,0表示不限次数
    public int SingleTimes;  // 单次领奖需要的次数
    public int Point;    // 单次领奖积分
    public WeekPartyItemClass[] WeekPartyItem;//物品奖励列表
    public string ItemJson;
}
public class OpenServiceAchievementModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
{
    public Dictionary<int, WeekPartyDayInfoClass> WeekPartyDayInfoDic = new Dictionary<int, WeekPartyDayInfoClass>();//每天领取奖励信息
    public event Action WeekPartyDayInfoUpdate;//领奖记录变更
    public TimeDayClass[] TimeDayBeginAndOver = new TimeDayClass[2];//开始和结束时间
    public int LimitLV = 0;//限制等级
    public Dictionary<int, WeekPartyDayClass> WeekPartyDayDic = new Dictionary<int, WeekPartyDayClass>();//每天的奖励信息
    public Dictionary<int, WeekPartyActionClass> WeekPartyActionDic = new Dictionary<int, WeekPartyActionClass>();//活动模板信息
    public Dictionary<int, Redpoint> RedPointDic = new Dictionary<int, Redpoint>();//红点
    public event Action WeekPartyUpdate;//活动信息变更
    private const int Redpoint_key = 214;//周狂欢红点
    public Redpoint redPointStre = new Redpoint(2, Redpoint_key);
    private const int Redpoint_key1 = 21401;//周狂欢红点
    public Redpoint redPointStre1 = new Redpoint(Redpoint_key, Redpoint_key1);
    private int _SelectedNow = 0;
    private int ResetType = 0;// 重置类型,0-0点重置;1-5点重置
    private int AdvanceMinutes = 0;//提前显示分钟
    private bool isPreviewTime = false;
    private bool isOpenNow = false;
    public event Action IsOpenEvent;//功能是否开启
    public event Action IsPreviewTimeUpdate;//功能是否提前开启
    private int _JumpIndex = -1;//跳转选中值
    public int JumpIndex
    {
        get { return _JumpIndex; }
        set { _JumpIndex = value; }
    }
 
 
    public int SelectedNow//选中天
    {
        get { return _SelectedNow; }
        set { _SelectedNow = value; }
    }
 
    private int _DayNow = 0;
    public int DayNow//当前天
    {
        get { return _DayNow; }
        set { _DayNow = value; }
    }
 
    private bool _IsOpen = false;//功能是否开启
    public bool IsOpen
    {
        get { return _IsOpen; }
        set { _IsOpen = value; }
    }
    public override void Init()
    {
 
    }
 
    public void OnBeforePlayerDataInitialize()
    {
        WeekPartyDayInfoDic.Clear();
        WeekPartyDayDic.Clear();
        WeekPartyActionDic.Clear();
        isOpenNow = false;
        isPreviewTime = false;
    }
 
    public void OnPlayerLoginOk()
    {
        GlobalTimeEvent.Instance.secondEvent -= secondEvent;
        GlobalTimeEvent.Instance.secondEvent += secondEvent;
        GetDayNow();//获取当前天数
        SetRedPoint();
 
    }
 
    private void secondEvent()
    {
        bool _bool = IsPreviewTime();
        if (_bool && !isPreviewTime)
        {
            isPreviewTime = true;
            _IsOpen = true;
            if (IsPreviewTimeUpdate != null)
            {
                IsPreviewTimeUpdate();
            }
        }
        GetIsOpen();//判断功能是否开启
        GetDayNow();
 
    }
 
    public override void UnInit()
    {
 
    }
 
    public void WeekPartyPlayerInfo(HAA0B_tagMCWeekPartyPlayerInfo info)
    {
        for (int i = 0; i < info.Count; i++)
        {
            var DayInfo = info.DayInfoList[i];
            WeekPartyDayInfoClass WeekPartyDayInfo = new WeekPartyDayInfoClass();
            WeekPartyDayInfo.DayIndex = (int)DayInfo.DayIndex;
            WeekPartyDayInfo.Point = (int)DayInfo.Point;
            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;
                for (int j = 0; j < DayInfo.ACount; j++)
                {
                    var taskList = DayInfo.TaskList[j];
                    int Index = dit.ActionType.FindIndex(s => s.TemplateID == taskList.TemplateID);
                    if (Index != -1)
                    {
                        dit.ActionType[Index].CurTimes = (int)taskList.CurTimes;
                        dit.ActionType[Index].GotTimes = (int)taskList.GotTimes;
                    }
                    else
                    {
                        ActionTypeClass ActionType = new ActionTypeClass();
                        ActionType.TemplateID = taskList.TemplateID;
                        ActionType.CurTimes = (int)taskList.CurTimes;
                        ActionType.GotTimes = (int)taskList.GotTimes;
                        dit.ActionType.Add(ActionType);
                    }
                }
                WeekPartyDayInfoDic[(int)DayInfo.DayIndex] = dit;
            }
            else
            {
                WeekPartyDayInfo.ActionType = new List<ActionTypeClass>();
                for (int k = 0; k < DayInfo.ACount; k++)
                {
                    var Task = DayInfo.TaskList[k];
                    ActionTypeClass ActionType = new ActionTypeClass();
                    ActionType.TemplateID = Task.TemplateID;
                    ActionType.CurTimes = (int)Task.CurTimes;
                    ActionType.GotTimes = (int)Task.GotTimes;
                    WeekPartyDayInfo.ActionType.Add(ActionType);
                }
                WeekPartyDayInfoDic.Add((int)DayInfo.DayIndex, WeekPartyDayInfo);
            }
        }
        GetDayNow();//获取当前天数
        SetRedPoint();
        if (WeekPartyDayInfoUpdate != null)
        {
            WeekPartyDayInfoUpdate();
        }
    }
 
    public void WeekPartyInfo(HAA0A_tagMCWeekPartyInfo info)
    {
        WeekPartyDayDic.Clear();
        WeekPartyActionDic.Clear();
        ResetType = info.ResetType;
        string[] dateArray = info.StartDate.Split('-');
        if (dateArray != null && dateArray.Length == 3)
        {
            TimeDayClass TimeDay = new TimeDayClass();
            TimeDay.Year = int.Parse(dateArray[0].Trim());
            TimeDay.Month = int.Parse(dateArray[1].Trim());
            TimeDay.Day = int.Parse(dateArray[2].Trim());
            TimeDay.TimeStr = info.StartDate;
            TimeDayBeginAndOver[0] = TimeDay;
        }
        string[] dateArrayO = info.EndtDate.Split('-');
        if (dateArrayO != null && dateArrayO.Length == 3)
        {
            TimeDayClass TimeDay = new TimeDayClass();
            TimeDay.Year = int.Parse(dateArrayO[0].Trim());
            TimeDay.Month = int.Parse(dateArrayO[1].Trim());
            TimeDay.Day = int.Parse(dateArrayO[2].Trim());
            TimeDay.TimeStr = info.EndtDate;
            TimeDayBeginAndOver[1] = TimeDay;
        }
        LimitLV = info.LimitLV;
        AdvanceMinutes = info.AdvanceMinutes;
        for (int i = 0; i < info.DayCnt; i++)
        {
            int Index = i;
            var DayInfo = info.DayInfoList[i];
            WeekPartyDayClass WeekPartyDay = new WeekPartyDayClass();
            WeekPartyDay.TemplateList = new int[DayInfo.ActCnt];
            for (int k = 0; k < DayInfo.ActCnt; k++)
            {
                WeekPartyDay.TemplateList[k] = DayInfo.TemplateList[k];
            }
            WeekPartyDay.WeekPartyItem = new WeekPartyItemClass[DayInfo.PCount];
            for (int p = 0; p < DayInfo.PCount; p++)
            {
                WeekPartyItemClass WeekPartyItem = new WeekPartyItemClass();
                var Item = DayInfo.PItemInfo[p];
                WeekPartyItem.NeedPoint = Item.NeedPoint;
                WeekPartyItem.ItemID = (int)Item.ItemID;
                WeekPartyItem.ItemCnt = (int)Item.ItemCnt;
                WeekPartyItem.IsBind = (int)Item.IsBind;
                WeekPartyDay.WeekPartyItem[p] = WeekPartyItem;
            }
            if (WeekPartyDayDic.ContainsKey(Index))
            {
                WeekPartyDayDic[Index] = WeekPartyDay;
            }
            else
            {
                WeekPartyDayDic.Add(Index, WeekPartyDay);
            }
        }// 每天模板
 
        for (int i = 0; i < info.TCount; i++)
        {
            var ActionInfo = info.ActionInfo[i];
            WeekPartyActionClass WeekPartyAction = new WeekPartyActionClass();
            WeekPartyAction.TemplateID = (int)ActionInfo.TemplateID;
            WeekPartyAction.ActionType = (int)ActionInfo.ActionType;
            WeekPartyAction.TotalTimes = (int)ActionInfo.TotalTimes;
            WeekPartyAction.SingleTimes = (int)ActionInfo.SingleTimes;
            WeekPartyAction.Point = (int)ActionInfo.Point;
            WeekPartyAction.WeekPartyItem = new WeekPartyItemClass[ActionInfo.Count];
            for (int z = 0; z < ActionInfo.Count; z++)
            {
                var item = ActionInfo.ItemInfo[z];
                WeekPartyItemClass WeekPartyItem = new WeekPartyItemClass();
                WeekPartyItem.ItemID = (int)item.ItemID;
                WeekPartyItem.ItemCnt = (int)item.ItemCnt;
                WeekPartyItem.IsBind = item.IsBind;
                WeekPartyItem.NeedPoint = 0;
                WeekPartyAction.WeekPartyItem[z] = WeekPartyItem;
            }
            if (WeekPartyActionDic.ContainsKey((int)ActionInfo.TemplateID))
            {
                WeekPartyActionDic[(int)ActionInfo.TemplateID] = WeekPartyAction;
            }
            else
            {
                WeekPartyActionDic.Add((int)ActionInfo.TemplateID, WeekPartyAction);
            }
        }// 活动模板信息
        GetDayNow();
        SetRedPoint();
        if (WeekPartyUpdate != null)
        {
            WeekPartyUpdate();
        }
 
    }
    public int GetRewardNumber(int Day, int ID)//获取领奖次数
    {
        int Num = 0;
        if (WeekPartyDayInfoDic.ContainsKey(Day))
        {
            var WeekPartyDay = WeekPartyDayInfoDic[Day];
 
            for (int i = 0; i < WeekPartyDay.ActionType.Count; i++)
            {
                var ActionType = WeekPartyDay.ActionType[i];
                if (ID == ActionType.TemplateID)
                {
                    Num = ActionType.GotTimes;
                }
            }
        }
        return Num;
    }
    public int GetCarryOutNum(int Day, int ID)//获取已完成次数
    {
        int Num = 0;
        if (WeekPartyDayInfoDic.ContainsKey(Day))
        {
            var WeekPartyDay = WeekPartyDayInfoDic[Day];
 
            for (int i = 0; i < WeekPartyDay.ActionType.Count; i++)
            {
                var ActionType = WeekPartyDay.ActionType[i];
                if (ID == ActionType.TemplateID)
                {
                    Num = ActionType.CurTimes;
                }
            }
        }
        return Num;
    }
 
    public int GetPoint(int day)//获取某一天的积分
    {
        int Point = 0;
        if (WeekPartyDayInfoDic.ContainsKey(day))
        {
            Point = WeekPartyDayInfoDic[day].Point;
        }
        return Point;
    }
 
    public void GetDayNow()//获取活动第几天
    {
        int Day = 0;
        var time = TimeDayBeginAndOver[0];
        if (TimeDayBeginAndOver.Length <= 0 || time == null)
        {
            return;
        }
        int hour = 0;
        if (ResetType == 0)
        {
            hour = 0;
        }
        else
        {
            hour = 5;
        }
        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;
        if (Day <= 0)
        {
            Day = 0;
        }
        // DebugEx.LogError("输出当前的天数" + Day);
        if (DayNow != Day && Day < 7)
        {
            DayNow = Day;
            if (WeekPartyDayInfoUpdate != null)
            {
                WeekPartyDayInfoUpdate();
            }
        }
 
    }
 
    public void SendGetWeekParty(int day, int temdayplateID)//领取周狂欢活动奖励
    {
        CA504_tagCMPlayerGetReward getReward = new CA504_tagCMPlayerGetReward();
        getReward.RewardType = (byte)GotServerRewardType.Def_RewardType_WeekPartyAct;
        getReward.DataEx = (uint)day;
        string StrID = temdayplateID.ToString();
        getReward.DataExStrLen = (byte)StrID.Length;
        getReward.DataExStr = StrID;
        GameNetSystem.Instance.SendInfo(getReward);
    }
    public void SendGetWeekPartyPoint(int day, int point)//领取周狂欢积分奖励
    {
        CA504_tagCMPlayerGetReward getReward = new CA504_tagCMPlayerGetReward();
        getReward.RewardType = (byte)GotServerRewardType.Def_RewardType_WeekPartyPoint;
        getReward.DataEx = (uint)day;
        string StrID = point.ToString();
        getReward.DataExStrLen = (byte)StrID.Length;
        getReward.DataExStr = StrID;
        GameNetSystem.Instance.SendInfo(getReward);
    }
 
    public bool IsDayReward(int day, int index)//是否领取奖励
    {
        bool _bool = false;
        int AwardRecord = 0;
        foreach (var key in WeekPartyDayInfoDic.Keys)
        {
            if (key == day)
            {
                AwardRecord = WeekPartyDayInfoDic[key].AwardRecord;
            }
        }
        _bool = MathUtility.GetBitValue((uint)AwardRecord, (ushort)index);
        return _bool;
    }
    private void SetRedPoint()//红点设置
    {
        SetRedPointId();
        foreach (var key in RedPointDic.Keys)
        {
            RedPointDic[key].state = RedPointState.None;
        }
        foreach (var key in RedPointDic.Keys)
        {
            RedPointDic[key].state = SetRedPointState(key);
        }
    }
    private void SetRedPointId()//设置红点ID
    {
        if (RedPointDic.Count >= 7) { return; }
        RedPointDic.Clear();
        foreach (var key in WeekPartyDayInfoDic.Keys)
        {
            int RedPoint = Redpoint_key1 * 10 + key;
            if (!RedPointDic.ContainsKey(key))
            {
                Redpoint redPointMountStare = new Redpoint(Redpoint_key1, RedPoint);
                RedPointDic.Add(key, redPointMountStare);
            }
        }
 
    }
    List<WeekPartyItemClass> List = new List<WeekPartyItemClass>();
    private RedPointState SetRedPointState(int day)//红点状态设置
    {
        if (!WeekPartyDayDic.ContainsKey(day) || !WeekPartyDayInfoDic.ContainsKey(day) || day > DayNow)
        {
            return RedPointState.None;
        }
        WeekPartyDayClass WeekPartyDay = new WeekPartyDayClass();
        int point = WeekPartyDayInfoDic[day].Point;
        foreach (var key in WeekPartyDayDic.Keys)
        {
            if (key == day)
            {
                WeekPartyDay = WeekPartyDayDic[key];
            }
        }
        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.GetReward;
            }
        }
        for (int i = 0; i < WeekPartyDay.TemplateList.Length; i++)
        {
            var TemplateID = WeekPartyDay.TemplateList[i];
            if (WeekPartyActionDic.ContainsKey(TemplateID))
            {
                var WeekPartyAction = WeekPartyActionDic[TemplateID];
                int number = WeekPartyAction.TotalTimes / WeekPartyAction.SingleTimes;
                int rewardNum = GetRewardNumber(day, TemplateID);//已领奖次数
                int carryOutNum = GetCarryOutNum(day, TemplateID);//已完成次数
                int TaypeNumber = 0;
                if (carryOutNum - rewardNum > 0)
                {
                    TaypeNumber = (carryOutNum - rewardNum) / WeekPartyAction.SingleTimes;
                }
                if (TaypeNumber > 0 && carryOutNum <= WeekPartyAction.TotalTimes)
                {
                    return RedPointState.GetReward;
                }
            }
        }
        return RedPointState.None;
    }
    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];
        if (TimeDayBeginAndOver.Length <= 0 || time == null)
        {
            return weekDay;
        }
        DateTime time1 = new DateTime(time.Year, time.Month, time.Day);
        var time2 = time1.AddDays(dayIndex);
        var dt = time2.DayOfWeek.ToString();
        switch (dt)
        {
            case "Monday":
                weekDay = 1;
                break;
            case "Tuesday":
                weekDay = 2;
                break;
            case "Wednesday":
                weekDay = 3;
                break;
            case "Thursday":
                weekDay = 4;
                break;
            case "Friday":
                weekDay = 5;
                break;
            case "Saturday":
                weekDay = 6;
                break;
            case "Sunday":
                weekDay = 0;
                break;
        }
        return weekDay;
    }
 
    public void GetIsOpen()
    {
        var time1 = TimeDayBeginAndOver[0];
        var time2 = TimeDayBeginAndOver[1];
        if (TimeDayBeginAndOver.Length <= 0 || time1 == null || time2 == null)
        {
            return;
        }
        int hour = 0;
        if (ResetType == 0)
        {
            hour = 0;
        }
        else
        {
            hour = 5;
        }
        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);
        int PlayerLv = PlayerDatas.Instance.baseData.LV;
        if (PlayerLv >= LimitLV && timeNow >= timeStar && timeNow < timeEnd && !isOpenNow)
        {
            isOpenNow = true;
            _IsOpen = true;
            if (IsOpenEvent != null)
            {
                IsOpenEvent();
            }
 
        }
        bool istimeBool = (timeNow < timeStar && !IsPreviewTime()) || (timeNow > timeEnd);
        if (istimeBool && isOpenNow)
        {
            isOpenNow = false;
            _IsOpen = false;
            if (IsOpenEvent != null)
            {
                IsOpenEvent();
            }
        }
    }
 
    public bool IsJumpOpen()
    {
        bool Isbool = false;
        if (LimitLV == 0)//活动未开启
        {
            SysNotifyMgr.Instance.ShowTip("OutofActivityTime");
            return false;
        }
        else
        {
            if (PlayerDatas.Instance.baseData.LV < LimitLV)//等级未到达
            {
                SysNotifyMgr.Instance.ShowTip("NotEenoughGrade");
                return Isbool;
            }
        }
        if (_IsOpen)
        {
            Isbool = true;
        }
        return Isbool;
    }
 
    public bool IsPreviewTime()//是否再预览时间
    {
        bool _bool = false;
        var time1 = TimeDayBeginAndOver[0];
        var time2 = TimeDayBeginAndOver[1];
        if (TimeDayBeginAndOver.Length <= 0 || time1 == null || time2 == null)
        {
            return _bool;
        }
        int hour = 0;
        if (ResetType == 0)
        {
            hour = 0;
        }
        else
        {
            hour = 5;
        }
        DateTime timeStar = new DateTime(time1.Year, time1.Month, time1.Day, hour, 0, 0);
        var TimeStar2 = timeStar.AddMinutes(-AdvanceMinutes);
        DateTime timeNow = new DateTime(TimeUtility.ServerNow.Year, TimeUtility.ServerNow.Month, TimeUtility.ServerNow.Day, TimeUtility.ServerNow.Hour, TimeUtility.ServerNow.Minute, TimeUtility.ServerNow.Second);
 
        if (timeNow >= TimeStar2 && timeNow < timeStar)
        {
            _bool = true;
        }
        return _bool;
    }
    public bool IsOpenFeatures()
    {
        bool Isbool = false;
        Isbool = (OperationTimeHepler.Instance.SatisfyOpenCondition(Operation.OpenServiceAchievement)
            || OperationTimeHepler.Instance.SatisfyAdvanceCondition(Operation.OpenServiceAchievement));
        return Isbool;
    }
}