Esempio n. 1
0
        public uint Execute(PacketDistributed ipacket)
        {
            GC_LEVELAWARD_DATA packet = (GC_LEVELAWARD_DATA)ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            List <int> alreadyget;

            if (GameManager.gameManager.ActivityRewardGetDic.TryGetValue(ActivityRewardType.Level, out alreadyget))
            {
                alreadyget.Clear();
                alreadyget.AddRange(packet.flagList);
            }
            else
            {
                GameManager.gameManager.ActivityRewardGetDic.Add(ActivityRewardType.Level, new List <int>(packet.flagList));
            }
            if (ActivityRewardsController.Instance() != null)
            {
                ActivityRewardsController.Instance().RefreshAllInfo();
                if (packet.NIndex > -1 && packet.flagList.Count > packet.NIndex && packet.flagList[packet.NIndex] == 1)
                {
                    ActivityRewardsController.Instance().ShowGetItemTip(ActivityRewardType.Level, packet.NIndex);
                }
            }
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
Esempio n. 2
0
        public uint Execute(PacketDistributed ipacket)
        {
            GC_SYNC_NEW7DAYONLINEAWARDTABLE packet = (GC_SYNC_NEW7DAYONLINEAWARDTABLE )ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            GameManager.gameManager.PlayerDataPool.HandlePacket(packet);
            if (ActivityRewardsController.Instance() != null)
            {
                ActivityRewardsController.Instance().CalculateRedPoint();
            }
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
Esempio n. 3
0
    public void HandlePacket(GC_UPDATE_COST_REBATE_INFO packet)
    {
        m_bCostRebateOpen = (packet.Isopen == 1)?true:false;
        m_nStartTime      = packet.Start;
        m_nEndTime        = packet.End;
        m_nCostType       = packet.Costtype;
        if (m_CostRebateDataList == null)
        {
            m_CostRebateDataList = new List <Tab_LevelAwardSimulate>();
        }
        int count = packet.costlimitCount;

        for (int index = 0; index < count; ++index)
        {
            if (m_CostRebateDataList.Count > index)
            {
                if (m_CostRebateDataList[index] != null)
                {
                    m_CostRebateDataList[index].SetInfo(
                        index, (int)ActivityRewardType.Cost, 0, 0, packet.GetCostlimit(index),
                        new int[] { packet.GetId1(index), packet.GetId2(index), packet.GetId3(index) },
                        new int[] { packet.GetNum1(index), packet.GetNum2(index), packet.GetNum3(index), }
                        );
                }
                else
                {
                    Tab_LevelAwardSimulate lap = new Tab_LevelAwardSimulate(
                        index, (int)ActivityRewardType.Cost, 0, 0, packet.GetCostlimit(index),
                        new int[] { packet.GetId1(index), packet.GetId2(index), packet.GetId3(index) },
                        new int[] { packet.GetNum1(index), packet.GetNum2(index), packet.GetNum3(index), }
                        );
                    m_CostRebateDataList[index] = lap;
                }
            }
            else
            {
                Tab_LevelAwardSimulate lap = new Tab_LevelAwardSimulate(
                    index, (int)ActivityRewardType.Cost, 0, 0, packet.GetCostlimit(index),
                    new int[] { packet.GetId1(index), packet.GetId2(index), packet.GetId3(index) },
                    new int[] { packet.GetNum1(index), packet.GetNum2(index), packet.GetNum3(index), }
                    );

                m_CostRebateDataList.Add(lap);
            }
        }
        if (m_CostRebateDataList.Count > count)
        {
            m_CostRebateDataList.RemoveRange(count, m_CostRebateDataList.Count - count);
        }

        /*天龙的返利存储服务器推送数据,先注释掉,为适合Cabal的界面
         *      for (int index = 0; index < packet.costlimitCount; index++)
         *      {
         *          m_nRebateLimit[index] = packet.GetCostlimit(index);
         *      }
         *      for (int index = 0; index < packet.id1Count; index++)
         *      {
         *          m_nRebateId1[index] = packet.GetId1(index);
         *      }
         *      for (int index = 0; index < packet.id2Count; index++)
         *      {
         *          m_nRebateId2[index] = packet.GetId2(index);
         *      }
         *      for (int index = 0; index < packet.id3Count; index++)
         *      {
         *          m_nRebateId3[index] = packet.GetId3(index);
         *      }
         *      for (int index = 0; index < packet.num1Count; index++)
         *      {
         *          m_nRebateNum1[index] = packet.GetNum1(index);
         *      }
         *      for (int index = 0; index < packet.num2Count; index++)
         *      {
         *          m_nRebateNum2[index] = packet.GetNum2(index);
         *      }
         *      for (int index = 0; index < packet.num3Count; index++)
         *      {
         *          m_nRebateNum3[index] = packet.GetNum3(index);
         *      }
         */
//           for (int index = 0; index < packet.flagsCount; index++) {
//             m_bRebateFlag[index] = (packet.GetFlags(index) == 1) ? true : false;
//           }
        List <int> alreadyget;

        if (GameManager.gameManager.ActivityRewardGetDic.TryGetValue(ActivityRewardType.Cost, out alreadyget))
        {
            alreadyget.Clear();
            alreadyget.AddRange(packet.flagsList);
        }
        else
        {
            GameManager.gameManager.ActivityRewardGetDic.Add(ActivityRewardType.Cost, new List <int>(packet.flagsList));
        }
//         if (ChargeActivityLogic.Instance())
//         {
//             ChargeActivityLogic.Instance().UpdateCurTab();
//         }
        if (ActivityRewardsController.Instance() != null)
        {
            ActivityRewardsController.Instance().RefreshCostRebate();
        }
    }