📄 handler_cg_conversation.cpp
字号:
#include "StdAfx.h"
#include ".\handler_cg_conversation.h"
#include "Player.h"
#include "Field.h"
#include <Protocol_CG.h>
#include <PacketStruct_CG.h>
#include "ServerSession.h"
Handler_CG_CONVERSATION::Handler_CG_CONVERSATION()
{
}
Handler_CG_CONVERSATION::~Handler_CG_CONVERSATION()
{
}
VOID Handler_CG_CONVERSATION::OnCG_CONVERSATION_FIELDCHAT_SYN( ServerSession * pServerSession, MSG_BASE * pMsg, WORD wSize )
{
MSG_CG_CONVERSATION_FIELDCHAT_SYN * pRecvMsg = (MSG_CG_CONVERSATION_FIELDCHAT_SYN *)pMsg;
Player * pPlayer = PlayerManager::Instance()->FindPlayer( pRecvMsg->m_dwKey );
if (!pPlayer) return;
BOOL bBroadcast = TRUE;
if( MAX_CHAT_LEN <= pRecvMsg->m_byMsgLength)
{
SUNLOG( eCRITICAL_LOG, "[Handler_CG_CONVERSATION::OnCG_CONVERSATION_FIELDCHAT_SYN] Warnig: 努扼捞攫飘俊辑 焊辰 盲泼 弥措 皋技瘤 辨捞 檬苞!! ");
return;
}
// 鞘靛俊 乐绰 葛电 荤恩俊霸 broadcast
Field *pField = pPlayer->GetField();
if( pField )
{
if( bBroadcast )
{
MSG_CG_CONVERSATION_FIELDCHAT_BRD sendMsg;
sendMsg.m_byCategory = CG_CONVERSATION;
sendMsg.m_byProtocol = CG_CONVERSATION_FIELDCHAT_BRD;
sendMsg.m_dwObjectKey = pRecvMsg->m_dwObjectKey;
sendMsg.m_byMsgLength = pRecvMsg->m_byMsgLength;
memcpy( sendMsg.m_pszChatMsg, pRecvMsg->m_pszChatMsg, pRecvMsg->m_byMsgLength );
pField->SendPacketToAll( &sendMsg, (WORD)sendMsg.GetSize(), pPlayer->GetObjectKey() );
}
}
else
{
SUNLOG( eCRITICAL_LOG, "[Handler_CG_CONVERSATION::OnCG_CONVERSATION_FIELDCHAT_SYN] Warning: 盲泼 皋矫瘤甫 焊辰 敲饭捞绢(ObjectKey:%d)狼 Field 器牢磐啊 NULL", pPlayer->GetObjectKey() );
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -