public static void OnResExchange(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            if (msg.stPkgData.stWealExchangeRes.dwWealID != 0u)
            {
                ListView <CUseable> useableListFromItemList = CUseableManager.GetUseableListFromItemList(msg.stPkgData.stWealExchangeRes.stExchangeRes);
                if (useableListFromItemList.Count > 0)
                {
                    CUseableManager.ShowUseableItem(useableListFromItemList[0]);
                }
                if (msg.stPkgData.stWealExchangeRes.bWealType == 4)
                {
                    ExchangeActivity exchangeActivity = (ExchangeActivity)Singleton <ActivitySys> .GetInstance().GetActivity(COM_WEAL_TYPE.COM_WEAL_EXCHANGE, msg.stPkgData.stWealExchangeRes.dwWealID);

                    if (exchangeActivity != null)
                    {
                        exchangeActivity.IncreaseExchangeCount((int)msg.stPkgData.stWealExchangeRes.bWealIdx, msg.stPkgData.stWealExchangeRes.dwDrawCnt);
                        exchangeActivity.UpdateView();
                    }
                }
                else if (msg.stPkgData.stWealExchangeRes.bWealType == 5)
                {
                    PointsExchangeActivity pointsExchangeActivity = (PointsExchangeActivity)Singleton <ActivitySys> .GetInstance().GetActivity(COM_WEAL_TYPE.COM_WEAL_PTEXCHANGE, msg.stPkgData.stWealExchangeRes.dwWealID);

                    if (pointsExchangeActivity != null)
                    {
                        pointsExchangeActivity.IncreaseExchangeCount((int)msg.stPkgData.stWealExchangeRes.bWealIdx, msg.stPkgData.stWealExchangeRes.dwDrawCnt);
                        pointsExchangeActivity.UpdateView();
                    }
                }
                return;
            }
        }
Esempio n. 2
0
        public static void OnResExchange(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            if ((msg.stPkgData.stWealExchangeRes.dwWealID != 0) && (msg.stPkgData.stWealExchangeRes.bWealIdx != 0))
            {
                ListView <CUseable> useableListFromItemList = CUseableManager.GetUseableListFromItemList(msg.stPkgData.stWealExchangeRes.stExchangeRes);
                if (useableListFromItemList.Count > 0)
                {
                    CUseableManager.ShowUseableItem(useableListFromItemList[0]);
                }
                ExchangeActivity activity = (ExchangeActivity)Singleton <ActivitySys> .GetInstance().GetActivity(COM_WEAL_TYPE.COM_WEAL_EXCHANGE, msg.stPkgData.stWealExchangeRes.dwWealID);

                if (activity != null)
                {
                    activity.IncreaseExchangeCount(msg.stPkgData.stWealExchangeRes.bWealIdx);
                    activity.UpdateView();
                }
            }
        }