6 major server modules (PdkFriendServer/GlobalSever/ServerCore/GameModule/GameNetModule) + game logic (GameFix/GameDAL/ServerData) + network layer (NetWorkMessage) + data layer (ObjectModel) + utilities (MrWu/Core/Config/CloudAPI/dll) + adapters (zyxAdapter/base) .NET 8.0 C# solution, 16 projects, 958 source files
80 lines
3.4 KiB
C#
80 lines
3.4 KiB
C#
/*
|
|
* 作者:吴隆健
|
|
* 日期: 2019-04-08
|
|
* 时间: 13:59
|
|
*
|
|
*/
|
|
using System;
|
|
using Server.DB.Sql;
|
|
using System.Data;
|
|
using System.Threading.Tasks;
|
|
using GameData;
|
|
using MrWu.Debug;
|
|
using GameMessage;
|
|
|
|
namespace GameDAL.Eml
|
|
{
|
|
/// <summary>
|
|
/// 邮件处理
|
|
/// </summary>
|
|
public static class EmailManager
|
|
{
|
|
/// <summary>
|
|
/// 发送邮件
|
|
/// </summary>
|
|
/// <param name="send_id">发件人id 系统消息表示的是可阅读数量</param>
|
|
/// <param name="send_type">发件人类型 0系统 1用户 2竞技比赛</param>
|
|
/// <param name="receive_id">接收人 -1表示群发</param>
|
|
/// <param name="receive_type">0系统 1用户 2竞技比赛 1000以上表示系统消息 1000游戏游戏 2000竞技比赛消息 1000+gameid金币子游戏消息 2000+gameid朋友场子游戏消息</param>
|
|
/// <param name="title">邮件标题,不能超过10个汉字</param>
|
|
/// <param name="content">邮件内容</param>
|
|
/// <param name="res">游戏资源</param>
|
|
public static void WriteEml(int send_id, int send_type, int receive_id, int receive_type, string title, string content, GameRes[] res = null)
|
|
{
|
|
|
|
if (receive_id < -1)
|
|
{
|
|
Debug.Error("游戏逻辑错误,请检查-邮件发送:" + receive_id);
|
|
return;
|
|
}
|
|
|
|
|
|
string strres = string.Empty;
|
|
|
|
if (res != null)
|
|
{
|
|
strres = JsonPack.GetJson(res);
|
|
}
|
|
|
|
var spp = GameDB.Instance.BeginSetProcedureParameter(dbbase.game2018, "add_user_mail_new");
|
|
GameDB.Instance.AddProdureParameters(spp, "@send_id", SqlDbType.Int, send_id);
|
|
GameDB.Instance.AddProdureParameters(spp, "@send_type", SqlDbType.Int, send_type);
|
|
GameDB.Instance.AddProdureParameters(spp, "@receive_id", SqlDbType.Int, receive_id);
|
|
GameDB.Instance.AddProdureParameters(spp, "@receive_type", SqlDbType.Int, receive_type);
|
|
GameDB.Instance.AddProdureParameters(spp, "@mail_title", SqlDbType.NVarChar, title);
|
|
GameDB.Instance.AddProdureParameters(spp, "@str_content", SqlDbType.NVarChar, content);
|
|
GameDB.Instance.AddProdureParameters(spp, "@mail_res", SqlDbType.NVarChar, strres);
|
|
GameDB.Instance.EndAddProdureParameters(spp);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 发送邮件
|
|
/// </summary>
|
|
/// <param name="send_id">发件人id 系统消息表示的是可阅读数量</param>
|
|
/// <param name="send_type">发件人类型 0系统 1用户 2竞技比赛</param>
|
|
/// <param name="receive_id">接收人 -1表示群发</param>
|
|
/// <param name="receive_type">0系统 1用户 2竞技比赛 1000以上表示系统消息 1000游戏游戏 2000竞技比赛消息 1000+gameid金币子游戏消息 2000+gameid朋友场子游戏消息</param>
|
|
/// <param name="title">邮件标题</param>
|
|
/// <param name="content">邮件内容</param>
|
|
/// <param name="res">游戏资源</param>
|
|
public static Task WriteEmlAysn(int send_id, int send_type, int receive_id, int receive_type, string title, string content, GameRes[] res = null)
|
|
{
|
|
|
|
|
|
return Task.Factory.StartNew(
|
|
() => WriteEml(send_id, send_type, receive_id, receive_type, title, content, res)
|
|
);
|
|
}
|
|
}
|
|
}
|