#pragma once #include #include "ServerSession.PacketCrypt.h" class UserSessionMgr; ////////////////////////////////////////////////////////////////////////// // class ServerSession : public NetworkObject { public: ServerSession(); ~ServerSession(); protected: virtual void OnRecv(BYTE *pMsg, WORD wSize); virtual void OnLogString(CHAR* pszLog); virtual void OnAccept(DWORD dwNetworkIndex); virtual void OnDisconnect(); virtual void OnConnect(BOOL bSuccess, DWORD dwNetworkIndex); public: virtual eCONNECT_SESSIONS GetServerType() { return MAX_SESSION; } virtual void Init(); virtual void Release(); void Update(); //< ¸Åƽ¸¶´Ù È£ÃâÀÌ µÇ¾î¾ß ÇÏ´Â ºÎºÐ!!!! virtual BOOL SendPacket(MSG_BASE* pMsg, WORD wSize) { return Send((BYTE*)pMsg, wSize); } public: inline BOOL IsConnecting() { return m_bIsConnecting; } inline BOOL IsConnected() { return m_bIsConnected; } inline void SetConnecting(BOOL bSet) { m_bIsConnecting = bSet; } inline void SetConnected(BOOL bSet) { m_bIsConnected = bSet; } public: inline void SetLinkedUser(UserSessionMgr* pMgr) { m_pLinkedUser = pMgr; } inline UserSessionMgr* GetLinkedUser() { return m_pLinkedUser; } public: virtual BOOL IsValidObject(DWORD dwCheckValue); virtual BOOL IsValidState(DWORD dwStatusValue); virtual BOOL SendPacket4Interface(MSG_BASE* pMsg, WORD wSize); // À̰ÍÀº WorkLoad¿¡¼­ ÇØ´ç ¼¼¼Ç¿¡ ´ëÇÑ À¯È¿¼ºÀ» ÆÇº°Çϱâ À§Çؼ­ »ç¿ëÇÑ´Ù. inline void SetSyncKey(DWORD dwSyncValue) { m_dwSyncKey = dwSyncValue; } inline DWORD GetSyncKey() { return m_dwSyncKey; } public: //WORK_LOAD_CONTAINER_SESSION_WORK& GetWorkLoadContainer() { return m_WorkLoad; } WorkLoadPacketStream& GetWorkLoadPacketStream() { return m_WorkLoadPacketStream; } public: inline ClientSecurePackNode4Session& SECURE_PACK() { return m_SecurePack; } // private: UserSessionMgr* m_pLinkedUser; BOOL m_bIsConnected; BOOL m_bIsConnecting; private: DWORD m_dwSyncKey; private: WorkLoadPacketStream m_WorkLoadPacketStream; //WORK_LOAD_CONTAINER_SESSION_WORK m_WorkLoad; private: ClientSecurePackNode4Session m_SecurePack; };