⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dnfile.h

📁 网络游戏魔域的服务端与客户端完整源代码 包括详细的说明文档与开发日志
💻 H
字号:
//--------------------------------------------------------------------------------------
// File Name: DnFile.h
// Create by: Huang Yuhang
// Create on: 2003/11/16 20:13
//--------------------------------------------------------------------------------------
#ifndef _DNFILE_H
#define _DNFILE_H

#include <stdio.h>
#include <stdlib.h>
#include <map>

using namespace std;

class CDnFile  
{
public:
	CDnFile();
	virtual ~CDnFile();

public:
	void			BeforeUseDnFile();
	void			AfterUseDnFile();
	FILE*			GetFPtr(const char* pszFile, unsigned long& usFileSize);
	void*			GetMPtr(const char* pszFile, unsigned long& usFileSize);
	void			ClearPtr();
	bool			CheckDisperseFile(const char* pszFile);
	bool			CheckDisperseFile(const unsigned long uFileID);
	void			AddDisperseFile(const char* pszFile);
	bool			OpenFile(const char* pszFile);
	void			CloseFile(const char* pszFile);

private:
	void			Destroy();
	void			Create();
	unsigned long	GenerateID(const char* pszStr);	
	void			ProcessDir(const char* pszDir);
private:
	typedef struct 
	{
		unsigned long uSize;
		unsigned long uOffset;
	}FileIndexInfo;
	typedef struct 
	{
		FILE*	fpDnp;
		map<unsigned long, FileIndexInfo*> mapIndex;
	}DnpInfo;

private:
	map<unsigned long, DnpInfo*>		m_mapDnp;
	map<unsigned long, unsigned char>	m_mapDisperseFiles;
	unsigned char*						m_pBuffer;
	unsigned char*						m_pExtendBuffer;
	FILE*								m_fpExtend;
};
extern CDnFile g_objDnFile;
#endif

⌨️ 快捷键说明

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