Пример #1
0
    public void NotificationOfflineCall()
    {
        int num = 8;

        if (!this.IsLocalPushOn(num))
        {
            return;
        }
        if (this.IsSystemOn(num))
        {
            return;
        }
        SystemOpen systemOpen = DataReader <SystemOpen> .Get(64);

        if (systemOpen == null)
        {
            return;
        }
        TuiSongTongZhi tuiSongTongZhi = DataReader <TuiSongTongZhi> .Get(num);

        if (tuiSongTongZhi != null)
        {
            Debug.Log("[离线召回] time = " + tuiSongTongZhi.early);
            NativeCallManager.NotificationMessage(tuiSongTongZhi.id, string.Format(GameDataUtils.GetChineseContent(tuiSongTongZhi.detail, false), systemOpen.level), DateTime.get_Now().AddSeconds((double)(tuiSongTongZhi.early * 60)), NotificationRepeatInterval.None);
        }
    }
Пример #2
0
    public void Notification_GuildQuestion()
    {
        if (GuildManager.Instance.GetGuildId() <= 0L)
        {
            return;
        }
        int num = 4;

        if (!this.IsLocalPushOn(num))
        {
            return;
        }
        if (!this.IsSystemOn(num))
        {
            return;
        }
        TuiSongTongZhi tuiSongTongZhi = DataReader <TuiSongTongZhi> .Get(num);

        if (tuiSongTongZhi != null)
        {
            string value = DataReader <GongHuiXinXi> .Get("QuestionTime").value;

            string[] array = value.Split(new char[]
            {
                ','
            });
            if (array.Length > 0)
            {
                DateTime dateTime = this.GetDateTime(0, array[0]);
                int      id       = tuiSongTongZhi.id;
                NativeCallManager.NotificationMessage(id, GameDataUtils.GetChineseContent(tuiSongTongZhi.detail, false), dateTime, NotificationRepeatInterval.Day);
            }
        }
    }
Пример #3
0
    public bool IsSystemOn(int pushId)
    {
        if (EntityWorld.Instance.EntSelf == null)
        {
            return(false);
        }
        TuiSongTongZhi tuiSongTongZhi = DataReader <TuiSongTongZhi> .Get(pushId);

        return(tuiSongTongZhi != null && SystemOpenManager.IsSystemOn(tuiSongTongZhi.sysId));
    }
Пример #4
0
    public void RefreshBossPushTag()
    {
        List <TuiSongTongZhi> dataList = DataReader <TuiSongTongZhi> .DataList;

        for (int i = 0; i < dataList.get_Count(); i++)
        {
            TuiSongTongZhi tuiSongTongZhi = DataReader <TuiSongTongZhi> .Get(dataList.get_Item(i).id);

            if (tuiSongTongZhi != null)
            {
                PushNotificationManager.Instance.RefreshPushTag(tuiSongTongZhi.id, tuiSongTongZhi.tab);
            }
        }
    }
Пример #5
0
    public void NotificationActivity(int pushId)
    {
        if (!this.IsLocalPushOn(pushId))
        {
            return;
        }
        if (!this.IsSystemOn(pushId))
        {
            return;
        }
        TuiSongTongZhi tuiSongTongZhi = DataReader <TuiSongTongZhi> .Get(pushId);

        if (tuiSongTongZhi != null && tuiSongTongZhi.activityid > 0)
        {
            HuoDongZhongXin huoDongZhongXin = DataReader <HuoDongZhongXin> .Get(tuiSongTongZhi.activityid);

            if (huoDongZhongXin != null)
            {
                if (huoDongZhongXin.date.get_Count() == 7)
                {
                    int num = 0;
                    for (int i = 0; i < huoDongZhongXin.starttime.get_Count(); i++)
                    {
                        DateTime dateTime       = this.GetDateTime(0, huoDongZhongXin.starttime.get_Item(i));
                        int      notificationID = this.GetNotificationID(tuiSongTongZhi, num++);
                        NativeCallManager.NotificationMessage(notificationID, GameDataUtils.GetChineseContent(tuiSongTongZhi.detail, false), dateTime, NotificationRepeatInterval.Day);
                    }
                }
                else
                {
                    int num2 = 0;
                    for (int j = 0; j < huoDongZhongXin.date.get_Count(); j++)
                    {
                        for (int k = 0; k < huoDongZhongXin.starttime.get_Count(); k++)
                        {
                            DateTime dateTime2       = this.GetDateTime(huoDongZhongXin.date.get_Item(j), huoDongZhongXin.starttime.get_Item(k));
                            int      notificationID2 = this.GetNotificationID(tuiSongTongZhi, num2++);
                            NativeCallManager.NotificationMessage(notificationID2, GameDataUtils.GetChineseContent(tuiSongTongZhi.detail, false), dateTime2, NotificationRepeatInterval.Week);
                        }
                    }
                }
            }
        }
    }
Пример #6
0
    public void NotificationOffline(int seconds)
    {
        int num = 1;

        if (!this.IsLocalPushOn(num))
        {
            return;
        }
        if (!this.IsSystemOn(num))
        {
            return;
        }
        Debug.Log("[离线挂机], seconds = " + seconds);
        TuiSongTongZhi tuiSongTongZhi = DataReader <TuiSongTongZhi> .Get(num);

        if (tuiSongTongZhi != null)
        {
            NativeCallManager.NotificationMessage(tuiSongTongZhi.id, GameDataUtils.GetChineseContent(tuiSongTongZhi.detail, false), DateTime.get_Now().AddSeconds((double)seconds), NotificationRepeatInterval.None);
        }
    }
Пример #7
0
 private int GetNotificationID(TuiSongTongZhi dataTS, int offset)
 {
     return(dataTS.id * 100 + offset);
 }
Пример #8
0
    public bool IsPushOn(int pushId)
    {
        TuiSongTongZhi tuiSongTongZhi = DataReader <TuiSongTongZhi> .Get(pushId);

        return(tuiSongTongZhi != null && tuiSongTongZhi.open == 1);
    }
Пример #9
0
    public bool IsLocalPushOn(int pushId)
    {
        TuiSongTongZhi tuiSongTongZhi = DataReader <TuiSongTongZhi> .Get(pushId);

        return(tuiSongTongZhi != null && tuiSongTongZhi.open == 1 && tuiSongTongZhi.serverPush == 0);
    }