using System; using System.Collections.Generic; using System.Text; namespace ET { public static class MailHelper { public static async ETTask AddItem(long unitId, int itemId, long count, bool isLock, string getSource, string title, string content, string senderName) { if (itemId == 0) return; Mail mail = new() { Id = Game.IdGenerater.GenerateId(), Content = content, Title = title, SenderName = senderName, State = MailState.UnReceive, RemainTime = TimeHelper.ClientNow() + (long)TimeSpan.FromDays(7).TotalMilliseconds, }; mail.RewordArr.Add(new MailItem { ItemId = itemId, Count = count, IsLock = isLock, IsHasItem = false, getSource = getSource }); await MailComponent.Instance.AddMail(unitId, mail); } } }