zxl
/
CTT
forked from Cal/CTT
1
0
Fork 0
CTT/Server/Hotfix/Game/Helper/MailHelper.cs

33 lines
1023 B
C#
Executable File

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);
}
}
}