Forráskód Böngészése

Z991239-1150 #comment feat:升级实体计算hash功能跨平台实现

Signed-Off-By: commit-hook
刘文涛174520 4 éve
szülő
commit
24fe51277f

+ 39 - 3
Module/mod_UpgradeMgr/CMakeLists.txt

@@ -2,12 +2,47 @@
 define_module("UpgradeManager")
 
 #整个实体加载的文件
-file(GLOB ${MODULE_PREFIX}_SRCS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
-    "${CMAKE_CURRENT_SOURCE_DIR}/*.h" "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
-    "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp")
+if(WIN32)
+set(${MODULE_PREFIX}_SRCS
+	mod_UpgradeMgr.cpp
+	mod_UpgradeMgr.h
+	UpgradeManager_client_g.h
+	UpgradeManager_def_g.h
+	UpgradeManager_msg_g.h
+	UpgradeManager_server_g.h
+	UpgradeMgrCnn.cpp
+	UpgradeMgrConn.h
+	UpgradeMgrFSM.cpp
+	UpgradeMgrFSM.h
+	WMIDeviceQuery.cpp
+	WMIDeviceQuery.h
+	md5.cpp
+	md5.h
+	md5file.cpp
+	md5file.h
+	)
+else()
+set(${MODULE_PREFIX}_SRCS
+	mod_UpgradeMgr.cpp
+	mod_UpgradeMgr.h
+	UpgradeManager_client_g.h
+	UpgradeManager_def_g.h
+	UpgradeManager_msg_g.h
+	UpgradeManager_server_g.h
+	UpgradeMgrCnn.cpp
+	UpgradeMgrConn.h
+	UpgradeMgrFSM.cpp
+	UpgradeMgrFSM.h
+	md5.cpp
+	md5.h
+	md5file.cpp
+	md5file.h
+	)
+endif(WIN32)
 #设置版本
 set(MOD_VERSION_STRING "1.0.0-dev1")
 add_module_libraries(${MODULE_PREFIX} ${MODULE_NAME} ${MOD_VERSION_STRING})
+
 #附加包含的目录(DevHeadPath:)
 target_include_directories(${MODULE_NAME} PRIVATE
 	${DevHeadPath}
@@ -18,6 +53,7 @@ target_include_directories(${MODULE_NAME} PRIVATE
 	${MODULE_BASE_DIR}/mod_accessauth
 	${MODULE_BASE_DIR}/mod_localmediaplay
 	${RVC_FRAMEWORK_INCLUDES_DIR}
+	${CONAN_RVCFRAMEWORK_ROOT}/include
 )
 
 # 添加实体需要依赖的其他共享库(包括系统库):连接器包含的包

+ 41 - 8
Module/mod_UpgradeMgr/UpgradeMgrCnn.cpp

@@ -1,10 +1,15 @@
-#include "stdafx.h"
 #include "UpgradeMgrConn.h"
-
+#include <string.h>
 #include "GetDevInfoHelper.h"
 #include "UpgradeMgrFSM.h"
 #include "mod_UpgradeMgr.h"
 
+#ifdef RVC_OS_WIN
+#else
+#include <sys/utsname.h>
+#endif
+
+
 namespace UpgradeConnect {
 
 void CUpgradeMgrConn::OnDisconnect()
@@ -50,7 +55,11 @@ ErrorCodeEnum CUpgradeMgrConn::SendConfirmUpgradeReq(const char* pPackExecID)
 {
 	CSmartPointer<IPackage> package = CreateNewPackage("CONFIRM");
 	Confirm_Req req = {};
+#ifdef RVC_OS_WIN
 	strncpy_s(req.PackExecID, sizeof(req.PackExecID), pPackExecID, _TRUNCATE);
+#else
+	strncpy(req.PackExecID, pPackExecID, sizeof(req.PackExecID));
+#endif
 	package->AddStruct("CONF_REQ", false, false, (BYTE*)&req, sizeof(req), 1);
 	//Dbg("send upgrade confirm package");
 
@@ -62,7 +71,11 @@ ErrorCodeEnum CUpgradeMgrConn::SendQueryExecInfoReq(const char* pPackExecID)
 {
 	CSmartPointer<IPackage> package = CreateNewPackage("QRYEXEC");
 	QueryExec_Req req = {};
+#ifdef RVC_OS_WIN
 	strncpy_s(req.PackExecID, sizeof(req.PackExecID), pPackExecID, _TRUNCATE);
+#else
+	strncpy(req.PackExecID, pPackExecID, sizeof(req.PackExecID));
+#endif
 	package->AddStruct("EXEC_REQ", false, false, (BYTE*)&req, sizeof(req), 1);
 	//Dbg("send upgrade confirm package");
 
@@ -111,17 +124,37 @@ ErrorCodeEnum CUpgradeMgrConn::SendPollUpgradeReq(bool IsHashComputed)
 	req1.InstallVersion[7] = nTmp & 0xFF;
 
 	// OS°æ±¾
-	OSVERSIONINFO osvi;    
-    ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
-    osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-    GetVersionEx(&osvi);
-
+#ifdef RVC_OS_WIN
+	OSVERSIONINFO osvi;
+	ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
+	osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+	GetVersionEx(&osvi);
 	req1.OSVersion[0] = (osvi.dwMajorVersion >> 8) & 0xFF;
 	req1.OSVersion[1] = osvi.dwMajorVersion & 0xFF;
-	req1.OSVersion[2] = (osvi.dwMinorVersion >>8) &  0xFF;
+	req1.OSVersion[2] = (osvi.dwMinorVersion >> 8) & 0xFF;
 	req1.OSVersion[3] = osvi.dwMinorVersion & 0xFF;
 	req1.OSVersion[4] = (osvi.dwBuildNumber >> 8) & 0xFF;
 	req1.OSVersion[5] = osvi.dwBuildNumber & 0xFF;
+#else
+	DWORD dwMajorVersion(0), dwMinorVersion(0), dwBuildNumber(0);
+	struct utsname kernel_info;
+	int ret = uname(&kernel_info);
+	if (ret == 0) {
+		int n = sscanf((const char*)kernel_info.release, "%d.%d", &dwMajorVersion, &dwMinorVersion);
+	}
+	else {
+		Dbg("get linux kernel version fail: %s", strerror(errno));
+	}
+	req1.OSVersion[0] = (dwMajorVersion >> 8) & 0xFF;
+	req1.OSVersion[1] = dwMajorVersion & 0xFF;
+	req1.OSVersion[2] = (dwMinorVersion >> 8) & 0xFF;
+	req1.OSVersion[3] = dwMinorVersion & 0xFF;
+	req1.OSVersion[4] = (dwBuildNumber >> 8) & 0xFF;
+	req1.OSVersion[5] = dwBuildNumber & 0xFF;
+#endif
+	
+
+
 
 	strncpy(req1.Sites, info.strSite, sizeof(req1.Sites)-1);
 

+ 40 - 12
Module/mod_UpgradeMgr/UpgradeMgrFSM.cpp

@@ -1,4 +1,3 @@
-#include "stdafx.h"
 #include "SpBase.h"
 #include "UpgradeMgrFSM.h"
 #include "mod_UpgradeMgr.h"
@@ -6,7 +5,7 @@
 #include <algorithm>
 //#include "EventCode.h"
 #include "fileutil.h"
-#include "WMIDeviceQuery.h"
+
 
 #include "UpgradeManager_msg_g.h"
 #include "PinPad_client_g.h"
@@ -14,6 +13,13 @@ using namespace PinPad;
 
 #include "DeviceBaseClass.h"
 #include "EventCode.h"
+
+#ifdef RVC_OS_WIN
+#include "WMIDeviceQuery.h"
+#else
+
+#endif 
+
 // 上报状态机(并负责轮询升级)
 #define UPGRADE_POLL_INTERVAL 30000			// 升级轮询间隔 
 
@@ -497,14 +503,19 @@ bool CUpgradeMgrFSM::IsPackDownloaded(const char *pPackName)
 	auto rc = m_pEntity->GetFunction()->GetPath("Downloads", strPath);
 	assert(rc == Error_Succeed);
 	
-	CSimpleStringA strZipFile = CSimpleStringA::Format("%s\\%s", (const char*)strPath, pPackName);
+	CSimpleStringA strZipFile = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "%s", (const char*)strPath, pPackName);
 
 	//此处什么场景下会发生?
 	if (!strZipFile.IsEndWith(".zip") && !strZipFile.IsEndWith(".cab"))
 		strZipFile += ".zip";
-
-	DWORD attr = GetFileAttributesA(strZipFile);	
+#ifdef RVC_OS_WIN
+	DWORD attr = GetFileAttributesA(strZipFile);
 	return (attr != INVALID_FILE_ATTRIBUTES) && !(attr & FILE_ATTRIBUTE_DIRECTORY);
+#else
+	return ExistsFileA(strZipFile);
+#endif
+	
+
 }
 
 bool CUpgradeMgrFSM::IsPackCancelled(const char *pPackName)
@@ -1131,7 +1142,6 @@ DWORD CUpgradeMgrFSM::GetManualPacks(CSimpleStringA &strManualPacks)
 
 	return ERROR_SUCCESS;
 }
-ErrorCodeEnum ;
 
 void CUpgradeMgrFSM::CancelUpgradePacks(RvcCommRetEvent *pEvent)
 {
@@ -1380,12 +1390,13 @@ bool CUpgradeMgrFSM::WriteInstallLog(const char *pszPackName, const char *pszLog
 	m_pEntity->GetFunction()->GetPath("RunInfo", strPath);
 
 	// 创建安装包日志文件
-	CSimpleStringA strInstallLogDir = CSimpleStringA::Format("%s\\InstallLog", (const char*)strPath);
-	if (!ExistsDirA(strInstallLogDir))
-		CreateDirectoryA(strInstallLogDir, NULL);
+	CSimpleStringA strInstallLogDir = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "InstallLog", (const char*)strPath);
+	if (!ExistsDirA(strInstallLogDir)) {
+		CreateDirA(strInstallLogDir, false);
+	}
 
 	// 写安装包日志
-	CSimpleStringA strInstallLog = CSimpleStringA::Format("%s\\%s.log", (const char*)strInstallLogDir, pszPackName);
+	CSimpleStringA strInstallLog = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "%s.log", (const char*)strInstallLogDir, pszPackName);
 	FILE *pInstallLog = fopen(strInstallLog, "a+");
 	if (pInstallLog == NULL)
 	{
@@ -1664,7 +1675,7 @@ bool CUpgradeMgrFSM::CheckIfInstallCancelled()
 
 			CSimpleStringA strRootVerPath;
 			m_pEntity->GetFunction()->GetPath("RootVer", strRootVerPath);
-			CSimpleStringA strNewVerPath = CSimpleStringA::Format("%s\\%s", (const char*)strRootVerPath, (const char*)m_strNewVersion);
+			CSimpleStringA strNewVerPath = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "%s", (const char*)strRootVerPath, (const char*)m_strNewVersion);
 
 			if (ExistsDirA(strNewVerPath))
 			{
@@ -1895,9 +1906,16 @@ bool CUpgradeMgrFSM::CheckIfCanSwitchNow()
 	rc = pFunc->GetSysVar("CallState", strCallState);
 	assert(rc == Error_Succeed);
 
+#ifdef RVC_OS_WIN
 	SYSTEMTIME st = {};
 	GetLocalTime(&st);
 	bool bOffworkTime = st.wHour < 8 || st.wHour >= 18;
+#else
+	time_t nowTime = time(NULL);
+	tm nowTimeTm = { 0 };
+	localtime_r(&nowTime, &nowTimeTm);
+	bool bOffworkTime = nowTimeTm.tm_hour < 8 || nowTimeTm.tm_hour >= 18;
+#endif
 
 	Dbg("strCustomerHandle=%s, strCallState=%s, bOffworkTime=%d",strCustomerHandle,strCallState,bOffworkTime);
 
@@ -2150,6 +2168,9 @@ CSimpleStringA CUpgradeMgrFSM::GetSysPatchNameFromPackName(const char *pszPackNa
 //获取系统补丁升级结果
 bool CUpgradeMgrFSM::GetServerPackUpgradeResult(const char *pszPackageName, CSimpleStringA &strVerison, CSimpleStringA &strErrMsg)
 {
+#ifdef RVC_OS_WIN
+
+
 	char szTmp[4096] = {};
 	int nTmpBufLen = 4096;//win7补丁可能有200多个,每个补丁(如KB3105211加分隔符;)需要10个字节
 
@@ -2176,6 +2197,9 @@ bool CUpgradeMgrFSM::GetServerPackUpgradeResult(const char *pszPackageName, CSim
 	strVerison = strPatchName;
 
 	return true;
+#else
+	return true;
+#endif
 }
 
 //获取固件升级结果
@@ -2349,7 +2373,11 @@ ErrorCodeEnum CUpgradeMgrFSM::UpdateInstallFailedPackInfo(CSimpleStringA strPack
 					char buf[16] = {0};
 					CSimpleStringA strNew = strName;
 					strNew += ",";
-					itoa(nNewCount,buf,10);
+#ifdef RVC_OS_WIN
+					itoa(nNewCount, buf, 10);
+#else
+					sprintf(buf, "%d", nNewCount);
+#endif		
 					strNew += buf;
 
 					arr[i] = strNew;

+ 7 - 1
Module/mod_UpgradeMgr/UpgradeMgrFSM.h

@@ -7,7 +7,13 @@
 #include "UpgradeMgrConn.h"
 #include <map>
 #include <list>
+
+#ifdef RVC_OS_WIN
 #include <WinBase.h>
+#else
+
+#endif
+
 using namespace std;
 
 #define  NOT_MANUALPACK_ERR		   0xF0000001         // ²»ÊÇÊÖ¶¯Éý¼¶°ü
@@ -197,7 +203,7 @@ public:
 	{
 		RvcCommRetEvent(int nEventID, BYTE *pBuf, int nArrayNum) : FSMEvent(nEventID)
 		{
-			param1 = (int)pBuf;
+			param1 = (param_size_t)pBuf;
 			param2 = nArrayNum;
 		}
 

+ 154 - 10
Module/mod_UpgradeMgr/mod_UpgradeMgr.cpp

@@ -15,11 +15,18 @@ using namespace AccessAuthorization;
 
 #include "EventCode.h"
 #include "md5file.h"
-#include <io.h>
+
 #include "fileutil.h"
 #include <regex>
 #include "RVCComm.h"
 
+#ifdef RVC_OS_WIN
+#include <io.h>
+#else
+#include <unistd.h>
+#include <dirent.h>
+#endif
+
 namespace Task
 {
 	struct GetMD5Task : public ITaskSp
@@ -274,8 +281,8 @@ ErrorCodeEnum CUpgradeMgrEntity::RollbackUpdate(const CSimpleStringA &strVersion
 	{
 		Dbg("try rollback to version: [%s]", (const char*)strVersion);
 		int w1, w2, w3, w4;
-		int rc = sscanf(strVersion, "%d.%d.%d.%d", &w1, &w2, &w3, &w4);
-		if (rc <4)
+		int ret = sscanf(strVersion, "%d.%d.%d.%d", &w1, &w2, &w3, &w4);
+		if (ret <4)
 		{
 			Dbg("version [%s] parse fail", (const char*)strVersion);
 			rc=  Error_Param;
@@ -512,14 +519,15 @@ ErrorCodeEnum CUpgradeMgrEntity::SM3DataToStr(CSimpleStringA strData, CSimpleStr
 //修改成sm3加密
 ErrorCodeEnum CUpgradeMgrEntity::MD5Folder(CSimpleStringA strFolderPath,bool isDepDIr)
 {
+
 	if (strFolderPath.IsNullOrEmpty())
 	{
 		return Error_Null;
 	}
 	Dbg("Start to get file hash list, dir=[%s] ", strFolderPath);
-
+#ifdef RVC_OS_WIN
 	_finddata_t FileInfo;
-	CSimpleStringA strfind = strFolderPath + "\\*";
+	CSimpleStringA strfind = strFolderPath + SPLIT_SLASH_STR+"*";
 	long Handle = _findfirst(strfind, &FileInfo);
 	if (-1L == Handle)
 	{
@@ -551,20 +559,20 @@ ErrorCodeEnum CUpgradeMgrEntity::MD5Folder(CSimpleStringA strFolderPath,bool isD
 				}
 				
 				if(isBlackDir){
-					CSimpleStringA dirPath = strFolderPath + "\\" + FileInfo.name;
+					CSimpleStringA dirPath = strFolderPath + SPLIT_SLASH_STR + FileInfo.name;
 					Dbg("BlackDir Filter don't add to md5 list, dir=[%s]", dirPath.GetData());
 					continue;//跳过文件夹
 				}else{
 					//判断是否是dep文件夹或者是dep文件夹下面的子文件夹
 					if(strcmp(FileInfo.name, "dep") == 0||isDepDIr){
-						newPath = strFolderPath + "\\" + FileInfo.name;
+						newPath = strFolderPath + SPLIT_SLASH_STR + FileInfo.name;
 						ErrorCodeEnum rc = MD5Folder(newPath,true);
 						if(Error_Succeed!=rc){
 							_findclose(Handle);
 							return rc;
 						}
 					}else{
-						newPath = strFolderPath + "\\" + FileInfo.name;
+						newPath = strFolderPath + SPLIT_SLASH_STR + FileInfo.name;
 						ErrorCodeEnum rc = MD5Folder(newPath);
 						if(Error_Succeed!=rc){
 							_findclose(Handle);
@@ -644,7 +652,7 @@ ErrorCodeEnum CUpgradeMgrEntity::MD5Folder(CSimpleStringA strFolderPath,bool isD
 					}
 				}
 
-				CSimpleStringA strFilePath = strFolderPath + "\\" + strFindName;
+				CSimpleStringA strFilePath = strFolderPath + SPLIT_SLASH_STR + strFindName;
 				CSimpleStringA strMD5Val;
 				//ErrorCodeEnum rErrcode = MD5File(strFilePath, strMD5Val);
 				//修改为SM3进行哈希
@@ -663,6 +671,142 @@ ErrorCodeEnum CUpgradeMgrEntity::MD5Folder(CSimpleStringA strFolderPath,bool isD
 
 	_findclose(Handle);
 	return Error_Succeed;
+#else
+	//循环扫描文件算出文件hash值
+	DIR* dir;
+	struct dirent* entry;
+	CSimpleStringA newPath;
+
+	if ((dir = opendir(strFolderPath.GetData())) == NULL)
+	{
+		Dbg("open dir fail:%d", errno);
+		return Error_Unexpect;
+	}
+	while ((entry = readdir(dir)) != NULL)
+	{
+		if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0)
+		{//current dir OR parrent dir
+			continue;
+		}
+		else if (entry->d_type == 4)
+		{//dir
+			CSimpleStringA strFindName = entry->d_name;
+			//整个黑名单文件夹过滤
+			bool isBlackDir = false;
+			list<CSimpleStringA>::iterator itor = m_fsm.m_DirBlacklist.begin();
+			while (itor != m_fsm.m_DirBlacklist.end())
+			{
+				CSimpleStringA dirBlack = *itor;
+				if (strcmp(dirBlack.GetData(), entry->d_name) == 0) {
+					isBlackDir = true;
+					break;
+				}
+				itor++;
+			}
+
+			if (isBlackDir) {
+				CSimpleStringA dirPath = strFolderPath + SPLIT_SLASH_STR + entry->d_name;
+				Dbg("BlackDir Filter don't add to md5 list, dir=[%s]", dirPath.GetData());
+				continue;//跳过文件夹
+			}
+			else {
+				//判断是否是dep文件夹或者是dep文件夹下面的子文件夹
+				if (strcmp(entry->d_name, "dep") == 0 || isDepDIr) {
+					newPath = strFolderPath + SPLIT_SLASH_STR + entry->d_name;
+					ErrorCodeEnum rc = MD5Folder(newPath, true);
+					if (Error_Succeed != rc) {
+						closedir(dir);
+						return rc;
+					}
+				}
+				else {
+					newPath = strFolderPath + SPLIT_SLASH_STR + entry->d_name;
+					ErrorCodeEnum rc = MD5Folder(newPath);
+					if (Error_Succeed != rc) {
+						closedir(dir);
+						return rc;
+					}
+				}
+			}
+
+		}
+		else if (entry->d_type == 8)
+		{//file
+			CSimpleStringA strFindName = entry->d_name;
+			{
+				if (strFindName.IndexOf(".") == -1)
+				{
+					Dbg("%s file name is illegal", strFindName);
+					continue;
+				}
+				//整体黑名单文件过滤
+				bool isBlackFile = false;
+				list<CSimpleStringA>::iterator itor = m_fsm.m_FileBlacklist.begin();
+				while (itor != m_fsm.m_FileBlacklist.end())
+				{
+					CSimpleStringA fileBlack = *itor;
+					if (strFindName.IsEndWith(fileBlack.GetData(), true)) {
+						isBlackFile = true;
+						break;
+					}
+					itor++;
+				}
+				if (isBlackFile) {
+					Dbg("BlackFile Filter don't add to md5 list, file = [%s]", strFindName.GetData());
+					continue;
+				}
+				//对历史遗留的centerSetting错误缓存文件特殊处理,不纳入hash文件列表
+				//对所有集中配置文件都过滤,规则是CenterSetting.*.ini*
+				regex e("CenterSetting[.][^.]*[.]ini.*");
+				if (std::regex_match(strFindName.GetData(), e, regex_constants::match_default)) {
+					continue;
+				}
+
+				//判断是否需要用dep白名单过滤
+				if (isDepDIr) {
+					bool isWhiteFile = false;
+					list<CSimpleStringA>::iterator itor = m_fsm.m_DepWhitelist.begin();
+					while (itor != m_fsm.m_DepWhitelist.end())
+					{
+						CSimpleStringA fileWhite = *itor;
+						if (strFindName.IsEndWith(fileWhite.GetData(), true)) {
+							isWhiteFile = true;
+							break;
+						}
+						itor++;
+					}
+					//不是白名单也不是默认so文件,不需要加入hash计算
+					if (!isWhiteFile && !strFindName.IsEndWith(".so", true)) {
+						Dbg("WhiteFile Filter don't add to md5 list, file = [%s]", strFindName.GetData());
+						continue;
+					}
+				}
+
+				CSimpleStringA strFilePath = strFolderPath + SPLIT_SLASH_STR + strFindName;
+				CSimpleStringA strMD5Val;
+				//ErrorCodeEnum rErrcode = MD5File(strFilePath, strMD5Val);
+				//修改为SM3进行哈希
+				ErrorCodeEnum rErrcode = SM3FileToStr(strFilePath, strMD5Val, false);
+				if (Error_Succeed != rErrcode)
+				{
+					Dbg("%s获取MD5失败,错误码:%d", strFilePath.GetData(), (int)rErrcode);
+					closedir(dir);
+					return rErrcode;
+				}
+
+				m_FileHashMap[strFilePath] = strMD5Val;
+			}
+
+		}
+		else if (entry->d_type == 10)
+		{//link file,暂不处理
+			continue;
+		}
+	}
+	closedir(dir);
+	return Error_Succeed;
+#endif
+	
 }
 ErrorCodeEnum CUpgradeMgrEntity::GetMD5List(CSimpleStringA &strMD5List)
 {
@@ -686,7 +830,7 @@ ErrorCodeEnum CUpgradeMgrEntity::GetMD5List(CSimpleStringA &strMD5List)
 	CSimpleStringA strRootVerPath;
 	this->GetFunction()->GetPath("RootVer", strRootVerPath);
 	Dbg("strRootVerPath %s,curVer:%s", strRootVerPath.GetData(),curVer.GetData());
-	CSimpleStringA strCurVerPath = CSimpleStringA::Format("%s\\%s", (const char*)strRootVerPath, (const char*)curVer);
+	CSimpleStringA strCurVerPath = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "%s", (const char*)strRootVerPath, (const char*)curVer);
 
 	if (!ExistsDirA(strCurVerPath))
 	{

+ 5 - 3
Module/mod_UpgradeMgr/mod_UpgradeMgr.h

@@ -1,7 +1,6 @@
 #ifndef RVC_MOD_UPGRADEMGR_H_
 #define RVC_MOD_UPGRADEMGR_H_
 
-#include "stdafx.h"
 #include "SpBase.h"
 #include "SimpleString.h"
 #include "UpgradeManager_server_g.h"
@@ -70,7 +69,7 @@ public:
 
 	ErrorCodeEnum StopMediaPlay();
 	
-	SP_BEGIN_MSG_DISPATCH_MAP(CUpgradeMgrEntity)
+	/*SP_BEGIN_MSG_DISPATCH_MAP(CUpgradeMgrEntity)
 		SP_BEGIN_ENTITY_MSG("Download")
 			SP_MSG_HANDLE_NS(Download, DownloadResult, OnDownloadEvent)
 		SP_END_ENTITY_MSG()
@@ -79,7 +78,10 @@ public:
 			SP_MSG_HANDLE_NS(UpgradeRun, UpgradeDoneEvent, OnUpgradeDoneEvent)
 		SP_END_ENTITY_MSG()
 	SP_END_MSG_DISPATCH_MAP()
-
+	*/
+	virtual void OnBroadcastEvent(CUUID SubID, const char* pszEntityName, DWORD dwMessageId, DWORD dwMessageSignature, CAutoBuffer Buffer)
+	{
+	}
 public:
 	CUpgradeMgrFSM m_fsm;
 	map<CSimpleStringA, CSimpleStringA> m_FileHashMap;		// °æ±¾ÎļþhashÖµ¼¯ºÏ

+ 7 - 0
Module/mod_UpgradeMgr/test/TestMod_UpgradeMgr.cpp

@@ -0,0 +1,7 @@
+#include "mod_UpgradeMgr.h"
+
+TEST_CASE_ENTITY_CLASS(CUpgradeMgrEntity, "")
+{
+	LOG_FUNCTION();
+	return Error_Succeed;
+}