42 lines
732 B
C++
42 lines
732 B
C++
#include "StdAfx.h"
|
|
#include ".\usersession.h"
|
|
#include "PacketHandler.h"
|
|
#include "UserManager.h"
|
|
|
|
UserSession::UserSession(void)
|
|
{
|
|
m_dwUserKey = 0;
|
|
}
|
|
|
|
UserSession::~UserSession(void)
|
|
{
|
|
}
|
|
|
|
VOID UserSession::Init()
|
|
{
|
|
m_eUserType = UT_TEMP_USER;
|
|
m_dwUserKey = 0;
|
|
}
|
|
|
|
VOID UserSession::Release()
|
|
{
|
|
}
|
|
|
|
VOID UserSession::OnDisconnect()
|
|
{
|
|
// 0 이면 아직 인증 받지 못한 유저이다.
|
|
if( GetUserKey() != 0 )
|
|
{
|
|
if( !UserManager::Instance()->RemoveUser( GetUserKey() ) )
|
|
{
|
|
MSGOUT( "[UserSession::OnDisconnect] 유저[%d] 삭제 실패", GetUserKey() );
|
|
}
|
|
}
|
|
|
|
MSGOUT( "[UserSession::OnDisconnect] 유저[%d] 연결 종료", GetUserKey() );
|
|
}
|
|
|
|
int UserSession::SendPacket( MSG_BASE * pMsg, WORD wSize )
|
|
{
|
|
return Send( (BYTE*)pMsg, wSize );
|
|
} |