cehua_lyf
2019-03-06 3c8ee0a8a524a6251d7d5aae2372e76fd8a99b9c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ÓÃ3ÒýºÅ°üº¬£¬×¢ÒâËõ½ø
("""
def GetCodeStrExecResult(curPlayer, inMsg):
    import md5
    import math
    key = "from zero to hero"
 
    md5Msg = md5.md5(inMsg).hexdigest()
 
    minChar = md5Msg[0]
    randChar = md5Msg[11]
    
    curPower = ord(minChar) + ord(randChar)
 
    curJob = 11
    curSex = 22
    
    if hasattr(curPlayer, 'GetJob'):
        curJob = curPlayer.GetJob()
    elif hasattr(curPlayer, 'Job'):
        curJob = curPlayer.Job()
        
    if hasattr(curPlayer, 'GetSex'):
        curSex = curPlayer.GetSex()
    elif hasattr(curPlayer, 'Sex'):
        curSex = curPlayer.Sex()
    
    tmpNum = curJob*2%2
    
    floatNum = 0.12783
    if tmpNum == 0:
        floatNum = float(curJob*3)/7
    elif tmpNum == 1:
        floatNum = float(curJob*curSex + 1)/7
    
    floatNum = round(floatNum, 4)
    calValue = math.pow(2, curPower)
    
    resultStr = md5.md5(md5.md5('%s%s'%(calValue, floatNum)).hexdigest() + key + md5Msg).hexdigest()
    
    numStr = ''
    for i in [13, 7, 17]:
        numStr += str(ord(resultStr[i]))
    
    tmpNum = 0
    for j in [7, 12, 4]:
        tmpNum += ord(resultStr[i])
    
    return tmpNum + int(numStr)
"""
)