| | |
| | | {
|
| | | OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent;
|
| | | OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent;
|
| | | OperationTimeHepler.Instance.operationAdvanceEvent += OperationAdvanceEvent;
|
| | | TimeMgr.Instance.OnDayEvent += OnDayEvent;
|
| | | OpenServerActivityCenter.Instance.Register(4, this);
|
| | | }
|
| | |
| | | {
|
| | | OperationTimeHepler.Instance.operationStartEvent -= OperationStartEvent;
|
| | | OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent;
|
| | | OperationTimeHepler.Instance.operationAdvanceEvent -= OperationAdvanceEvent;
|
| | | TimeMgr.Instance.OnDayEvent -= OnDayEvent;
|
| | | }
|
| | |
|
| | |
| | | if (type == Operation.FlashSale && state == 0)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate(4);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void OperationAdvanceEvent(Operation type)
|
| | | {
|
| | | if (type == Operation.FlashSale)
|
| | | {
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate(4);
|
| | |
| | | {
|
| | | get
|
| | | {
|
| | | OperationBase operationBase;
|
| | | OperationTimeHepler.Instance.TryGetOperationTime(Operation.FlashSale, out operationBase);
|
| | | return operationBase != null && operationBase.SatisfyOpenCondition() && operationBase.InTime(TimeUtility.ServerNow);
|
| | | }
|
| | | }
|
| | |
|
| | | public bool InAdvanceOpen
|
| | | {
|
| | | get
|
| | | {
|
| | | OperationBase operationBase;
|
| | | OperationTimeHepler.Instance.TryGetOperationTime(Operation.FlashSale, out operationBase);
|
| | | return operationBase != null && operationBase.SatisfyOpenCondition() && operationBase.InAdvanceTime(TimeUtility.ServerNow);
|
| | | return OperationTimeHepler.Instance.SatisfyOpenCondition(Operation.FlashSale);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void SendBuyFlashSale(int index, int id)
|
| | | public bool IsAdvance
|
| | | {
|
| | | get
|
| | | {
|
| | | return OperationTimeHepler.Instance.SatisfyAdvanceCondition(Operation.FlashSale);
|
| | | }
|
| | | }
|
| | |
|
| | | 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))
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("InOperationTimeError");
|
| | | return;
|
| | | }
|
| | | if (!operation.InTime(TimeUtility.ServerNow))
|
| | |
| | | SysNotifyMgr.Instance.ShowTip("ActiveOutTime");
|
| | | return;
|
| | | }
|
| | | var gift = operation.GetFlashSaleGift(index, id);
|
| | | if (!gift.Equals(default(OperationFlashSale.FlashSaleGift)))
|
| | | {
|
| | | var buyInfo = storeModel.GetBuyShopLimit((uint)gift.id);
|
| | |
| | | if (operationBase != null && operationBase.InTime(TimeUtility.ServerNow))
|
| | | {
|
| | | OperationFlashSale operation = operationBase as OperationFlashSale;
|
| | | var index = operation.IndexOfFlashShop();
|
| | | if (index != -1 && index < operation.flashShops.Count)
|
| | | OperationFlashSale.FlashSale flashShop;
|
| | | if (operation.TryGetFlashSale(TimeUtility.ServerNow, out flashShop))
|
| | | {
|
| | | var flashShop = operation.flashShops[index];
|
| | | for (int i = 0; i < flashShop.gifts.Length; i++)
|
| | | {
|
| | | var gift = flashShop.gifts[i];
|