1. def ManagerItemshop(self, cmd):
  2. cmd = cmd.split('#')
  3. if cmd[0] == 'QID':
  4. constInfo.ItemShop['QID'] = int(cmd[1])
  5. elif cmd[0] == 'INPUT':
  6. constInfo.INPUT_IGNORE = int(cmd[1])
  7. elif cmd[0] == 'SEND':
  8. net.SendQuestInputStringPacket(str(constInfo.ItemShop['QCMD']))
  9. constInfo.ItemShop['QCMD'] = ''
  10. elif cmd[0] == 'CREATE_CATEGORY':
  11. constInfo.ItemShop['ITEMS'][cmd[1]][int(cmd[2])] = []
  12. elif cmd[0] == 'SET_ITEM':
  13. constInfo.ItemShop['ITEMS'][cmd[1]][int(cmd[2])].append([int(cmd[3]), int(cmd[4]), int(cmd[5]), [(int(cmd[6]), int(cmd[7])), (int(cmd[8]), int(cmd[9])), (int(cmd[10]), int(cmd[11])), (int(cmd[12]), int(cmd[13])), (int(cmd[14]), int(cmd[15])), (int(cmd[16]), int(cmd[17])), (int(cmd[18]), int(cmd[19]))], [int(cmd[20]), int(cmd[21]), int(cmd[22])], int(cmd[23]), int(cmd[24]), int(cmd[25])])
  14. elif cmd[0] == 'CLEAR_CONTENT':
  15. constInfo.ItemShop['ITEMS']['mostBought'] = []
  16. constInfo.ItemShop['ITEMS']['hotOffers'] = []
  17. elif cmd[0] == 'SET_ITEM_MOSTBOUGHT':
  18. constInfo.ItemShop['ITEMS']['mostBought'].append([int(cmd[1]), int(cmd[2]), int(cmd[3]), [(int(cmd[4]), int(cmd[5])), (int(cmd[6]), int(cmd[7])), (int(cmd[8]), int(cmd[9])), (int(cmd[10]), int(cmd[11])), (int(cmd[12]), int(cmd[13])), (int(cmd[14]), int(cmd[15])), (int(cmd[16]), int(cmd[17]))], [int(cmd[17]), int(cmd[19]), int(cmd[20])], int(cmd[21]), int(cmd[22]), int(cmd[23])])
  19. elif cmd[0] == 'SET_ITEM_HOTOFFERS':
  20. constInfo.ItemShop['ITEMS']['hotOffers'].append([int(cmd[1]), int(cmd[2]), int(cmd[3]), [(int(cmd[4]), int(cmd[5])), (int(cmd[6]), int(cmd[7])), (int(cmd[8]), int(cmd[9])), (int(cmd[10]), int(cmd[11])), (int(cmd[12]), int(cmd[13])), (int(cmd[14]), int(cmd[15])), (int(cmd[16]), int(cmd[17]))], [int(cmd[17]), int(cmd[19]), int(cmd[20])], int(cmd[21]), int(cmd[22]), int(cmd[23])])
  21. elif cmd[0] == 'SET_LOG':
  22. constInfo.ItemShop['LOGS'].append([int(cmd[1]), int(cmd[2]), int(cmd[3]), cmd[4], [(int(cmd[5]), int(cmd[6])), (int(cmd[7]), int(cmd[8])), (int(cmd[9]), int(cmd[10])), (int(cmd[11]), int(cmd[12])), (int(cmd[13]), int(cmd[14])), (int(cmd[15]), int(cmd[16])), (int(cmd[17]), int(cmd[18]))], [int(cmd[19]), int(cmd[20]), int(cmd[21])]])
  23. elif cmd[0] == 'SEND_COINS':
  24. constInfo.COINS_DRS = [int(cmd[1]), int(cmd[2])]
  25. elif cmd[0] == 'SEND_3RD_SHOP_COIN':
  26. self.interface.wndItemShop.Set3rdCoins(int(cmd[1]))
  27. elif cmd[0] == 'ALLOW_SPIN_WHEEL':
  28. self.interface.wndItemShop.SpinWheel()
  29. elif cmd[0] == 'CLEAR_WHEEL_CONTENT':
  30. constInfo.ItemShop['WOD'] = [[], []]
  31. elif cmd[0] == 'SET_WHEEL_PRIZE':
  32. prize = cmd[2].split(',')
  33. if cmd[1] == 'G':
  34. for i in xrange(len(prize)-1):
  35. constInfo.ItemShop['WOD'][1].append(int(prize[i]))
  36. elif cmd[1] == 'B':
  37. for i in xrange(len(prize)-1):
  38. constInfo.ItemShop['WOD'][0].append(int(prize[i]))
  39. elif cmd[0] == 'OPEN':
  40. self.interface.wndItemShop.Open(int(cmd[1]))
  41. elif cmd[0] == 'REFRESH_CONTENT':
  42. self.interface.wndItemShop.RefreshWindow()

game.py