초기커밋
This commit is contained in:
32
GameServer/Contents/Chat/Log/ChatBusinessLog.cs
Normal file
32
GameServer/Contents/Chat/Log/ChatBusinessLog.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using Google.Protobuf;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
using ServerCommon;
|
||||
using ServerCommon.BusinessLogDomain;
|
||||
using MetaAssets;
|
||||
|
||||
|
||||
namespace GameServer;
|
||||
|
||||
public class ChatBusinessLog : ILogInvokerEx
|
||||
{
|
||||
private ChatLogData m_data_to_log;
|
||||
public ChatBusinessLog(ChatLogData log_data_param)
|
||||
: base(LogDomainType.Chat)
|
||||
{
|
||||
m_data_to_log = log_data_param;
|
||||
}
|
||||
|
||||
public override bool hasLog()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override void fillup(ref BusinessLog.LogBody body)
|
||||
{
|
||||
body.append(new ChatLogData(this, m_data_to_log));
|
||||
}
|
||||
}
|
||||
39
GameServer/Contents/Chat/Log/ChatBusinessLogHelper.cs
Normal file
39
GameServer/Contents/Chat/Log/ChatBusinessLogHelper.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
using ServerCommon;
|
||||
using ServerCommon.BusinessLogDomain;
|
||||
using MetaAssets;
|
||||
|
||||
|
||||
namespace GameServer;
|
||||
|
||||
public static class ChatBusinessLogHelper
|
||||
{
|
||||
static public ChatLogData toLogInfo(string chatMessage, CellPos cellpos)
|
||||
{
|
||||
var logData = new ChatLogData();
|
||||
logData.setInfo(chatMessage, cellpos);
|
||||
return logData;
|
||||
}
|
||||
|
||||
static public ChatLogData toLogInfo(string chatMessage, string targetUser = "")
|
||||
{
|
||||
var logData = new ChatLogData();
|
||||
logData.setInfo(chatMessage, targetUser);
|
||||
return logData;
|
||||
}
|
||||
|
||||
static public void setInfo(this ChatLogData logData, string chatMessage, string targetUser)
|
||||
{
|
||||
logData.TargetUser = targetUser;
|
||||
logData.ChatMessage = chatMessage;
|
||||
}
|
||||
|
||||
static public void setInfo(this ChatLogData logData, string chatMessage, CellPos cellpos)
|
||||
{
|
||||
logData.ChatMessage = chatMessage;
|
||||
logData.cellPosX = cellpos.CellX;
|
||||
logData.cellPosX = cellpos.CellY;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user