99 lines
3.7 KiB
C#
99 lines
3.7 KiB
C#
using System.Collections.Generic;
|
|
|
|
namespace Thousandto.Code.Logic
|
|
{
|
|
/// <summary>
|
|
/// 用于聊天消息收发
|
|
/// </summary>
|
|
public class ChatInfo
|
|
{
|
|
|
|
public int ChatType = -1; // 消息类型
|
|
public ulong SendId = 0; // 发送人id
|
|
public string SendName = ""; // 发送人名字
|
|
public int SendVipLevel = -1; //发送人的vip等级
|
|
public ulong Receiver = 0; // 接收人id
|
|
public string ReceiverName = ""; // 接收人名字
|
|
public int RecvVipLevel = -1; // 接收人VIP类型
|
|
public string Content = ""; // 聊天消息
|
|
|
|
public int Channel = 1; //聊天频道
|
|
public int VipLevel = 0;
|
|
public int MoonardCard = 0; //月卡
|
|
public int SenderLevel = 0; //发送者等级
|
|
public int HeadId = 0; //头像ID
|
|
public int HeadFrameId = 0; //头像框ID
|
|
public string HeadPicID = string.Empty; //图片头像id
|
|
public bool ShowHeadPic = false; //是否展示图片头像
|
|
public int ChatBgId = 0; //气泡ID
|
|
public bool IsRobot = false; //是否是机器人
|
|
public int Sid = 0; //服务器id
|
|
public bool canTranslate = false; //是否可以翻译
|
|
public bool IsShowTranslate = false; //是否显示翻译后的文字
|
|
public bool IsTranslate = false; //是否是翻译
|
|
public string ReceiveTime = string.Empty; //消息接收时间
|
|
//发送者职业,默认为小学生
|
|
public int SenderOcc = 0;
|
|
//聊天面板
|
|
public object ChatPannel = null;
|
|
//是否读过
|
|
public bool IsRead = false;
|
|
//是否显示miniChat
|
|
public bool IsShowMini = true;
|
|
//一条聊天信息,包含若干字符节点
|
|
public List<ChatNode> ChatDatas = new List<ChatNode>();
|
|
|
|
//是否是系统消息
|
|
public bool IsSystemMsg
|
|
{
|
|
get
|
|
{
|
|
return Channel == (int)(ChatChanelType.SYSTEM) || Channel == (int)(ChatChanelType.ChuanWen);
|
|
}
|
|
}
|
|
|
|
private System.Action _cleanFunc = null;
|
|
|
|
public void SetCleanFunc(System.Action action)
|
|
{
|
|
_cleanFunc = action;
|
|
}
|
|
|
|
public static ChatInfo Copy(ChatInfo info)
|
|
{
|
|
ChatInfo infoCopy = new ChatInfo();
|
|
infoCopy.ChatDatas = info.ChatDatas;
|
|
infoCopy.ChatType = info.ChatType;
|
|
infoCopy.SendId = info.SendId;
|
|
infoCopy.SendName = info.SendName;
|
|
infoCopy.SendVipLevel = info.SendVipLevel;
|
|
infoCopy.Receiver = info.Receiver;
|
|
infoCopy.ReceiverName = info.ReceiverName;
|
|
infoCopy.RecvVipLevel = info.RecvVipLevel;
|
|
infoCopy.Content = info.Content;
|
|
infoCopy.MoonardCard = info.MoonardCard;
|
|
infoCopy.Channel = info.Channel;
|
|
infoCopy.VipLevel = info.VipLevel;
|
|
infoCopy.SenderOcc = info.SenderOcc;
|
|
infoCopy.SenderLevel = info.SenderLevel;
|
|
infoCopy.ChatBgId = info.ChatBgId;
|
|
infoCopy.HeadId = info.HeadId;
|
|
infoCopy.HeadFrameId = info.HeadFrameId;
|
|
infoCopy.HeadPicID = info.HeadPicID;
|
|
infoCopy.ShowHeadPic = info.ShowHeadPic;
|
|
infoCopy.IsRead = info.IsRead;
|
|
infoCopy.ReceiveTime = info.ReceiveTime;
|
|
infoCopy.canTranslate = info.canTranslate;
|
|
infoCopy.IsShowMini = info.IsShowMini;
|
|
return infoCopy;
|
|
}
|
|
|
|
public void Destroy()
|
|
{
|
|
if(_cleanFunc != null)
|
|
{
|
|
_cleanFunc();
|
|
}
|
|
}
|
|
}
|
|
} |