MailListPushCtrl.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using FL.Data;
  2. using XGame.Framework.Network;
  3. namespace FL.Network
  4. {
  5. public class MailListPushCtrl : MsgController<MailListPush>
  6. {
  7. protected override void OnProcess(MailListPush message, object context)
  8. {
  9. for (int i = 0; i < message.mail_list.Count; i++)
  10. {
  11. if (MailData.Instance.mailInfo == null)
  12. {
  13. MailData.Instance.mailInfo = message.mail_list;
  14. break;
  15. }
  16. bool hasMail = false;
  17. for (global::System.Int32 j = 0; j < MailData.Instance.mailInfo.Count; j++)
  18. {
  19. if (message.mail_list[i].id == MailData.Instance.mailInfo[j].id)
  20. {
  21. MailData.Instance.mailInfo[j] = message.mail_list[i];
  22. hasMail = true;
  23. break;
  24. }
  25. }
  26. if (!hasMail)
  27. {
  28. MailData.Instance.mailInfo.Add(message.mail_list[i]);
  29. }
  30. }
  31. //MailData.Instance.mailInfo = message.mail_list;
  32. }
  33. }
  34. }