Exemple #1
0
        public override void OnShow(object param)
        {
            base.OnShow(param);

            if (null != param)
            {
                EventGamePlayData datas = (EventGamePlayData)param;

                m_event_id   = datas.EventID;
                m_phase_data = datas.Msg;
            }

            MessageHandler.RegisterMessageHandler(MessageDefine.SCEventRewardResponse, OnScResponse);

            m_view.Refresh(m_phase_data);
        }
Exemple #2
0
        public override void OnScResponse(object s)
        {
            base.OnScResponse(s);



            if (s is SCEventPhaseFeedbackResponse)
            {
                var rsp = s as SCEventPhaseFeedbackResponse;

                if (!MsgStatusCodeUtil.OnError(rsp.ResponseStatus))
                {
                    EventGamePlayData data = new EventGamePlayData()
                    {
                        EventID = m_event_id,
                        Msg     = rsp,
                    };

                    FrameMgr.OpenUIParams open_data = new FrameMgr.OpenUIParams(UIDefine.UI_EVENT_INGAME_PLAY);
                    open_data.Param = data;

                    EngineCoreEvents.UIEvent.ShowUIEventWithParam.SafeInvoke(open_data);

                    this.CloseFrame();
                }
            }
            else if (s is SCEventEnterResponse)
            {
                var rsp = s as SCEventEnterResponse;

                if (!MsgStatusCodeUtil.OnError(rsp.Result))
                {
                    RequestStartPhase();

                    {
                        Dictionary <UBSParamKeyName, object> _params = new Dictionary <UBSParamKeyName, object>()
                        {
                            { UBSParamKeyName.Success, 1 },
                            { UBSParamKeyName.ContentID, m_event_id }
                        };
                        UserBehaviorStatisticsModules.Instance.LogEvent(UBSEventKeyName.event_begin, null, _params);
                    }
                }
                else
                {
                    if (MsgStatusCodeUtil.VIT_OUT == rsp.Result)
                    {
                        Dictionary <UBSParamKeyName, object> _params = new Dictionary <UBSParamKeyName, object>()
                        {
                            { UBSParamKeyName.Success, 0 },
                            { UBSParamKeyName.Description, UBSDescription.NOT_ENOUGH_VIT },
                            { UBSParamKeyName.ContentID, m_event_id }
                        };
                        UserBehaviorStatisticsModules.Instance.LogEvent(UBSEventKeyName.event_begin, null, _params);
                    }
                    else
                    {
                        Dictionary <UBSParamKeyName, object> _params = new Dictionary <UBSParamKeyName, object>()
                        {
                            { UBSParamKeyName.Success, 0 },
                            { UBSParamKeyName.Description, rsp.Result },
                            { UBSParamKeyName.ContentID, m_event_id }
                        };
                        UserBehaviorStatisticsModules.Instance.LogEvent(UBSEventKeyName.event_begin, null, _params);
                    }
                }
            }
        }