Skip to content

Commit c7d1ed2

Browse files
committed
fixed:app set cdkey time is incorrect
1 parent 7c3bc69 commit c7d1ed2

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

XEngine_Source/AuthorizeModule_CDKey/Authorize_CDKey/Authorize_CDKey.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,7 @@ bool CAuthorize_CDKey::Authorize_CDKey_GetLeftTimer(XENGINE_AUTHORIZE_LOCAL* pSt
975975
}
976976
else
977977
{
978+
pSt_AuthLocal->st_AuthRegInfo.enRegType = ENUM_AUTHORIZE_MODULE_CDKEY_TYPE_EXPIRED;
978979
_xstprintf(pSt_AuthLocal->st_AuthRegInfo.tszExpiryTime, _X("%04d-%02d-%02d %02d:%02d:%02d"), st_SysTimer.wYear, st_SysTimer.wMonth, st_SysTimer.wDay, st_SysTimer.wHour, st_SysTimer.wMinute, st_SysTimer.wSecond);
979980
}
980981
}

XEngine_Source/AuthorizeModule_CDKey/CDKey_Define.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ extern "C" bool Authorize_CDKey_UserRegister(XENGINE_AUTHORIZE_LOCAL* pSt_AuthLo
260260
意思:是否成功
261261
备注:无限制版本不做验证
262262
其他验证nHasTime将被设置还拥有时间
263+
此函数在程序启动的时候必须调用,可以设置更新CDKEY信息也可以验证CDKEY
263264
*********************************************************************/
264265
extern "C" bool Authorize_CDKey_GetLeftTimer(XENGINE_AUTHORIZE_LOCAL * pSt_AuthLocal, LPCXSTR lpszSerialNumber = NULL);
265266
/********************************************************************

XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_CDKey.cpp

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,24 @@ bool CDialog_CDKey::Dialog_CDKey_Write(XENGINE_AUTHORIZE_LOCAL* pSt_AuthorizeCDK
213213
m_EditRegLeftTime.SetWindowText(pSt_AuthorizeCDKey->st_AuthRegInfo.tszLeftTime);
214214
m_StrFormat.Format(_T("%lld"), pSt_AuthorizeCDKey->st_AuthRegInfo.nHasTime);
215215
m_EditRegHaveTime.SetWindowText(m_StrFormat);
216-
m_DateTimeCreate.SetWindowText(pSt_AuthorizeCDKey->st_AuthRegInfo.tszCreateTime);
217-
m_DateTimeRegister.SetWindowText(pSt_AuthorizeCDKey->st_AuthRegInfo.tszRegisterTime);
218-
m_DateTimeStart.SetWindowText(pSt_AuthorizeCDKey->st_AuthRegInfo.tszStartTime);
219-
m_DataTimeRegExpiry.SetWindowTextA(pSt_AuthorizeCDKey->st_AuthRegInfo.tszExpiryTime);
216+
COleDateTime m_OleDTime;
217+
// 尝试解析字符串为日期和时间
218+
if (m_OleDTime.ParseDateTime(pSt_AuthorizeCDKey->st_AuthRegInfo.tszCreateTime))
219+
{
220+
m_DateTimeCreate.SetTime(m_OleDTime);
221+
}
222+
if (m_OleDTime.ParseDateTime(pSt_AuthorizeCDKey->st_AuthRegInfo.tszRegisterTime))
223+
{
224+
m_DateTimeRegister.SetTime(m_OleDTime);
225+
}
226+
if (m_OleDTime.ParseDateTime(pSt_AuthorizeCDKey->st_AuthRegInfo.tszStartTime))
227+
{
228+
m_DateTimeStart.SetTime(m_OleDTime);
229+
}
230+
if (m_OleDTime.ParseDateTime(pSt_AuthorizeCDKey->st_AuthRegInfo.tszExpiryTime))
231+
{
232+
m_DataTimeSerial.SetTime(m_OleDTime);
233+
}
220234

221235
m_ComboRegSerial.SetCurSel(pSt_AuthorizeCDKey->st_AuthRegInfo.enSerialType);
222236
m_ComboRegType.SetCurSel(pSt_AuthorizeCDKey->st_AuthRegInfo.enRegType);
@@ -232,7 +246,11 @@ bool CDialog_CDKey::Dialog_CDKey_Write(XENGINE_AUTHORIZE_LOCAL* pSt_AuthorizeCDK
232246
m_CheckSerialDataAdd.SetCheck(BST_CHECKED);
233247
}
234248
m_EditSerialDataNumber.SetWindowText(pSt_AuthorizeCDKey->st_AuthSerial.st_DataLimit.tszDataSerial);
235-
m_DataTimeSerial.SetWindowText(pSt_AuthorizeCDKey->st_AuthSerial.st_DataLimit.tszDataTime);
249+
// 尝试解析字符串为日期和时间
250+
if (m_OleDTime.ParseDateTime(pSt_AuthorizeCDKey->st_AuthSerial.st_DataLimit.tszDataTime))
251+
{
252+
m_DataTimeSerial.SetTime(m_OleDTime);
253+
}
236254

237255
m_EditSerialUnlimitNumber.SetWindowText(pSt_AuthorizeCDKey->st_AuthSerial.st_UNLimit.tszUNLimitSerial);
238256
//用户信息

0 commit comments

Comments
 (0)