public void GetNoticeData(int type, string scene) { try { INotice service = IApollo.Instance.GetService(5) as INotice; ApolloNoticeInfo info = new ApolloNoticeInfo(); service.GetNoticeData((APOLLO_NOTICETYPE)type, scene, ref info); for (int i = 0; i < info.DataList.Count; i++) { ApolloNoticeData data = info.DataList[i]; } NoticeSys.NOTICE_STATE noticeState = NoticeSys.NOTICE_STATE.LOGIN_Before; if (scene == "1") { noticeState = NoticeSys.NOTICE_STATE.LOGIN_Before; } else if (scene == "2") { noticeState = NoticeSys.NOTICE_STATE.LOGIN_After; } MonoSingleton <NoticeSys> .GetInstance().OnOpenForm(info, noticeState); } catch (Exception exception) { object[] inParameters = new object[] { exception.Message }; DebugHelper.Assert(false, "Error In GetNoticeData, {0}", inParameters); } }
public void GetNoticeData(int type, string scene) { try { INotice notice = IApollo.Instance.GetService(5) as INotice; ApolloNoticeInfo apolloNoticeInfo = new ApolloNoticeInfo(); notice.GetNoticeData((APOLLO_NOTICETYPE)type, scene, ref apolloNoticeInfo); for (int i = 0; i < apolloNoticeInfo.DataList.get_Count(); i++) { ApolloNoticeData apolloNoticeData = apolloNoticeInfo.DataList.get_Item(i); } NoticeSys.NOTICE_STATE noticeState = NoticeSys.NOTICE_STATE.LOGIN_Before; if (scene == "1") { noticeState = NoticeSys.NOTICE_STATE.LOGIN_Before; } else if (scene == "2") { noticeState = NoticeSys.NOTICE_STATE.LOGIN_After; } MonoSingleton <NoticeSys> .GetInstance().OnOpenForm(apolloNoticeInfo, noticeState); } catch (Exception ex) { DebugHelper.Assert(false, "Error In GetNoticeData, {0}", new object[] { ex.get_Message() }); } }
private void ShowNoticeWindow(int idx) { if (this.m_NoticeDataList != null && idx >= 0 && idx < this.m_NoticeDataList.Count) { ApolloNoticeData apolloNoticeData = this.m_NoticeDataList[idx].apolloNoticeData; this.m_NoticeDataList.Remove(this.m_NoticeDataList[idx]); this.ProcessShowNoticeWindown(apolloNoticeData); } }
private void ShowNoticeWindow(int idx) { if (this.m_NoticeDataList != null && idx >= 0 && idx < this.m_NoticeDataList.get_Count()) { ApolloNoticeData apolloNoticeData = this.m_NoticeDataList.get_Item(idx); this.m_NoticeDataList.Remove(apolloNoticeData); this.ProcessShowNoticeWindown(apolloNoticeData); } }
public void OnOpenForm(ApolloNoticeInfo noticeInfo, NoticeSys.NOTICE_STATE noticeState) { this.m_CurState = noticeState; this.m_NoticeDataList = new ListView <NoticeSys.NoticeDataEx>(); this.m_MatchUrlAction.Clear(); ListView <NoticeSys.NoticeDataEx> listView = new ListView <NoticeSys.NoticeDataEx>(); int count = noticeInfo.DataList.get_Count(); for (int i = 0; i < count; i++) { ApolloNoticeData apolloNoticeData = noticeInfo.DataList.get_Item(i); if (apolloNoticeData.MsgType == APOLLO_NOTICETYPE.APO_NOTICETYPE_ALERT) { ListView <UrlAction> listView2 = UrlAction.ParseFromText(apolloNoticeData.ContentUrl, null); if (listView2.Count > 0 && listView2[0].action == UrlAction.Action.openMatchUrl) { this.m_MatchUrlAction.Add(listView2[0]); } else { NoticeSys.NoticeDataEx noticeDataEx = new NoticeSys.NoticeDataEx(); noticeDataEx.apolloNoticeData = apolloNoticeData; if (noticeState == NoticeSys.NOTICE_STATE.LOGIN_After) { if (apolloNoticeData.ContentType == APOLLO_NOTICE_CONTENTTYPE.APO_CONTENTTYPE_WEB && this.IsImageNotice(ref noticeDataEx)) { listView.Add(noticeDataEx); } else { this.m_NoticeDataList.Add(noticeDataEx); } } else { this.m_NoticeDataList.Add(noticeDataEx); } } } } this.InitImageShowTimes(); this.FiterImageNotice(listView); if (this.m_NoticeDataList.Count > 0) { this.ShowNoticeWindow(0); } else if (this.m_CurState == NoticeSys.NOTICE_STATE.LOGIN_After) { this.ShowOtherTips(); } }
public void ShowIOSGuestNotice() { ApolloNoticeInfo apolloNoticeInfo = new ApolloNoticeInfo(); ApolloNoticeData apolloNoticeData = new ApolloNoticeData(); apolloNoticeData.MsgType = APOLLO_NOTICETYPE.APO_NOTICETYPE_ALERT; apolloNoticeData.ContentType = APOLLO_NOTICE_CONTENTTYPE.APO_SCONTENTTYPE_TEXT; apolloNoticeData.MsgTitle = "游客模式特别说明"; apolloNoticeData.MsgContent = "敬爱的玩家,您正在使用游客模式进行游戏,游客模式下的游戏数据(包含付费数据)会在删除游戏、更换设备后清空。为了保障您的虚拟财产安全,以及让您获得更完善的游戏体验,我们建议您使用QQ/微信登录进行游戏!\n\n《王者荣耀》运营团队"; apolloNoticeInfo.DataList.Add(apolloNoticeData); for (int i = 0; i < apolloNoticeInfo.DataList.get_Count(); i++) { ApolloNoticeData apolloNoticeData2 = apolloNoticeInfo.DataList.get_Item(i); } MonoSingleton <NoticeSys> .GetInstance().OnOpenForm(apolloNoticeInfo, NoticeSys.NOTICE_STATE.LOGIN_Before); }
public void ShowIOSGuestNotice() { ApolloNoticeInfo apolloNoticeInfo = new ApolloNoticeInfo(); ApolloNoticeData apolloNoticeData = new ApolloNoticeData(); apolloNoticeData.set_MsgType(0); apolloNoticeData.set_ContentType(0); apolloNoticeData.set_MsgTitle("游客模式特别说明"); apolloNoticeData.set_MsgContent("敬爱的玩家,您正在使用游客模式进行游戏,游客模式下的游戏数据(包含付费数据)会在删除游戏、更换设备后清空。为了保障您的虚拟财产安全,以及让您获得更完善的游戏体验,我们建议您使用QQ/微信登录进行游戏!\n\n《王者荣耀》运营团队"); apolloNoticeInfo.get_DataList().Add(apolloNoticeData); for (int i = 0; i < apolloNoticeInfo.get_DataList().get_Count(); i++) { ApolloNoticeData apolloNoticeData2 = apolloNoticeInfo.get_DataList().get_Item(i); } MonoSingleton <NoticeSys> .GetInstance().OnOpenForm(apolloNoticeInfo, NoticeSys.NOTICE_STATE.LOGIN_Before); }
public void ShowIOSGuestNotice() { ApolloNoticeInfo noticeInfo = new ApolloNoticeInfo(); ApolloNoticeData item = new ApolloNoticeData { MsgType = APOLLO_NOTICETYPE.APO_NOTICETYPE_ALERT, ContentType = APOLLO_NOTICE_CONTENTTYPE.APO_SCONTENTTYPE_TEXT, MsgTitle = "游客模式特别说明", MsgContent = "敬爱的玩家,您正在使用游客模式进行游戏,游客模式下的游戏数据(包含付费数据)会在删除游戏、更换设备后清空。为了保障您的虚拟财产安全,以及让您获得更完善的游戏体验,我们建议您使用QQ/微信登录进行游戏!\n\n《王者荣耀》运营团队" }; noticeInfo.DataList.Add(item); for (int i = 0; i < noticeInfo.DataList.Count; i++) { ApolloNoticeData data2 = noticeInfo.DataList[i]; } MonoSingleton <NoticeSys> .GetInstance().OnOpenForm(noticeInfo, NoticeSys.NOTICE_STATE.LOGIN_Before); }
public List <string> GetNoticeUrl(int type, string scene) { List <string> list = new List <string>(); INotice service = IApollo.Instance.GetService(5) as INotice; ApolloNoticeInfo info = new ApolloNoticeInfo(); service.GetNoticeData((APOLLO_NOTICETYPE)type, scene, ref info); for (int i = 0; i < info.DataList.Count; i++) { ApolloNoticeData data = info.DataList[i]; if (data.ContentType == APOLLO_NOTICE_CONTENTTYPE.APO_CONTENTTYPE_WEB) { list.Add(data.ContentUrl); } } return(list); }
public void ShowIOSGuestNotice() { ApolloNoticeInfo noticeInfo = new ApolloNoticeInfo(); ApolloNoticeData item = new ApolloNoticeData { MsgType = APOLLO_NOTICETYPE.APO_NOTICETYPE_ALERT, ContentType = APOLLO_NOTICE_CONTENTTYPE.APO_SCONTENTTYPE_TEXT, MsgTitle = "游客模式特别说明", MsgContent = "敬爱的玩家,您正在使用游客模式进行游戏,游客模式下的游戏数据(包含付费数据)会在删除游戏、更换设备后清空。为了保障您的虚拟财产安全,以及让您获得更完善的游戏体验,我们建议您使用QQ/微信登录进行游戏!\n\n《王者荣耀》运营团队" }; noticeInfo.DataList.Add(item); for (int i = 0; i < noticeInfo.DataList.Count; i++) { ApolloNoticeData data2 = noticeInfo.DataList[i]; Debug.Log(string.Concat(new object[] { "Guest noticesysy onopenform ", data2.ToString(), "msgtitle = ", data2.MsgTitle, " content ", data2.MsgType, " pic ", data2.MsgUrl, " ", data2.ContentType, " content url = ", data2.ContentUrl })); } MonoSingleton <NoticeSys> .GetInstance().OnOpenForm(noticeInfo, NoticeSys.NOTICE_STATE.LOGIN_Before); }
public void OnOpenForm(ApolloNoticeInfo noticeInfo, NOTICE_STATE noticeState) { this.m_CurState = noticeState; this.m_NoticeDataList = new ListView <ApolloNoticeData>(); int count = noticeInfo.DataList.Count; for (int i = 0; i < count; i++) { ApolloNoticeData item = noticeInfo.DataList[i]; if (item.MsgType == APOLLO_NOTICETYPE.APO_NOTICETYPE_ALERT) { this.m_NoticeDataList.Add(item); } } if (count > 0) { this.ShowNoticeWindow(0); } }
public List <string> GetNoticeUrl(int type, string scene) { List <string> list = new List <string>(); if (Singleton <BattleLogic> .GetInstance().isRuning) { return(list); } INotice notice = IApollo.Instance.GetService(5) as INotice; ApolloNoticeInfo apolloNoticeInfo = new ApolloNoticeInfo(); notice.GetNoticeData((APOLLO_NOTICETYPE)type, scene, ref apolloNoticeInfo); for (int i = 0; i < apolloNoticeInfo.DataList.get_Count(); i++) { ApolloNoticeData apolloNoticeData = apolloNoticeInfo.DataList.get_Item(i); if (apolloNoticeData.ContentType == APOLLO_NOTICE_CONTENTTYPE.APO_CONTENTTYPE_WEB) { list.Add(apolloNoticeData.ContentUrl); } } return(list); }
public List <string> GetNoticeUrl(int type, string scene) { List <string> list = new List <string>(); if (Singleton <BattleLogic> .GetInstance().isRuning) { return(list); } INotice notice = IApollo.get_Instance().GetService(5) as INotice; ApolloNoticeInfo apolloNoticeInfo = new ApolloNoticeInfo(); notice.GetNoticeData(type, scene, ref apolloNoticeInfo); for (int i = 0; i < apolloNoticeInfo.get_DataList().get_Count(); i++) { ApolloNoticeData apolloNoticeData = apolloNoticeInfo.get_DataList().get_Item(i); if (apolloNoticeData.get_ContentType() == 2) { list.Add(apolloNoticeData.get_ContentUrl()); } } return(list); }
public void OnOpenForm(ApolloNoticeInfo noticeInfo, NoticeSys.NOTICE_STATE noticeState) { this.m_CurState = noticeState; this.m_NoticeDataList = new ListView <ApolloNoticeData>(); int count = noticeInfo.get_DataList().get_Count(); for (int i = 0; i < count; i++) { ApolloNoticeData apolloNoticeData = noticeInfo.get_DataList().get_Item(i); if (apolloNoticeData.get_MsgType() == null) { this.m_NoticeDataList.Add(apolloNoticeData); } } if (count > 0) { this.ShowNoticeWindow(0); } else if (this.m_CurState == NoticeSys.NOTICE_STATE.LOGIN_After) { this.ShowOtherTips(); } }
private void ProcessShowNoticeWindown(ApolloNoticeData noticeData) { this.m_bGoto = false; this.m_bLoadImage = false; string msgID = noticeData.MsgID; string openID = noticeData.OpenID; string text = noticeData.MsgUrl; ListView <UrlAction> listView = UrlAction.ParseFromText(noticeData.ContentUrl, null); if (listView.Count > 0) { this.m_urlAction = listView[0]; } else { this.m_urlAction = null; } if (text == null) { text = string.Empty; } APOLLO_NOTICETYPE msgType = noticeData.MsgType; string startTime = noticeData.StartTime; APOLLO_NOTICE_CONTENTTYPE contentType = noticeData.ContentType; string msgTitle = noticeData.MsgTitle; string msgContent = noticeData.MsgContent; NoticeSys.PrintLog(string.Concat(new object[] { " msgID ", noticeData.MsgID, " MsgUrl", text, "msgtitle = ", msgTitle, " content ", msgContent, " openid= ", openID, " MsgType = ", msgType, " contenturl =", noticeData.ContentUrl })); uint num = 0u; if (this.m_CurState == NoticeSys.NOTICE_STATE.LOGIN_After) { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo != null) { num = masterRoleInfo.PvpLevel; } } else { num = 0u; } this.m_btnUrl = string.Empty; this.m_btnDoSth = NoticeSys.BTN_DOSOMTHING.BTN_DOSOMTHING_NONE; if (msgType == APOLLO_NOTICETYPE.APO_NOTICETYPE_ALERT) { bool flag = false; bool flag2 = this.CheckIsBtnUrl(text, ref flag, ref this.m_ImageModleTitle, ref this.m_btnDoSth, ref this.m_btnUrl); if (flag2) { if (flag) { bool flag3 = false; flag2 = this.CheckIsBtnUrl("#" + this.m_btnUrl + "&end", ref flag3, ref this.m_ImageModleTitle, ref this.m_btnDoSth, ref this.m_btnUrl); } if (this.m_btnDoSth == NoticeSys.BTN_DOSOMTHING.BTN_DOSOMTHING_NOTSHOW && this.m_btnUrl != MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID.ToString()) { NoticeSys.PrintLog("noticesys not show " + this.m_btnUrl); return; } NoticeSys.PrintLog("find url " + this.m_btnUrl + " ori = " + text); } else { NoticeSys.PrintLog("find url ori = " + text); } if (this.m_CurState == NoticeSys.NOTICE_STATE.LOGIN_After && num <= 5u) { this.m_btnDoSth = NoticeSys.BTN_DOSOMTHING.BTN_DOSOMTHING_NONE; this.m_btnUrl = string.Empty; } if (this.m_Form == null) { this.m_Form = Singleton <CUIManager> .GetInstance().OpenForm(NoticeSys.s_formNoticeLoginPath, false, true); } Transform transform = this.m_Form.gameObject.transform.Find("Panel/BtnGroup/Button_Complte"); if (this.m_btnUrl != string.Empty && this.m_btnDoSth != NoticeSys.BTN_DOSOMTHING.BTN_DOSOMTHING_NONE) { this.m_bGoto = true; } else { this.m_bGoto = false; } this.m_bShow = true; this.m_TextContent = Utility.GetComponetInChild <Text>(this.m_Form.gameObject, "Panel/ScrollRect/Content/Text"); this.m_ImageContent = Utility.GetComponetInChild <Image>(this.m_Form.gameObject, "Panel/Image"); this.m_ImageDefault = Utility.GetComponetInChild <Image>(this.m_Form.gameObject, "Panel/ImageDefalut"); this.m_Title = Utility.GetComponetInChild <Text>(this.m_Form.gameObject, "Panel/GameObject/Title/ContentTitle"); this.m_TitleBoard = this.m_Form.gameObject.transform.Find("Panel/GameObject/Title").gameObject; this.m_TextContent.gameObject.CustomSetActive(false); this.m_ImageContent.gameObject.CustomSetActive(false); if (this.m_ImageDefault) { this.m_ImageDefault.gameObject.CustomSetActive(false); } this.m_Title.set_text(msgTitle); if (contentType != APOLLO_NOTICE_CONTENTTYPE.APO_CONTENTTYPE_IMAGE) { if (contentType == APOLLO_NOTICE_CONTENTTYPE.APO_SCONTENTTYPE_TEXT) { this.m_TextContent.gameObject.CustomSetActive(true); this.m_TextContent.set_text(msgContent); this.m_TitleBoard.CustomSetActive(true); RectTransform component = this.m_TextContent.transform.parent.gameObject.GetComponent <RectTransform>(); if (component) { component.sizeDelta = new Vector2(0f, this.m_TextContent.get_preferredHeight() + 50f); } } else if (contentType == APOLLO_NOTICE_CONTENTTYPE.APO_CONTENTTYPE_WEB && this.m_urlAction != null) { this.m_bShow = true; this.m_TitleBoard.CustomSetActive(true); this.m_Title.set_text(this.m_ImageModleTitle); if (this.m_ImageDefault) { this.m_ImageDefault.gameObject.CustomSetActive(true); } this.m_ImageContent.gameObject.CustomSetActive(false); base.StartCoroutine(MonoSingleton <IDIPSys> .GetInstance().DownloadImage(this.m_urlAction.target, delegate(Texture2D text2) { if (this.m_bShow && this.m_ImageContent != null) { this.m_ImageContent.gameObject.CustomSetActive(true); if (this.m_ImageDefault) { this.m_ImageDefault.gameObject.CustomSetActive(false); } this.m_bLoadImage = true; this.m_ImageContent.SetSprite(Sprite.Create(text2, new Rect(0f, 0f, (float)text2.width, (float)text2.height), new Vector2(0.5f, 0.5f)), ImageAlphaTexLayout.None); BugLocateLogSys.Log("noticesysy contenturl " + this.m_urlAction.target); } }, 0)); } } } }