Files
mir_server/server/DBServer/DBSessionClient.h

58 lines
2.4 KiB
C
Raw Normal View History

2025-01-09 17:45:40 +08:00
#pragma once
class CDBServer;
class CDBSessionClient
: public CCustomSessionClient
{
public:
typedef CCustomSessionClient Inherited;
public:
CDBSessionClient(CDBServer *lpDBServer);
~CDBSessionClient();
protected:
/*** 覆盖父类的会话逻辑处理函数 ***/
/* ★查询本地服务器的类型,以便正确的向会话服务器注册连接 */
jxSrvDef::SERVERTYPE getLocalServerType();
// 返回serverindex
virtual int getLocalServerIndex();
/* ★查询本地服务器的名称,以便正确的向会话服务器注册连接 */
LPCSTR getLocalServerName();
/* ★创建一个会话对象默认的操作是使用m_Allocator申请一份会话对象内存 */
CCustomGlobalSession* CreateSession();
/* ★销毁一个会话对象默认的操作是将会话对象释放回m_Allocator中 */
VOID DestroySession(CCustomGlobalSession* pSession);
/* ★当会话服务器告知有新会话打开的时,当创建会话对象并填充基本数据后调用
*pSession
*boIsNewSession 线
*/
VOID OnOpenSession(CCustomGlobalSession* pSession, BOOL boIsNewSession);
/* ★当一个会话被关闭时调用
*nSessionID ID
*/
VOID OnCloseSession(int nSessionId);
//实现父类的虚函数
VOID OnCloseSession(CCustomGlobalSession *pSession){}
/* ★当被动(由会话服务器广播而进行的)更新会话状态的时候调用此函数
*pSession
*oldState
*newState
*/
VOID OnUpdateSessionState(CCustomGlobalSession* pSession, jxSrvDef::GSSTATE oldState, jxSrvDef::GSSTATE newState);
/* ★查询全局会话关联的用户是否在线
*nSessionId ID
* ID关联的用户是否存在
* 使PostInternalMessage的形式向其他线程的对象发送消息线
* 使PostQuerySessionExistsResult返回查询用户是否在线的结果
*/
VOID OnQuerySessionExists(INT_PTR nSessionId);
private:
CDBServer *m_pDBServer; //所属DBServer
};