Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
50 lines
1.6 KiB
C++
50 lines
1.6 KiB
C++
#ifndef _GAMA_NETWORK_CHATSERVER_EVENT_HANDLER_
|
|
#define _GAMA_NETWORK_CHATSERVER_EVENT_HANDLER_
|
|
|
|
#include <Network/ClientNetwork/ClientEventHandler.h>
|
|
#include <Stream/Buffer/BufferFactory.h>
|
|
#include <Stream/Buffer/Buffer.h>
|
|
|
|
|
|
/** \namespace ClientNet
|
|
클라이언트에서 사용하는 네트웍 관련 클래스가 속한 네임스페이스*/
|
|
namespace ClientNet
|
|
{
|
|
/** \class CChatServerEventHandler
|
|
채팅서버와 모니터링 툴간 통신*/
|
|
class CChatServerEventHandler : public CClientEventHandler
|
|
{
|
|
public:
|
|
|
|
CChatServerEventHandler(unsigned int nServerGroup);
|
|
|
|
virtual int OnOpen(int iErrorCode);
|
|
virtual int OnClose();
|
|
|
|
static bool Connect();
|
|
virtual int OnDispatch(PktBase* lpPktBase, INET_Addr& peerAddr);
|
|
|
|
static bool SendAuthPkt(char* szUserID, char* szPass);
|
|
static bool SendChatOptPkt(unsigned int nServerGroup, unsigned char* szOption, unsigned char cOptionNum);
|
|
|
|
static bool SendChatReqPkt(unsigned int nServerGroup, unsigned char cChatType, unsigned char cTargetType,
|
|
unsigned long dwTargetUID, unsigned long dwMessageID, const CString& strGMName, const CString& strTargetName,
|
|
const CString& strMsg);
|
|
|
|
static bool SendAdminStatus(unsigned int nServerGroup, const CString& strAdminName, unsigned char cStatus);
|
|
|
|
unsigned long GetLastPingRecvTime() { return m_dwLastPingRecvTime; }
|
|
|
|
private:
|
|
|
|
bool RecvAuthAck(PktBase* lpPktBase, INET_Addr& peerAddr);
|
|
bool RecvChatData(PktBase* lpPktBase, INET_Addr& peerAddr);
|
|
bool RecvChatPing(PktBase* lpPktBase, INET_Addr& peerAddr);
|
|
bool RecvChatRequest(PktBase* lpPktBase, INET_Addr& peerAddr);
|
|
|
|
unsigned int m_nServerGroup;
|
|
unsigned long m_dwLastPingRecvTime;
|
|
};
|
|
};
|
|
|
|
#endif |