Patch.h
上传用户:cydong117
上传日期:2009-11-10
资源大小:638k
文件大小:2k
源码类别:

模拟服务器

开发平台:

Visual C++

  1. // Patch.h: interface for the CPatch class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_PATCH_H__F89946B9_87EB_4621_933C_41AEFF63C4A4__INCLUDED_)
  5. #define AFX_PATCH_H__F89946B9_87EB_4621_933C_41AEFF63C4A4__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #include<Wininet.h>
  10. #define NO_ERROR_PATCH   0
  11. #define ERROR_TO_PATCH 999
  12. class CPatch  
  13. {
  14. public:
  15. UnCompressedFileNode* GetFileNode(int Pos);
  16. VOID InitPatch(VOID);
  17. // Public Function
  18. CPatch();
  19. HRESULT GetFtpFiles(VOID);
  20. VOID RenderSence(INT nLoopTime);
  21. virtual ~CPatch();
  22. BOOL m_bEndPatch;
  23. BOOL m_bPatched;
  24. VOID DrawProgressImage(VOID);
  25. private:
  26. // Private Variable
  27. HINSTANCE m_hLib; // For Dll
  28. HINTERNET m_HInet;
  29. HINTERNET m_HFtp;
  30. HINTERNET m_HFileFtp;
  31. HBITMAP m_xBmp[2]; // For Image
  32. long m_AnAmount; // Current Amount
  33. long m_TheAmount; // Total Amount
  34. long m_FACount; // Total File     Count
  35. HANDLE m_hFile;
  36. char m_UpdatePath[1024];
  37. UINT m_PatchState;
  38. char m_szPatchServerIP[16];
  39. int m_Server_Port;
  40. char m_UID[11];
  41. char m_PASS[11];
  42. char m_szPatchDate[9];
  43. BOOL WillBePatch(VOID);
  44. HRESULT GetFile(char* name);
  45. HINTERNET OpenInet(char* name);
  46. HINTERNET ConnectInet(HINTERNET hInet, char *sIP, WORD lPort, char *pID, char *pPass);
  47. short Progress(long Total, long Current);
  48. BOOL CheckPatchDate(VOID);
  49. BOOL m_bWillbePatch1;
  50. BOOL m_bWillbePatch2;
  51. UnCompressedFileNode**  m_ppFilesData;
  52. };
  53. #endif // !defined(AFX_PATCH_H__F89946B9_87EB_4621_933C_41AEFF63C4A4__INCLUDED_)
  54. // Patch States
  55. // 0 Start
  56. // 1 DownLoading File
  57. // 2 Next File Load Need
  58. // 3 No more File exist