globaluserlist.h

来自「真正的传奇源代码」· C头文件 代码 · 共 51 行

H
51
字号


#pragma once


#define GLOBALLIST_MAXLIST		20000
#define GLOBALLIST_MAXBUCKET	1000


#include "..\Def\_OrzEx\syncobj.h"
#include "..\Def\_OrzEx\indexmap.h"
#include "..\Def\_OrzEx\fsa.h"


class CGlobalUserList : public CIntLock
{
public:
	class CUserInfo
	{
	public:
		enum { MAXID = 32, MAXIP = 32 };

		char szID[MAXID];
		char szIP[MAXIP];

	public:
		CUserInfo() { szID[0] = '\0'; szIP[0] = '\0'; }
	};

public:
	CIndexMap< CUserInfo >				m_listUser;
	CFixedSizeAllocator< CUserInfo >	m_fixedMemory;	

public:
	CGlobalUserList();
	virtual ~CGlobalUserList();

	bool		Insert( char *pID, char *pIP );
	CUserInfo *	Search( char *pID );
	void		Remove( char *pID );

protected:
	static char * __cbGetKey( CUserInfo *pUser );
};


typedef CGlobalUserList::CUserInfo CGlobalUserInfo;


CGlobalUserList * GetGlobalUserList();

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?