public void ReadMailFinish(uint mailId) { ListMailInfo mail = null; int index = 0; for (int i = 0; i < MailList.Count; i++) { if (MailList[i].mailid == mailId) { index = i; mail = MailList[i]; MailList[i].state = 1; } } if (mail == null) { Engine.Utility.Log.Error("邮件阅读出错,id不存在!"); return; } if (mail.item.Count == 0 && mail.sendMoney.Count == 0) { Client.stMailStateChangeNoAttach mscn = new Client.stMailStateChangeNoAttach(); mscn.mailid = mailId; mscn.index = index; Engine.Utility.EventEngine.Instance().DispatchEvent((int)Client.GameEventID.MAIL_STATECHANGENOATTACH, mscn); } }
void EventCallBack(int nEventID, object param) { if (nEventID == (int)Client.GameEventID.MAIL_ADDNEWMAIL) { UpdateApplyRedPoint(FriendPanelPageEnum.Page_邮箱); } else if (nEventID == (int)Client.GameEventID.MAIL_STATECHANGENOATTACH) { Client.stMailStateChangeNoAttach mscna = (Client.stMailStateChangeNoAttach)param; if (mscna.mailid != 0) { ResReadMail((uint)MailType.NoteMail, mscna.mailid, mscna.index); UpdateApplyRedPoint(FriendPanelPageEnum.Page_邮箱); } } else if (nEventID == (int)Client.GameEventID.MAIL_STATECHANGE) { Client.stMailStateChange msc = (Client.stMailStateChange)param; if (msc.mailid != 0) { ResReadMail((uint)MailType.ItemMail, msc.mailid, msc.index); GetItemFinish(); UpdateApplyRedPoint(FriendPanelPageEnum.Page_邮箱); } } else if (nEventID == (int)Client.GameEventID.FRIEND_ADDNEWMSG) { UpdateApplyRedPoint(FriendPanelPageEnum.Page_最近); } }