Skip to content

Commit 9592a50

Browse files
committed
fixed:day and second serial process error
1 parent 404c16f commit 9592a50

File tree

4 files changed

+39
-19
lines changed

4 files changed

+39
-19
lines changed

XEngine.sln

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ EndProject
5959
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XEngine_Verification", "XEngine_Module\XEngine_Verification\XEngine_Verification.vcxproj", "{A8E43EC0-698A-4807-8A61-B2BE5FAB7256}"
6060
EndProject
6161
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Verification_APPExample", "XEngine_Example\Verification_APPExample\Verification_APPExample.vcxproj", "{6DDE9B0B-5DDA-47B0-BF6F-ADF47EC8568A}"
62+
ProjectSection(ProjectDependencies) = postProject
63+
{A8E43EC0-698A-4807-8A61-B2BE5FAB7256} = {A8E43EC0-698A-4807-8A61-B2BE5FAB7256}
64+
EndProjectSection
6265
EndProject
6366
Global
6467
GlobalSection(SolutionConfigurationPlatforms) = preSolution

XEngine_Example/Verification_APPExample/Verification_APPExample.vcxproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,18 @@
109109
<LibraryPath>$(XEngine_LibArm64);$(LibraryPath)</LibraryPath>
110110
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
111111
</PropertyGroup>
112+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
113+
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
114+
<LibraryPath>$(XEngine_LibArm64);$(LibraryPath)</LibraryPath>
115+
</PropertyGroup>
116+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
117+
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
118+
<LibraryPath>$(XEngine_Lib32);$(LibraryPath)</LibraryPath>
119+
</PropertyGroup>
120+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
121+
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
122+
<LibraryPath>$(XEngine_Lib64);$(LibraryPath)</LibraryPath>
123+
</PropertyGroup>
112124
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
113125
<ClCompile>
114126
<WarningLevel>Level3</WarningLevel>

XEngine_Module/XEngine_Verification/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ FILEEXT =
55
LIBFLAG =
66
LOADHDR = -I ./ -I ../jsoncpp
77
LOADSO = -L ../jsoncpp
8-
LIB = -lXEngine_BaseLib -lXEngine_BaseSafe -lXEngine_Cryption -lRfcComponents_HttpProtocol -ljsoncpp
8+
LIB = -lXEngine_BaseLib -lXEngine_BaseSafe -lXEngine_Cryption -lRfcComponents_HttpProtocol -lXEngine_SystemConfig -lXEngine_SystemApi -ljsoncpp
99
LIBEX =
1010
OBJECTS = Verification_HTTP.o Verification_OAuth.o Verification_XAuthKey.o Verification_XAuthNet.o pch.o
1111

XEngine_Module/XEngine_Verification/Verification_XAuth/Verification_XAuthKey.cpp

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,25 @@ bool CVerification_XAuthKey::Verification_XAuthKey_FileRead(VERIFICATION_XAUTHKE
8383
return false;
8484
}
8585
}
86-
BaseLib_Time_TimeToStr(pSt_XAuthInfo->st_AuthRegInfo.tszStartTime);
86+
87+
if (ENUM_AUTHORIZE_MODULE_SERIAL_TYPE_DAY == pSt_XAuthInfo->st_AuthRegInfo.enSerialType)
88+
{
89+
XENGINE_LIBTIME st_SysTime = {};
90+
XENGINE_LIBTIME st_EndTime = {};
91+
BaseLib_Time_GetSysTime(&st_SysTime);
92+
BaseLib_Time_StrToTime(pSt_XAuthInfo->st_AuthRegInfo.tszStartTime, &st_EndTime);
93+
if ((st_EndTime.wYear != st_SysTime.wYear) || (st_EndTime.wMonth != st_SysTime.wMonth) || (st_EndTime.wDay != st_SysTime.wDay))
94+
{
95+
pSt_XAuthInfo->st_AuthRegInfo.nHasTime--;
96+
_xstprintf(pSt_XAuthInfo->st_AuthRegInfo.tszLeftTime, _X("%lld"), pSt_XAuthInfo->st_AuthRegInfo.nHasTime);
97+
BaseLib_Time_TimeToStr(pSt_XAuthInfo->st_AuthRegInfo.tszStartTime);
98+
}
99+
}
100+
else
101+
{
102+
BaseLib_Time_TimeToStr(pSt_XAuthInfo->st_AuthRegInfo.tszStartTime);
103+
}
104+
pSt_XAuthInfo->st_AuthAppInfo.nExecTime++;
87105
return true;
88106
}
89107
/********************************************************************
@@ -120,15 +138,13 @@ bool CVerification_XAuthKey::Verification_XAuthKey_FileWrite(VERIFICATION_XAUTHK
120138
//更新使用时间
121139
if (ENUM_AUTHORIZE_MODULE_SERIAL_TYPE_SECOND == pSt_XAuthInfo->st_AuthRegInfo.enSerialType)
122140
{
123-
XCHAR tszTimeStart[64];
124-
XCHAR tszTimeEnd[64];
141+
XCHAR tszTimeEnd[64] = {};
125142
__int64x nUsedTime = 0;
126143

127-
memset(tszTimeStart, '\0', sizeof(tszTimeStart));
128-
memset(tszTimeEnd, '\0', sizeof(tszTimeEnd));
129144
BaseLib_Time_TimeToStr(tszTimeEnd);
130145
BaseLib_TimeSpan_GetForStr(pSt_XAuthInfo->st_AuthRegInfo.tszStartTime, tszTimeEnd, &nUsedTime, ENUM_XENGINE_BASELIB_TIME_TYPE_SECOND);
131146
pSt_XAuthInfo->st_AuthRegInfo.nHasTime -= nUsedTime;
147+
_xstprintf(pSt_XAuthInfo->st_AuthRegInfo.tszLeftTime, _X("%lld"), pSt_XAuthInfo->st_AuthRegInfo.nHasTime);
132148
}
133149
//准备数据
134150
if (!Verification_XAuthKey_WriteMemory(tszDECodecBuffer, &nSize, pSt_XAuthInfo))
@@ -216,17 +232,7 @@ bool CVerification_XAuthKey::Verification_XAuthKey_KeyParse(VERIFICATION_XAUTHKE
216232
{
217233
//其他类型的注册机制
218234
BaseLib_Time_GetSysTime(&st_SysTimer);
219-
//计算超时时间
220-
if (ENUM_AUTHORIZE_MODULE_SERIAL_TYPE_DAY == pSt_XAuthInfo->st_AuthRegInfo.enSerialType)
221-
{
222-
BaseLib_Time_GetSysTime(&st_SysTimer);
223-
BaseLib_Time_StrToTime(pSt_XAuthInfo->st_AuthRegInfo.tszStartTime, &st_EndTimer);
224-
if ((st_EndTimer.wYear != st_SysTimer.wYear) || (st_EndTimer.wMonth != st_SysTimer.wMonth) || (st_EndTimer.wDay != st_SysTimer.wDay))
225-
{
226-
pSt_XAuthInfo->st_AuthRegInfo.nHasTime--;
227-
}
228-
}
229-
else if (ENUM_AUTHORIZE_MODULE_SERIAL_TYPE_SECOND == pSt_XAuthInfo->st_AuthRegInfo.enSerialType)
235+
if (ENUM_AUTHORIZE_MODULE_SERIAL_TYPE_SECOND == pSt_XAuthInfo->st_AuthRegInfo.enSerialType)
230236
{
231237
XCHAR tszTimeEnd[64] = {};
232238
__int64x nUsedTime = 0;
@@ -262,8 +268,7 @@ bool CVerification_XAuthKey::Verification_XAuthKey_KeyParse(VERIFICATION_XAUTHKE
262268
return false;
263269
}
264270
}
265-
pSt_XAuthInfo->st_AuthAppInfo.nExecTime++;
266-
271+
267272
SYSTEMAPI_SERIAL_INFOMATION st_SDKSerial = {};
268273
SystemApi_HardWare_GetSerial(&st_SDKSerial);
269274
if (ENUM_AUTHORIZE_MODULE_VERMODE_TYPE_LOCAL != pSt_XAuthInfo->st_AuthRegInfo.enVModeType)

0 commit comments

Comments
 (0)