Skip to content

Commit b5a954c

Browse files
committed
bid update defId fix, remove add auction def and combine with update
1 parent e4e256d commit b5a954c

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

core/bid.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def bid(q, api, playerList, settings):
137137
q.put('%s Updating watched items...\n' % (time.strftime('%Y-%m-%d %H:%M:%S')))
138138
for item in api.tradeStatus([tradeId for tradeId in trades]):
139139
item['resourceId'] = trades[item['tradeId']]
140-
baseId = str(api.baseId(item['resourceId']))
140+
baseId = str(abs(item['resourceId'] + 0x80000000))
141141
if baseId not in bidDetails:
142142
continue
143143
maxBid = bidDetails[baseId]['maxBid']
@@ -148,15 +148,14 @@ def bid(q, api, playerList, settings):
148148

149149
tradeId = item['tradeId']
150150
if tradeId not in trades:
151-
break
151+
continue
152152

153153
asset = api.cardInfo(trades[tradeId])
154154
displayName = asset['Item']['CommonName'] if asset['Item']['CommonName'] else asset['Item']['LastName']
155155
card = PlayerCard(item, displayName)
156156

157157
# Handle Expired Items
158158
if item['expires'] == -1:
159-
160159
if (item['bidState'] == 'highest' or (item['tradeState'] == 'closed' and item['bidState'] == 'buyNow')):
161160

162161
# We won! Send to Pile!
@@ -191,7 +190,6 @@ def bid(q, api, playerList, settings):
191190
del trades[tradeId]
192191

193192
elif item['bidState'] != 'highest':
194-
195193
# Continue if we already have too many listed or we don't have enough credits
196194
if listed >= settings['maxPlayer'] or api.credits < settings['minCredits']:
197195
continue
@@ -218,7 +216,7 @@ def bid(q, api, playerList, settings):
218216
# buy now goes directly to unassigned now
219217
if binWon:
220218
for item in api.unassigned():
221-
baseId = str(api.baseId(item['resourceId']))
219+
baseId = str(abs(item['resourceId'] + 0x80000000))
222220
if baseId not in bidDetails:
223221
continue
224222
maxBid = bidDetails[baseId]['maxBid']
@@ -262,7 +260,7 @@ def bid(q, api, playerList, settings):
262260
if not settings['relistAll'] or relistFailed:
263261
q.put('%s Manually re-listing %d players.\n' % (time.strftime('%Y-%m-%d %H:%M:%S'), expired))
264262
for i in tradepile:
265-
baseId = str(api.baseId(i['resourceId']))
263+
baseId = str(abs(item['resourceId'] + 0x80000000))
266264
if baseId in bidDetails:
267265
sell = i['startingBid'] if settings['relistAll'] else bidDetails[baseId]['sell']
268266
binPrice = i['buyNowPrice'] if settings['relistAll'] else bidDetails[baseId]['binPrice']

frames/misc/auctions.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,11 @@ def __init__(self, frame):
5656
def get_view(self):
5757
return self.view
5858

59-
def add_auction(self, card, timestamp, currbid, index='end', tag=''):
59+
def update_status(self, card, timestamp, currbid, tag=''):
6060
if not card.cardid in self.cards:
61-
return self.tree.insert("", index, card.cardid, text=card.cardname, values=(timestamp, card.startingBid,
61+
self.tree.insert("", 'end', card.cardid, text=card.cardname, values=(timestamp, card.startingBid,
6262
currbid, card.buyNowPrice,
6363
card.expires), tags=(tag,))
64-
65-
def update_status(self, card, timestamp, currbid, tag=''):
66-
if not card.cardid in self.cards:
67-
self.add_auction(card, timestamp, currbid, 'end', tag)
6864
else:
6965
options = self.tree.item(card.cardid)
7066
options['values'] = (timestamp, card.startingBid,

0 commit comments

Comments
 (0)