少年修仙传客户端代码仓库
client_Hale
2019-04-13 d4b5806a57e4e88a1fc57dd95f17e185f33e4e43
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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
 
public class DayRemind
{
 
    private static DayRemind m_Instance = null;
 
    public static DayRemind Instance
    {
        get
        {
            if (m_Instance == null)
            {
                m_Instance = new DayRemind();
            }
            return m_Instance;
        }
    }
 
    protected DayRemind()
    {
        GetPlayerDayRemind();
        DTC0102_tagCDBPlayer.afterPlayerDataInitializeEvent += AfterPlayerDataInitializeEvent;
    }
 
    private void AfterPlayerDataInitializeEvent()
    {
        GetPlayerDayRemind();
    }
 
    public const string DUNGEON_TRIAL_TIP = "DungeonTrialTip";
    public const string DUNGEON_DEMON_TIP = "DungeonDemonTip";
    public const string DUNGEON_RELIC_TIP = "DungeonRelic";
    public const string OSGIFT_TIP = "OSGift";
    public const string RECHARGE_GIFT_TIP = "RechargeGiftTip";
    public const string LOGIN_AD_TIP = "LoginAdTip";
    public const string PASS_SKILL_REDPOINT = "PassSkillRedpoint";
    public const string VIP_GIFT_REDPOINT = "VipGiftRedpoint";
    public const string POTENTIAL_NO_NOTIFY = "PotentialNoNotify";
    public const string FLASHSALE_REDPOINT = "FlashSale_Redpoint";
    public const string OSTIMEGIFT_REDPOINT = "OSTimeGift_Redpoint";
    public const string TASK_SKILL_HOLE = "TaskSkillHole";
    public const string RUNE_SPECIAL_HOLE = "RuneSpecialHole";
    public const string LEAGUE_NOTICE_REDPOINT = "LeagueNoticeRedpoint";
    public const string FAIRYGRABBOSS_NOTICE_REDPOINT = "FairyGrabBossRedpoint";
    public const string TEAM_TICKET_FAIRYLAND = "TeamTicketFairyLand";
    public const string FESTIVALREDPACKREMIND = "FestivalRedpackRemind";
    public const string EQUIPTRAIN_COSTDIAMOND = "EquipTrain_CostDiamond";
    public const string AUCTION_REDPOINT = "Auction_Redpoint";
 
    public Dictionary<string, int[]> dayRemindDic = new Dictionary<string, int[]>();
 
    public bool GetDayRemind(string _remindKey)
    {
        int[] intarray = null;
        dayRemindDic.TryGetValue(_remindKey, out intarray);
        if (intarray == null)
        {
            SetDayRemind(_remindKey);
        }
        if (intarray != null && intarray.Length == 3)
        {
            if (intarray[0] != TimeUtility.ServerNow.Month || intarray[1] != TimeUtility.ServerNow.Day)
            {
                SetDayRemind(_remindKey, false);
                return false;
            }
            return intarray[2] == 1;
        }
        return false;
    }
 
    public void SetDayRemind(string _remindKey, bool _remind)
    {
        int[] intarray = null;
        dayRemindDic.TryGetValue(_remindKey, out intarray);
        if (intarray == null)
        {
            intarray = new int[3];
            dayRemindDic[_remindKey] = intarray;
        }
        intarray[0] = TimeUtility.ServerNow.Month;
        intarray[1] = TimeUtility.ServerNow.Day;
        intarray[2] = _remind ? 1 : 0;
        LocalSave.SetIntArray(StringUtility.Contact(_remindKey, PlayerDatas.Instance.baseData.PlayerID), intarray);
    }
 
    private void GetPlayerDayRemind()
    {
        SetDayRemind(DUNGEON_TRIAL_TIP);
        SetDayRemind(DUNGEON_DEMON_TIP);
        SetDayRemind(DUNGEON_RELIC_TIP);
        SetDayRemind(OSGIFT_TIP);
        SetDayRemind(RECHARGE_GIFT_TIP);
        SetDayRemind(LOGIN_AD_TIP);
        SetDayRemind(PASS_SKILL_REDPOINT);
        SetDayRemind(VIP_GIFT_REDPOINT);
        SetDayRemind(POTENTIAL_NO_NOTIFY);
        SetDayRemind(FLASHSALE_REDPOINT);
        SetDayRemind(OSTIMEGIFT_REDPOINT);
        SetDayRemind(TASK_SKILL_HOLE);
        SetDayRemind(RUNE_SPECIAL_HOLE);
        SetDayRemind(LEAGUE_NOTICE_REDPOINT);
        SetDayRemind(FAIRYGRABBOSS_NOTICE_REDPOINT);
        SetDayRemind(TEAM_TICKET_FAIRYLAND);
        SetDayRemind(FESTIVALREDPACKREMIND);
        SetDayRemind(EQUIPTRAIN_COSTDIAMOND);
        SetDayRemind(AUCTION_REDPOINT);
    }
 
    private void SetDayRemind(string _key)
    {
        var intarray = LocalSave.GetIntArray(StringUtility.Contact(_key, PlayerDatas.Instance.baseData.PlayerID));
        if (dayRemindDic.ContainsKey(_key))
        {
            dayRemindDic[_key] = intarray;
            return;
        }
        dayRemindDic.Add(_key, intarray);
    }
}