예제 #1
0
 private void OnResponse(object obj)
 {
     if (m_Click && obj is SCTitleActiveResponse)
     {
         m_Click        = false;
         m_currentState = true;
         SCTitleActiveResponse res = (SCTitleActiveResponse)obj;
         if (res.Status == null)
         {
             m_require_img.Visible = true;
             GameEvents.UIEvents.UI_PlayerTitle_Event.OnChoose.SafeInvoke(this, m_curTitle.TitleId);
             Dictionary <UBSParamKeyName, object> _params = new Dictionary <UBSParamKeyName, object>()
             {
                 { UBSParamKeyName.ContentID, m_curTitle.TitleId },
             };
             UserBehaviorStatisticsModules.Instance.LogEvent(UBSEventKeyName.title_use, null, _params);
         }
     }
 }
예제 #2
0
        private void OnRefreshTitle(object msg)
        {
            if (msg is SCTitleGetResponse)
            {
                SCTitleGetResponse res = (SCTitleGetResponse)msg;
                if (res.Status == null)
                {
                    if (res.Title != null)
                    {
                        GlobalInfo.MY_PLAYER_INFO.TitleID = res.Title.TitleId;
                    }
                }
            }
            else if (msg is SCTitleActiveResponse)
            {
                SCTitleActiveResponse res = (SCTitleActiveResponse)msg;

                if (res.Status == null)
                {
                    GlobalInfo.MY_PLAYER_INFO.TitleID = res.Title.TitleId;
                }
            }
            else if (msg is SCTitleResponse)
            {
                if (0L == GlobalInfo.MY_PLAYER_INFO.TitleID)
                {
                    SCTitleResponse res = (SCTitleResponse)msg;
                    if (res.Status == null)
                    {
                        foreach (var title in res.Titles)
                        {
                            if (title.Active)
                            {
                                GlobalInfo.MY_PLAYER_INFO.TitleID = title.TitleId;
                                break;
                            }
                        }
                    }
                }
            }
        }