Ejemplo n.º 1
0
        def make_led_mo(newleds, clientVer, clientId):
            mo = MsgPack()
            mo.setCmd('led')

            if clientVer >= 3.6:
                if ledWithTodoTask:
                    mo.setKey('result', ledWithTodoTask)
                    return mo.pack()
                return None

            if newleds['origLeds']:
                mo.setKey('result', newleds['origLeds'])
            if newleds['richLeds']:
                mo.setKey('result', newleds['richLeds'])
                mo.setKey('richText', newleds['richLeds'])
                mo.setResult('gameId', gameId)

                if gameId == 8:
                    if clientVer < 3.0:
                        # 德州老单包有问题,所有格式都转为没有按钮的LED (也就是type='led')
                        newleds['richLeds']['type'] = 'led'
                    elif newleds['richLeds'][
                            'type'] == 'vip' and clientVer == 3.37 and 'hall8' in clientId:
                        # 德州大厅3.37版本BUG: 如果消息中有 richText,则收不到消息
                        mo.rmKey('richText')
            if popWinInfo and clientId.startswith('Winpc'):
                mo.setResult('popWin', popWinInfo)
            return mo.pack()