少年修仙传客户端代码仓库
client_linchunjie
2019-01-28 a93aef5d2dc2b67af997548e84ae22c6b9a29c72
6086 【前端】【1.5.200】春节红包雨活动
18个文件已添加
5个文件已修改
744 ■■■■■ 已修改文件
Core/GameEngine/DataToCtl/PackageRegedit.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/FestivalRedpackTaskConfig.cs 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/FestivalRedpackTaskConfig.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/ConfigManager.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HAB_Activity/DTCAB25_tagMCFeastRedPackInfo.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HAB_Activity/DTCAB25_tagMCFeastRedPackInfo.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HAB_Activity/DTCAB26_tagMCFeastRedPackTaskInfo.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HAB_Activity/DTCAB26_tagMCFeastRedPackTaskInfo.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HAC_Activity/DTCAC11_tagGCFeastRedPacketInfo.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HAC_Activity/DTCAC11_tagGCFeastRedPacketInfo.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ServerPack/HAB_Activity/HAB25_tagMCFeastRedPackInfo.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ServerPack/HAB_Activity/HAB25_tagMCFeastRedPackInfo.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ServerPack/HAB_Activity/HAB26_tagMCFeastRedPackTaskInfo.cs 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ServerPack/HAB_Activity/HAB26_tagMCFeastRedPackTaskInfo.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ServerPack/HAC_Activity/HAC11_tagGCFeastRedPacketInfo.cs 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ServerPack/HAC_Activity/HAC11_tagGCFeastRedPacketInfo.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/OpenServerActivity/FestivalRedpackModel.cs 323 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/OpenServerActivity/FestivalRedpackModel.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/OpenServerActivity/ImpactRankModel.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/OpenServerActivity/OperationFestivalRedpack.cs 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/OpenServerActivity/OperationFestivalRedpack.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Welfare/OperationTimeHepler.cs 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/WindowBase/ModelCenter.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/DataToCtl/PackageRegedit.cs
@@ -25,6 +25,9 @@
    public static void Init()
    {
        // 登记相应的数据体及对应的数据转逻辑类
        Register(typeof(HAC11_tagGCFeastRedPacketInfo), typeof(DTCAC11_tagGCFeastRedPacketInfo));
        Register(typeof(HAB26_tagMCFeastRedPackTaskInfo), typeof(DTCAB26_tagMCFeastRedPackTaskInfo));
        Register(typeof(HAB25_tagMCFeastRedPackInfo), typeof(DTCAB25_tagMCFeastRedPackInfo));
        Register(typeof(HB213_tagMCZhuXianTowerInfo), typeof(DTCB213_tagMCZhuXianTowerInfo));
        Register(typeof(HB413_tagMCPlayerSkills), typeof(DTCB413_tagMCPlayerSkills));
        Register(typeof(HB212_tagMCZhuXianBossCnt), typeof(DTCB212_tagMCZhuXianBossCnt));
Core/GameEngine/Model/Config/FestivalRedpackTaskConfig.cs
New file
@@ -0,0 +1,53 @@
//--------------------------------------------------------
//    [Author]:            第二世界
//    [  Date ]:           Monday, January 28, 2019
//--------------------------------------------------------
using UnityEngine;
using System;
namespace TableConfig {
    public partial class FestivalRedpackTaskConfig : ConfigBase {
        public int ID { get ; private set ; }
        public int FeastDay { get ; private set ; }
        public int FeastTaskType { get ; private set ; }
        public int FeastTaskData { get ; private set ; }
        public int TotalTimes { get ; private set ; }
        public string TaskDes { get ; private set; }
        public override string getKey()
        {
            return ID.ToString();
        }
        public override void Parse() {
            try
            {
                ID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0;
                FeastDay=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0;
                FeastTaskType=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0;
                FeastTaskData=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0;
                TotalTimes=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0;
                TaskDes = rawContents[5].Trim();
            }
            catch (Exception ex)
            {
                DebugEx.Log(ex);
            }
        }
    }
}
Core/GameEngine/Model/Config/FestivalRedpackTaskConfig.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 92740fe211606b3409ddae7876e3b8d0
timeCreated: 1548643881
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Core/GameEngine/Model/ConfigManager.cs
@@ -229,6 +229,7 @@
        AddAsyncTask<JadeDynastyBossConfig>();
        AddAsyncTask<JadeDynastySuitAttrConfig>();
        AddAsyncTask<SkillFrameAnimationConfig>();
        AddAsyncTask<FestivalRedpackTaskConfig>();
        while (!AllCompleted())
        {
Core/NetworkPackage/DTCFile/ServerPack/HAB_Activity/DTCAB25_tagMCFeastRedPackInfo.cs
New file
@@ -0,0 +1,23 @@
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Monday, January 28, 2019
//--------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
public class DTCAB25_tagMCFeastRedPackInfo : DtcBasic {
    public override void Done(GameNetPackBasic vNetPack)
    {
        base.Done(vNetPack);
        var package = vNetPack as HAB25_tagMCFeastRedPackInfo;
    }
}
Core/NetworkPackage/DTCFile/ServerPack/HAB_Activity/DTCAB25_tagMCFeastRedPackInfo.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 8a8161558821fa44ead97942ca9a2dc7
timeCreated: 1548641823
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Core/NetworkPackage/DTCFile/ServerPack/HAB_Activity/DTCAB26_tagMCFeastRedPackTaskInfo.cs
New file
@@ -0,0 +1,23 @@
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Monday, January 28, 2019
//--------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
public class DTCAB26_tagMCFeastRedPackTaskInfo : DtcBasic {
    public override void Done(GameNetPackBasic vNetPack)
    {
        base.Done(vNetPack);
        var package = vNetPack as HAB26_tagMCFeastRedPackTaskInfo;
    }
}
Core/NetworkPackage/DTCFile/ServerPack/HAB_Activity/DTCAB26_tagMCFeastRedPackTaskInfo.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: e259d05221c3fec4c95639b270f62ce0
timeCreated: 1548641851
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Core/NetworkPackage/DTCFile/ServerPack/HAC_Activity/DTCAC11_tagGCFeastRedPacketInfo.cs
New file
@@ -0,0 +1,24 @@
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Monday, January 28, 2019
//--------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
using Snxxz.UI;
public class DTCAC11_tagGCFeastRedPacketInfo : DtcBasic
{
    public override void Done(GameNetPackBasic vNetPack)
    {
        base.Done(vNetPack);
        var package = vNetPack as HAC11_tagGCFeastRedPacketInfo;
        OperationTimeHepler.Instance.OnReceivePackage(package);
    }
}
Core/NetworkPackage/DTCFile/ServerPack/HAC_Activity/DTCAC11_tagGCFeastRedPacketInfo.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 0ad2ac4202da59149988cbde2efc7dc7
timeCreated: 1548641874
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Core/NetworkPackage/ServerPack/HAB_Activity/HAB25_tagMCFeastRedPackInfo.cs
New file
@@ -0,0 +1,19 @@
using UnityEngine;
using System.Collections;
// AB 25 节日红包信息 #tagMCFeastRedPackInfo
public class HAB25_tagMCFeastRedPackInfo : GameNetPackBasic {
    public uint MoneyNum;    // 累积抢到多少钱
    public ushort GrabCnt;    // 已抢红包次数
    public HAB25_tagMCFeastRedPackInfo () {
        _cmd = (ushort)0xAB25;
    }
    public override void ReadFromBytes (byte[] vBytes) {
        TransBytes (out MoneyNum, vBytes, NetDataType.DWORD);
        TransBytes (out GrabCnt, vBytes, NetDataType.WORD);
    }
}
Core/NetworkPackage/ServerPack/HAB_Activity/HAB25_tagMCFeastRedPackInfo.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: e53a78a22b72ada4fa8be92a6c40e351
timeCreated: 1548641790
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Core/NetworkPackage/ServerPack/HAB_Activity/HAB26_tagMCFeastRedPackTaskInfo.cs
New file
@@ -0,0 +1,33 @@
using UnityEngine;
using System.Collections;
// AB 26 节日红包任务进度信息 #tagMCFeastRedPackTaskInfo
public class HAB26_tagMCFeastRedPackTaskInfo : GameNetPackBasic {
    public byte FeastDay;    //节日第几天
    public byte TaskCount;    //今日任务数
    public  tagMCFeastRedPackTaskProgress[] TaskProgressList;    // 任务进度信息列表
    public HAB26_tagMCFeastRedPackTaskInfo () {
        _cmd = (ushort)0xAB26;
    }
    public override void ReadFromBytes (byte[] vBytes) {
        TransBytes (out FeastDay, vBytes, NetDataType.BYTE);
        TransBytes (out TaskCount, vBytes, NetDataType.BYTE);
        TaskProgressList = new tagMCFeastRedPackTaskProgress[TaskCount];
        for (int i = 0; i < TaskCount; i ++) {
            TaskProgressList[i] = new tagMCFeastRedPackTaskProgress();
            TransBytes (out TaskProgressList[i].TaskType, vBytes, NetDataType.BYTE);
            TransBytes (out TaskProgressList[i].TaskData, vBytes, NetDataType.DWORD);
            TransBytes (out TaskProgressList[i].CurTimes, vBytes, NetDataType.WORD);
        }
    }
    public struct tagMCFeastRedPackTaskProgress {
        public byte TaskType;        //任务类型
        public uint TaskData;        //任务数据
        public ushort CurTimes;        //当前完成次数
    }
}
Core/NetworkPackage/ServerPack/HAB_Activity/HAB26_tagMCFeastRedPackTaskInfo.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: a26926707d881ff4f81da047ebd4b88e
timeCreated: 1548641790
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Core/NetworkPackage/ServerPack/HAC_Activity/HAC11_tagGCFeastRedPacketInfo.cs
New file
@@ -0,0 +1,37 @@
using UnityEngine;
using System.Collections;
// AC 11 节日红包活动信息 #tagGCFeastRedPacketInfo
public class HAC11_tagGCFeastRedPacketInfo : GameNetPackBasic {
    public string StartDate;    // 开始日期 y-m-d
    public string EndtDate;    // 结束日期 y-m-d
    public ushort LimitLV;    // 限制等级
    public byte ResetType;    // 重置类型 0-0点重置 1-5点重置
    public byte RedPacketDays;
    public  tagGCFeastRedPacketDay[] RedPacketDayList;    // 每日系统红包信息
    public HAC11_tagGCFeastRedPacketInfo () {
        _cmd = (ushort)0xAC11;
    }
    public override void ReadFromBytes (byte[] vBytes) {
        TransBytes (out StartDate, vBytes, NetDataType.Chars, 10);
        TransBytes (out EndtDate, vBytes, NetDataType.Chars, 10);
        TransBytes (out LimitLV, vBytes, NetDataType.WORD);
        TransBytes (out ResetType, vBytes, NetDataType.BYTE);
        TransBytes (out RedPacketDays, vBytes, NetDataType.BYTE);
        RedPacketDayList = new tagGCFeastRedPacketDay[RedPacketDays];
        for (int i = 0; i < RedPacketDays; i ++) {
            RedPacketDayList[i] = new tagGCFeastRedPacketDay();
            TransBytes (out RedPacketDayList[i].RedPacketCount, vBytes, NetDataType.BYTE);
            TransBytes (out RedPacketDayList[i].RedPacketIDList, vBytes, NetDataType.WORD, RedPacketDayList[i].RedPacketCount);
        }
    }
    public struct tagGCFeastRedPacketDay {
        public byte RedPacketCount;
        public  ushort[] RedPacketIDList;        // 当日定时发放的系统红包ID列表
    }
}
Core/NetworkPackage/ServerPack/HAC_Activity/HAC11_tagGCFeastRedPacketInfo.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 8c00d46a90916404296a10f530a9518f
timeCreated: 1548641772
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/OpenServerActivity/FestivalRedpackModel.cs
New file
@@ -0,0 +1,323 @@
using System;
using System.Collections;
using System.Collections.Generic;
using TableConfig;
using UnityEngine;
namespace Snxxz.UI
{
    public class FestivalRedpackModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk, IOpenServerActivity
    {
        Dictionary<int, List<FestivalRedpackTask>> taskDict = new Dictionary<int, List<FestivalRedpackTask>>();
        Dictionary<int, List<FestivalRedpackTaskProgress>> taskProgressDict = new Dictionary<int, List<FestivalRedpackTaskProgress>>();
        List<int> taskRedpacks = new List<int>();
        public bool IsOpen
        {
            get
            {
                return OperationTimeHepler.Instance.SatisfyOpenCondition(Operation.FestivalRedpack);
            }
        }
        public bool IsAdvance { get { return false; } }
        public bool priorityOpen { get { return redpoint.state == RedPointState.Simple; } }
        public int festivalDay
        {
            get
            {
                OperationFestivalRedpack operation;
                if (OperationTimeHepler.Instance.TryGetOperation(Operation.FestivalRedpack, out operation))
                {
                    return operation.GetCurrentDay();
                }
                return 0;
            }
        }
        public int grabRedpackTimes { get; private set; }
        public int grabRedpackLimitTimes { get; private set; }
        public int grabTotalJade { get; private set; }
        public const int FESTIVALTASKREDPACKTYPE = 33;
        const int REDPOINTID = 20919;
        public readonly Redpoint redpoint = new Redpoint(MainRedDot.REDPOINT_OPENSERVER, REDPOINTID);
        public readonly Redpoint systemRedpoint = new Redpoint(REDPOINTID, 2091901);
        public readonly Redpoint taskRedpoint = new Redpoint(REDPOINTID, 2091902);
        public readonly Redpoint receiveRedpoint = new Redpoint(REDPOINTID, 2091903);
        public event Action<int> onStateUpate;
        public event Action redpackGrabRefresh;
        RedEnvelopeModel envelopeModel { get { return ModelCenter.Instance.GetModel<RedEnvelopeModel>(); } }
        public override void Init()
        {
            OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent;
            OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent;
            OperationTimeHepler.Instance.dayResetEvent += DayResetEvent;
            envelopeModel.EnvelopeUpdateEvent += EnvelopeUpdateEvent;
            envelopeModel.EnvelopeDelEvent += EnvelopeDelEvent;
            envelopeModel.EnvelopeGetEvent += EnvelopeGetEvent;
            ParseConfig();
            OpenServerActivityCenter.Instance.Register((int)OpenServerActivityCenter.OSActivityType.FestivalRedpack, this);
        }
        public void OnBeforePlayerDataInitialize()
        {
            taskProgressDict.Clear();
            grabRedpackTimes = 0;
            grabTotalJade = 0;
        }
        public void OnPlayerLoginOk()
        {
            UpdateRedpoint();
        }
        public override void UnInit()
        {
            OperationTimeHepler.Instance.operationStartEvent -= OperationStartEvent;
            OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent;
            OperationTimeHepler.Instance.dayResetEvent -= DayResetEvent;
            envelopeModel.EnvelopeUpdateEvent -= EnvelopeUpdateEvent;
            envelopeModel.EnvelopeDelEvent -= EnvelopeDelEvent;
            envelopeModel.EnvelopeGetEvent -= EnvelopeGetEvent;
        }
        void ParseConfig()
        {
            var configs = Config.Instance.GetAllValues<FestivalRedpackTaskConfig>();
            foreach (var config in configs)
            {
                List<FestivalRedpackTask> list;
                if (!taskDict.TryGetValue(config.FeastDay, out list))
                {
                    list = new List<FestivalRedpackTask>();
                    taskDict.Add(config.FeastDay, list);
                }
                list.Add(new FestivalRedpackTask()
                {
                    day = config.FeastDay,
                    description = config.TaskDes,
                    helpData = config.FeastTaskData,
                    type = config.FeastTaskType,
                    totalTimes = config.TotalTimes,
                });
            }
        }
        public FestivalRedpackTaskState GetTaskState(FestivalRedpackTask task)
        {
            FestivalRedpackTaskProgress progress;
            if (TryGetTaskProgress(task.day, task.type, task.helpData, out progress))
            {
                if (progress.completed)
                {
                    return FestivalRedpackTaskState.Completed;
                }
                else if (progress.times >= task.totalTimes)
                {
                    return FestivalRedpackTaskState.ReceiveReward;
                }
            }
            return FestivalRedpackTaskState.Doing;
        }
        public bool TryGetTasks(int dayIndex, out List<FestivalRedpackTask> list)
        {
            return taskDict.TryGetValue(dayIndex, out list);
        }
        public bool TryGetTaskProgress(int dayIndex, int type, int helpData, out FestivalRedpackTaskProgress progress)
        {
            progress = default(FestivalRedpackTaskProgress);
            if (taskProgressDict.ContainsKey(dayIndex))
            {
                var list = taskProgressDict[dayIndex];
                var index = list.FindIndex((x) =>
                {
                    return x.helpData == helpData && x.type == type;
                });
                if (index != -1)
                {
                    progress = list[index];
                }
                return index != -1;
            }
            return false;
        }
        public void OnReceivePackage(HAB26_tagMCFeastRedPackTaskInfo package)
        {
            List<FestivalRedpackTaskProgress> list;
            if (!taskProgressDict.TryGetValue(package.FeastDay, out list))
            {
                list = new List<FestivalRedpackTaskProgress>();
                taskProgressDict.Add(package.FeastDay, list);
            }
            list.Clear();
            for (int i = 0; i < package.TaskCount; i++)
            {
                var data = package.TaskProgressList[i];
                list.Add(new FestivalRedpackTaskProgress()
                {
                    type = data.TaskType,
                    times = data.CurTimes,
                    helpData = (int)data.TaskData,
                    completed = false,
                });
            }
            UpdateRedpoint();
        }
        public void OnReceivePackage(HAB25_tagMCFeastRedPackInfo package)
        {
            grabRedpackTimes = package.GrabCnt;
            grabTotalJade = (int)package.MoneyNum;
            if (redpackGrabRefresh != null)
            {
                redpackGrabRefresh();
            }
            UpdateRedpoint();
        }
        private void DayResetEvent(int resetType)
        {
            OperationBase operationBase;
            if (OperationTimeHepler.Instance.TryGetOperationTime(Operation.FestivalRedpack, out operationBase))
            {
                if (resetType == operationBase.resetType)
                {
                    UpdateRedpoint();
                }
            }
        }
        private void OperationEndEvent(Operation type, int state)
        {
            if (type == Operation.FestivalRedpack && state == 0)
            {
                UpdateRedpoint();
                if (onStateUpate != null)
                {
                    onStateUpate(19);
                }
            }
        }
        private void OperationStartEvent(Operation type, int state)
        {
            if (type == Operation.FestivalRedpack && state == 0)
            {
                UpdateRedpoint();
                if (onStateUpate != null)
                {
                    onStateUpate(19);
                }
            }
        }
        private void EnvelopeUpdateEvent()
        {
            UpdateRedpoint();
        }
        private void EnvelopeDelEvent()
        {
            UpdateRedpoint();
        }
        private void EnvelopeGetEvent(int id)
        {
        }
        private void UpdateRedpoint()
        {
            var existSystemRedpack = false;
            var existFinishTask = false;
            var existUnGetRedpack = false;
            if (IsOpen)
            {
                OperationFestivalRedpack operation;
                if (OperationTimeHepler.Instance.TryGetOperation(Operation.FestivalRedpack, out operation))
                {
                }
                List<FestivalRedpackTask> list;
                if (TryGetTasks(festivalDay, out list))
                {
                    foreach (var task in list)
                    {
                        if (GetTaskState(task) == FestivalRedpackTaskState.ReceiveReward)
                        {
                            existFinishTask = true;
                            break;
                        }
                    }
                }
                envelopeModel.GetEnvelopes(FESTIVALTASKREDPACKTYPE, ref taskRedpacks);
                foreach (var id in taskRedpacks)
                {
                    RedEnvelopeModel.RedEnvelope envelope;
                    if (envelopeModel.TryGetEnvelope(id, out envelope))
                    {
                        if (envelope.player == PlayerDatas.Instance.baseData.PlayerID)
                        {
                            if (envelope.state == 1)
                            {
                                existUnGetRedpack = true;
                                break;
                            }
                        }
                        else
                        {
                            if (envelope.state == 1 && grabRedpackTimes < grabRedpackLimitTimes)
                            {
                                existUnGetRedpack = true;
                                break;
                            }
                        }
                    }
                }
            }
            systemRedpoint.state = existSystemRedpack ? RedPointState.Simple : RedPointState.None;
            taskRedpoint.state = existFinishTask ? RedPointState.Simple : RedPointState.None;
            receiveRedpoint.state = existUnGetRedpack ? RedPointState.Simple : RedPointState.None;
        }
    }
    public struct FestivalRedpackTask
    {
        public int day;
        public int type;
        public int helpData;
        public int totalTimes;
        public string description;
    }
    public struct FestivalRedpackTaskProgress
    {
        public int type;
        public int helpData;
        public int times;
        public bool completed;
    }
    public enum FestivalRedpackTaskState
    {
        Doing,
        ReceiveReward,
        Completed,
    }
}
System/OpenServerActivity/FestivalRedpackModel.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 3564260b19e1b15439c6bf3a87493758
timeCreated: 1548640776
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/OpenServerActivity/ImpactRankModel.cs
@@ -829,6 +829,8 @@
            AccumulateRecharge,
            [Header("神秘限购")]
            MysticalPurchase,
            [Header("节日红包")]
            FestivalRedpack,
        }
    }
System/OpenServerActivity/OperationFestivalRedpack.cs
New file
@@ -0,0 +1,48 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Snxxz.UI
{
    public class OperationFestivalRedpack : OperationBase
    {
        List<RedpackInfo> m_Redpacks = new List<RedpackInfo>();
        public List<RedpackInfo> redpacks
        {
            get { return m_Redpacks; }
        }
        public void ParsePackage(HAC11_tagGCFeastRedPacketInfo package)
        {
            m_Redpacks.Clear();
            if (package.RedPacketDays > 0)
            {
                foreach (var info in package.RedPacketDayList)
                {
                    var redpack = new RedpackInfo();
                    for (int i = 0; i < info.RedPacketCount; i++)
                    {
                        redpack.redpacks.Add(info.RedPacketIDList[i]);
                    }
                    m_Redpacks.Add(redpack);
                }
            }
        }
        public int GetCurrentDay()
        {
            return IndexOfTime(TimeUtility.ServerNow);
        }
        public override void Reset()
        {
            base.Reset();
            m_Redpacks.Clear();
        }
        public class RedpackInfo
        {
            public List<int> redpacks = new List<int>();
        }
    }
}
System/OpenServerActivity/OperationFestivalRedpack.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: e542026af09c3c54c87038419f31ba4e
timeCreated: 1548642026
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/Welfare/OperationTimeHepler.cs
@@ -458,6 +458,40 @@
            }
        }
        /// <summary>
        /// 节日红包
        /// </summary>
        /// <param name="package"></param>
        public void OnReceivePackage(HAC11_tagGCFeastRedPacketInfo package)
        {
            OperationBase operationBase = null;
            operationDict.TryGetValue(Operation.FestivalRedpack, out operationBase);
            if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
            {
                ForceStopOperation(Operation.FestivalRedpack);
            }
            else
            {
                if (operationBase == null)
                {
                    operationBase = new OperationFestivalRedpack();
                    operationDict.Add(Operation.FestivalRedpack, operationBase);
                }
                OperationFestivalRedpack operation = operationBase as OperationFestivalRedpack;
                operation.Reset();
                operation.limitLv = package.LimitLV;
                operation.startDate = ParseOperationDate(package.StartDate);
                operation.endDate = ParseOperationDate(package.EndtDate);
                operation.dayReset = true;
                operation.resetType = package.ResetType;
                operation.ParsePackage(package);
                if (operationTimeUpdateEvent != null)
                {
                    operationTimeUpdateEvent(Operation.FestivalRedpack);
                }
            }
        }
        void ForceStopOperation(Operation operationType)
        {
            if (operationDict.ContainsKey(operationType))
@@ -478,6 +512,17 @@
        public bool TryGetOperationTime(Operation type, out OperationBase operation)
        {
            return operationDict.TryGetValue(type, out operation);
        }
        public bool TryGetOperation<T>(Operation type, out T operation) where T : OperationBase
        {
            operation = null;
            if (operationDict.ContainsKey(type))
            {
                operation = operationDict[type] as T;
                return operation is T;
            }
            return false;
        }
        public bool InOperationTime(Operation type)
@@ -760,6 +805,7 @@
        FlashRushToBuy, //限时抢购
        WishingWellInfo, //许愿池
        AccumulateRecharge,//累计充值
        FestivalRedpack,//节日红包
        max,
    }
}
System/WindowBase/ModelCenter.cs
@@ -225,6 +225,7 @@
            RegisterModel<JadeDynastyDecomposeModel>();
            RegisterModel<JadeDynastyTowerModel>();
            RegisterModel<JadeDynastyEquipModel>();
            RegisterModel<FestivalRedpackModel>();
            inited = true;
        }