133 lines
3.9 KiB
C++
133 lines
3.9 KiB
C++
#pragma once
|
|
|
|
#include "GameObject.h"
|
|
#include <Sessions/UserSessionMgr.h>
|
|
#include <Object/MsgHandler.h>
|
|
#include "ObjectController.h"
|
|
|
|
|
|
//━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
|
|
// <PROTOTYPEs>
|
|
class WiseCharacter;
|
|
class WiseUser;
|
|
class IPeriodicWork;
|
|
|
|
typedef sMESSAGE_BLOCK<sSIG_NETMSG::SENDMSG, USER_MSG_BLOCK_S> SEND_MESSAGE_BLOCK;
|
|
typedef sMESSAGE_BLOCK<sSIG_NETMSG::RECVMSG, USER_MSG_BLOCK_L> RECV_MESSAGE_BLOCK;
|
|
|
|
|
|
|
|
|
|
//━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
|
|
class WiseUserAddin
|
|
{
|
|
friend class WiseUser;
|
|
//////////////////////////////////////////////////////////////////////////
|
|
//
|
|
private: ZoneControl m_ZoneController;
|
|
sAuthController m_AuthController;
|
|
AutoPlayControl m_AutoPlayController;
|
|
AccountInfo m_Account;
|
|
|
|
RECV_MESSAGE_BLOCK m_RECV_REF;
|
|
SEND_MESSAGE_BLOCK m_SEND_REF;
|
|
};
|
|
|
|
//━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
|
|
// <USER OBJECT>
|
|
// 클라이언트가 접속하고 플레이하는 상태 관련 구분자
|
|
class WiseUser : public GameObject
|
|
{
|
|
public:
|
|
|
|
public: WiseUser();
|
|
~WiseUser();
|
|
|
|
public: void Init(LogicFlowBase* pLogicFlow);
|
|
void Release();
|
|
inline IPeriodicWork* GetPeriodicWork() { return m_pPeriodicWork; }
|
|
inline void SetPeriodicWork(IPeriodicWork* pWork) { m_pPeriodicWork = pWork; }
|
|
inline LogicFlowDelegator& GetLogicFlow() { return m_rLogicFlow; } // LogicFlowConnection 객체
|
|
inline UserSessionMgr& GetSessionMgr() { return m_UserSessionMgr; }
|
|
|
|
inline RECV_MESSAGE_BLOCK& RECV_MSG() { return m_pAddin->m_RECV_REF; }
|
|
inline SEND_MESSAGE_BLOCK& SEND_MSG() { return m_pAddin->m_SEND_REF; }
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
// <CHARACTER CONTROL>
|
|
public: inline WiseCharacter* GetSelectedCharacter();
|
|
inline void SelectCharacter(DWORD dwIdx);
|
|
BOOL AddChar(SLOTIDX bySlotIdx, CLIENT_CHARACTER_PART& rCHAR_INFO);
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
//
|
|
void OnMsg(sSIG_MSG* pSIG_MSG);
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
//
|
|
public: inline sAuthController& AuthController() { return m_pAddin->m_AuthController; }
|
|
inline ZoneControl& ZoneController() { return m_pAddin->m_ZoneController; }
|
|
inline AutoPlayControl& AutoController() { return m_pAddin->m_AutoPlayController; }
|
|
inline AccountInfo& AccountController() { return m_pAddin->m_Account; }
|
|
|
|
private: friend class LogicFlowController;
|
|
WiseUserAddin* m_pAddin;
|
|
LogicFlowDelegator m_rLogicFlow;
|
|
IPeriodicWork* m_pPeriodicWork;
|
|
UserSessionMgr m_UserSessionMgr;
|
|
WiseCharacter* m_pSelectedCharacter;
|
|
WiseCharacter* m_pCharacters[MAX_CHARACTER_LIST_NUM];
|
|
BYTE m_pAddinStream[sizeof(WiseUserAddin)];
|
|
//ZoneControl m_ZoneController;
|
|
//sAuthController m_AuthController;
|
|
//AutoPlayControl m_AutoPlayController;
|
|
//AccountInfo m_Account;
|
|
//RECV_MESSAGE_BLOCK m_RECV_REF;
|
|
//SEND_MESSAGE_BLOCK m_SEND_REF;
|
|
};
|
|
|
|
//━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
|
|
//
|
|
class WiseUserDelegator
|
|
{
|
|
public: WiseUserDelegator() : m_pUser(NULL) {}
|
|
WiseUserDelegator(WiseUser* pUser) : m_pUser(pUser) {}
|
|
|
|
public: inline WiseCharacter* GetSelectedCharacter()
|
|
{
|
|
if(m_pUser)
|
|
return m_pUser->GetSelectedCharacter();
|
|
return NULL;
|
|
}
|
|
|
|
inline void SelectCharacter(DWORD dwIdx) { if(m_pUser) m_pUser->SelectCharacter(dwIdx); }
|
|
void OnMsg(sSIG_MSG* pSIG_MSG) { if(m_pUser) m_pUser->OnMsg(pSIG_MSG); }
|
|
|
|
private: WiseUser* m_pUser;
|
|
};
|
|
|
|
|
|
|
|
|
|
//━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
|
|
//
|
|
WiseCharacter* WiseUser::GetSelectedCharacter()
|
|
{
|
|
return m_pSelectedCharacter;
|
|
}
|
|
|
|
void WiseUser::SelectCharacter(DWORD dwIdx)
|
|
{
|
|
if(!(MAX_CHARACTER_LIST_NUM > dwIdx))
|
|
{
|
|
m_pSelectedCharacter = NULL;
|
|
return;
|
|
}
|
|
|
|
m_pSelectedCharacter = m_pCharacters[dwIdx];
|
|
}
|
|
|
|
|
|
|
|
|