| | |
| | | {
|
| | | 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);
|
| | | return OperationTimeHepler.Instance.SatisfyOpenCondition(Operation.FlashSale);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | 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))
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (!operation.InTime(TimeUtility.ServerNow))
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("ActiveOutTime");
|