Skip to content

Commit 2d8540d

Browse files
committed
modify:Password types support int and words
1 parent ff28956 commit 2d8540d

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/Plugin_Password/Plugin_Password.cpp

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,23 @@ BOOL CPlugin_Password::Plugin_Password_Creator(LPCTSTR lpszPassType, LPCTSTR lps
113113
TCHAR tszPassBuffer[MAX_PATH];
114114

115115
memset(tszPassBuffer, '\0', MAX_PATH);
116-
BaseLib_OperatorHandle_CreateStr(tszPassBuffer, nLen);
117-
118-
_tcscpy(ptszPassStr, tszPassBuffer);
116+
if (0 == nType)
117+
{
118+
BaseLib_OperatorHandle_CreateStr(tszPassBuffer, nLen);
119+
}
120+
else if (1 == nType)
121+
{
122+
for (int i = 0; i < nLen; i++)
123+
{
124+
_stprintf(&tszPassBuffer[i], _T("%d"), rand() % 9);
125+
}
126+
}
127+
else if (2 == nType)
128+
{
129+
for (int i = 0; i < nLen; i++)
130+
{
131+
_stprintf(&tszPassBuffer[i], _T("%c"), (rand() % 26) + 65);
132+
}
133+
}
119134
return TRUE;
120135
}

0 commit comments

Comments
 (0)