Fix item code generation

This commit is contained in:
Bluzume 2019-09-09 00:47:20 +12:00 committed by GitHub
parent 2b1377cc29
commit 57740be0a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -114,7 +114,7 @@ def CgiGetCode():
if gotchiPoints < 0 or gotchiPoints > 5:
output['ResultCode']="ERROR"
return
if itemId < 0 or itemId > 999:
if itemId < 0 or itemId > 99:
output['ResultCode']="ERROR"
return
if codeType < 0 or codeType > 4:
@ -139,13 +139,13 @@ def CgiGetCode():
tamaIndex = GetTamaIndex(loginNo,type)
iid = str(itemId)
while len(iid) != 3:
while len(iid) != 2:
iid = "0"+iid
ggp = str(gotchiPoints)
while len(ggp) != 2:
ggp = "0"+ggp
logoutNo = str(codeType)+str(region)+iid+str(tamaIndex[0])+ggp+str(tamaIndex[1])
logoutNo = str(codeType)+str(region)+iid[0]+"0"+iid[1]+str(tamaIndex[0])+ggp+str(tamaIndex[1])
logoutNo += str(CheckBit(logoutNo,False,9))
output['PasswordUp'] = logoutNo[:5]
output['PasswordDown'] = logoutNo[5:]