38 lines
732 B
C++
38 lines
732 B
C++
#pragma once
|
|
|
|
#include <NetworkObject.h>
|
|
#include <PacketStruct.h>
|
|
|
|
enum eUSER_TYPE
|
|
{
|
|
UT_TEMP_USER,
|
|
UT_USER,
|
|
};
|
|
|
|
class UserSession : public NetworkObject
|
|
{
|
|
public:
|
|
UserSession(void);
|
|
virtual ~UserSession(void);
|
|
|
|
public:
|
|
virtual VOID OnRecv( BYTE *pMsg, WORD wSize ) = 0;
|
|
virtual int SendPacket( MSG_BASE * pMsg, WORD wSize );
|
|
virtual VOID OnDisconnect();
|
|
virtual VOID OnAccept( DWORD dwNetworkIndex ) {}
|
|
|
|
public:
|
|
VOID SetUserType( eUSER_TYPE type ){ m_eUserType = type; }
|
|
eUSER_TYPE GetUserType(){ return m_eUserType; }
|
|
VOID Init();
|
|
VOID Release();
|
|
|
|
DWORD GetUserKey(){ return m_dwUserKey; }
|
|
VOID SetUserKey( DWORD dwKey ){ m_dwUserKey = dwKey; }
|
|
|
|
private:
|
|
eUSER_TYPE m_eUserType;
|
|
DWORD m_dwUserKey;
|
|
|
|
};
|