private bool HandleGetUserSystemMail(NetCmdBase obj) { LC_Cmd_GetSystemMail ncb = (LC_Cmd_GetSystemMail)obj; if (SystemMailMap.ContainsKey(ncb.MailInfo.MailID)) { SystemMailMap.Remove(ncb.MailInfo.MailID); } SystemMailMap.Add(ncb.MailInfo.MailID, ncb.MailInfo); for (byte i = 0; i < SystemMailTitleList.Count; ++i) { if (SystemMailTitleList[i].MailID == ncb.MailInfo.MailID) { SystemMailTitleList[i].bIsRead = true; //FriendSysManager.Instance.UpdateEmailReadState(ncb.MailInfo.MailID); } } //CheckMailStates(); tagMailTitleChangeEvent pEvent = new tagMailTitleChangeEvent(); MsgEventHandle.HandleMsg(pEvent); tagMailContextAddEvent pContextEvent = new tagMailContextAddEvent(ncb.MailInfo.MailID); MsgEventHandle.HandleMsg(pContextEvent); //FriendSysManager.Instance.ReciveReadEmailMsg((byte)EmailType.Sys_Email, ncb.MailInfo.MailID, true); tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Mail_GetSystemContext_Sucess); MsgEventHandle.HandleMsg(pUOM); return(true); }
//供外部使用的函数 邮件方面的 public void UpdateByNewDay() { if (NormalMailTitleList.Count == 0 && SystemMailTitleList.Count == 0) { return; } for (int i = 0; i < NormalMailTitleList.Count; ++i) { NormalMailTitleList[i].bDiffTime = Convert.ToByte((NormalMailTitleList[i].bDiffTime + 1 >= 250) ? 250 : (NormalMailTitleList[i].bDiffTime + 1)); } for (int i = 0; i < NormalMailMap.Count; ++i) { NormalMailMap.Values.ElementAt <tagNormalMail>(i).bDiffTime = Convert.ToByte((NormalMailMap.Values.ElementAt <tagNormalMail>(i).bDiffTime + 1 >= 250) ? 250 : (NormalMailMap.Values.ElementAt <tagNormalMail>(i).bDiffTime + 1)); } for (int i = 0; i < SystemMailTitleList.Count; ++i) { SystemMailTitleList[i].bDiffTime = Convert.ToByte((SystemMailTitleList[i].bDiffTime + 1 >= 250) ? 250 : (SystemMailTitleList[i].bDiffTime + 1)); } for (int i = 0; i < SystemMailMap.Count; ++i) { SystemMailMap.Values.ElementAt <tagSystemMail>(i).bDiffTime = Convert.ToByte((SystemMailMap.Values.ElementAt <tagSystemMail>(i).bDiffTime + 1 >= 250) ? 250 : (SystemMailMap.Values.ElementAt <tagSystemMail>(i).bDiffTime + 1)); } tagMailTitleChangeEvent pEvent = new tagMailTitleChangeEvent();//邮件发送天数的变化 MsgEventHandle.HandleMsg(pEvent); }
public void ResetInfo() { OnClear(); //邮件栏全部物品 tagMailTitleChangeEvent pEvent = new tagMailTitleChangeEvent(); MsgEventHandle.HandleMsg(pEvent); tagMailAllContextChangeEvent pEvent2 = new tagMailAllContextChangeEvent(); MsgEventHandle.HandleMsg(pEvent2); }
private bool HandleLoadUserSystemMail(NetCmdBase obj) { LC_Cmd_SystemMail ncb = (LC_Cmd_SystemMail)obj; if ((ncb.States & FishDataInfo.MsgBegin) != 0) { SystemMailTitleList.Clear(); } for (UInt16 i = 0; i < ncb.Sum; ++i) { SystemMailTitleList.Add(ncb.Array[i]); } if ((ncb.States & FishDataInfo.MsgEnd) != 0) { m_IsLoadDB = true; tagMailTitleChangeEvent pEvent = new tagMailTitleChangeEvent(); MsgEventHandle.HandleMsg(pEvent); } return(true); }
private bool HandleGetUserMailItem(NetCmdBase obj) { LC_Cmd_GetMailItem ncb = (LC_Cmd_GetMailItem)obj; if (ncb.Result) { //获取邮件物品成功 我们修改物品的状态 for (int i = 0; i < SystemMailTitleList.Count; ++i) { if (SystemMailTitleList[i].MailID == ncb.dwMailID) { SystemMailTitleList[i].bIsRead = true; SystemMailTitleList[i].bIsExistsItem = false; if (SystemMailMap.ContainsKey(ncb.dwMailID)) { SystemMailMap[ncb.dwMailID].bIsRead = true; SystemMailMap[ncb.dwMailID].bIsExistsReward = false; //SystemMailMap[ncb.dwMailID].RewardID = 0;//无须屏蔽奖励ID } tagMailContextChangeEvent pContextEvent = new tagMailContextChangeEvent(ncb.dwMailID); MsgEventHandle.HandleMsg(pContextEvent); tagMailTitleChangeEvent pEvent = new tagMailTitleChangeEvent(); MsgEventHandle.HandleMsg(pEvent); tagMailGetItemEvent pGetItem = new tagMailGetItemEvent(); MsgEventHandle.HandleMsg(pGetItem); break; } } } tagUserOperationEvent pUOM = new tagUserOperationEvent((ncb.Result ? UserOperateMessage.UOM_Mail_GetSystemMailItem_Sucess : UserOperateMessage.UOM_Mail_GetSystemMailItem_Failed_4)); MsgEventHandle.HandleMsg(pUOM); return(true); }