| | |
| | | OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent;
|
| | | OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent;
|
| | | OperationTimeHepler.Instance.operationAdvanceEvent += OperationAdvanceEvent;
|
| | | TimeMgr.Instance.OnDayEvent += OnDayEvent;
|
| | | OpenServerActivityCenter.Instance.Register(4, this);
|
| | | OpenServerActivityCenter.Instance.Register((int)OpenServerActivityCenter.OSActivityType.FlashRushToBuy, this);
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | |
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | if(!WindowCenter.Instance.IsOpen<OpenServerActivityNotifyWin>())
|
| | | {
|
| | | WindowCenter.Instance.Open<OpenServerActivityNotifyWin>();
|
| | | }
|
| | | //UpdateRedpoint();
|
| | | }
|
| | |
|
| | |
| | | OperationTimeHepler.Instance.operationStartEvent -= OperationStartEvent;
|
| | | OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent;
|
| | | OperationTimeHepler.Instance.operationAdvanceEvent -= OperationAdvanceEvent;
|
| | | TimeMgr.Instance.OnDayEvent -= OnDayEvent;
|
| | | }
|
| | |
|
| | | public bool IsOpen
|
| | |
| | | UpdateRedpoint();
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate(4);
|
| | | onStateUpate((int)OpenServerActivityCenter.OSActivityType.FlashRushToBuy);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate(4);
|
| | | onStateUpate((int)OpenServerActivityCenter.OSActivityType.FlashRushToBuy);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | UpdateRedpoint();
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate(4);
|
| | | onStateUpate((int)OpenServerActivityCenter.OSActivityType.FlashRushToBuy);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | if (flashSaleRedpoint.state == RedPointState.Simple)
|
| | | {
|
| | | DayRemind.Instance.SetDayRemind(DayRemind.FLASHSALE_REDPOINT, true);
|
| | | // DayRemind.Instance.SetDayRemind(DayRemind.FLASHSALE_REDPOINT, true);
|
| | | UpdateRedpoint();
|
| | | }
|
| | | }
|
| | |
|
| | | public void SendBuyFlashSale(OperationFlashSale.FlashSaleGift gift)
|
| | | {
|
| | | OperationBase operationBase;
|
| | | if (OperationTimeHepler.Instance.TryGetOperationTime(Operation.FlashSale, out operationBase))
|
| | | {
|
| | | OperationFlashSale operation = operationBase as OperationFlashSale;
|
| | | if (operation.InAdvanceTime(TimeUtility.ServerNow))
|
| | | {
|
| | | var seconds = operation.GetSecondsBeforeStart(TimeUtility.ServerNow);
|
| | | SysNotifyMgr.Instance.ShowTip("FlashSaleAdvanceLimit", TimeUtility.SecondsToHMS(seconds));
|
| | | return;
|
| | | }
|
| | | if (!operation.InTime(TimeUtility.ServerNow))
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("ActiveOutTime");
|
| | | return;
|
| | | }
|
| | | if (!gift.Equals(default(OperationFlashSale.FlashSaleGift)))
|
| | | {
|
| | | var buyInfo = storeModel.GetBuyShopLimit((uint)gift.id);
|
| | | var buyCount = 0;
|
| | | if (buyInfo != null)
|
| | | {
|
| | | buyCount = buyInfo.BuyCnt;
|
| | | }
|
| | | if (buyCount >= gift.limitNum)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (UIHelper.GetMoneyCnt(gift.moneyType) < (ulong)gift.moneyNumber)
|
| | | {
|
| | | switch (gift.moneyType)
|
| | | {
|
| | | case 1:
|
| | | if (VersionConfig.Get().isBanShu)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("GoldErr");
|
| | | return;
|
| | | }
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | break;
|
| | | default:
|
| | | SysNotifyMgr.Instance.ShowTip("LackMoney", gift.moneyType);
|
| | | break;
|
| | | }
|
| | | return;
|
| | | }
|
| | | if (gift.moneyType == 1)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"),
|
| | | Language.Get("OSTimeLimitGiftConfirm", gift.moneyNumber), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | C0803_tagCBuyItemList pak = new C0803_tagCBuyItemList();
|
| | | pak.NPCID = 0;
|
| | | pak.BuyItemIndex = (ushort)gift.id;
|
| | | pak.BuyCount = 1;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | C0803_tagCBuyItemList pak = new C0803_tagCBuyItemList();
|
| | | pak.NPCID = 0;
|
| | | pak.BuyItemIndex = (ushort)gift.id;
|
| | | pak.BuyCount = 1;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("ActiveOutTime");
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public bool HasNotBuyGift()
|
| | | {
|
| | | OperationBase operationBase;
|
| | | OperationTimeHepler.Instance.TryGetOperationTime(Operation.FlashSale, out operationBase);
|
| | | if (operationBase != null && operationBase.InTime(TimeUtility.ServerNow))
|
| | | {
|
| | | OperationFlashSale operation = operationBase as OperationFlashSale;
|
| | | OperationFlashSale.FlashSale flashShop;
|
| | | if (operation.TryGetFlashSale(TimeUtility.ServerNow, out flashShop))
|
| | | {
|
| | | for (int i = 0; i < flashShop.gifts.Length; i++)
|
| | | {
|
| | | var gift = flashShop.gifts[i];
|
| | | var buyInfo = storeModel.GetBuyShopLimit((uint)gift.id);
|
| | | if (buyInfo == null || buyInfo.BuyCnt < gift.limitNum)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public Redpoint flashSaleRedpoint = new Redpoint(MainRedDot.REDPOINT_OPENSERVER, 20904);
|
| | | |
| | | public Redpoint flashSaleRedpoint = new Redpoint(MainRedDot.REDPOINT_OPENSERVER, 20914);
|
| | |
|
| | | public event Action<int> onStateUpate;
|
| | |
|
| | | private void UpdateRedpoint()
|
| | | {
|
| | | flashSaleRedpoint.state = RedPointState.None;
|
| | | if (IsOpen && HasNotBuyGift() && !DayRemind.Instance.GetDayRemind(DayRemind.FLASHSALE_REDPOINT))
|
| | | {
|
| | | flashSaleRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | | }
|
| | |
|
| | | public enum FlashRushToBuySate
|