def doSpin(self, game_id, lv, lines, bet, is_free, fake_flag): weight = PayTable.getSymbolWeight(self.game_id, lv, is_free, bet, fake_flag) slots = self.genLayout(game_id, weight) #final result checking bonus_num = 0 spin_num = 0 response = {} pay_out, ret = self.recheck(game_id, lines, slots) if pay_out != 0: response['win_lines'] = ret combo = self.check5Combo(ret, slots) if combo: response["5combo"] = combo response['symbols'] = slots response['win'] = pay_out * bet bonus = self.check_bonus(slots, lines) if bonus: (bonus_num, line, pos) = bonus response['win_bonus'] = {'line': line, 'pos': pos} scatter = self.check_scatter(slots) if scatter: (pos, n) = scatter spin_num = FreeSpin.getNum(game_id, n) response['win_free_spin'] = {'pos': pos, 'num': spin_num} return (response, pay_out * bet, bonus_num, spin_num)