|
|
@ -103,7 +103,7 @@ class SteamClient(SteamPy.Client): |
|
|
|
await asyncio.sleep(timeout) |
|
|
|
|
|
|
|
#Проверка шмота на леквид |
|
|
|
async def on_trade_receive(self, trade: SteamPy.TradeOffer): |
|
|
|
async def on_trade(self, trade: SteamPy.TradeOffer): |
|
|
|
if not self.items: |
|
|
|
info("prices is not setup") |
|
|
|
await self.update_prices() |
|
|
@ -146,27 +146,31 @@ class SteamClient(SteamPy.Client): |
|
|
|
|
|
|
|
info(f"[{trade.id}] Maybe trade acceped...") |
|
|
|
#Force on trade accept |
|
|
|
await asyncio.sleep(3) |
|
|
|
if not trade.id in self.trade_tracker: |
|
|
|
self.trade_tracker[trade.id] = 60 |
|
|
|
|
|
|
|
while self.trade_tracker[trade.id] > 2: |
|
|
|
await asyncio.sleep(1) |
|
|
|
self.trade_tracker[trade.id] -= 1 |
|
|
|
await self.on_trade_accept(trade) |
|
|
|
#await asyncio.sleep(3) |
|
|
|
#if not trade.id in self.trade_tracker: |
|
|
|
# self.trade_tracker[trade.id] = 60 |
|
|
|
|
|
|
|
#while self.trade_tracker[trade.id] > 2: |
|
|
|
# await asyncio.sleep(1) |
|
|
|
# self.trade_tracker[trade.id] -= 1 |
|
|
|
#await self.on_trade_accept(trade) |
|
|
|
return |
|
|
|
|
|
|
|
#Принятый трейд |
|
|
|
async def on_trade_accept(self, trade: SteamPy.TradeOffer): |
|
|
|
async def on_trade_update(self, before: SteamPy.TradeOffer, after: SteamPy.TradeOffer): |
|
|
|
trade:SteamPy.TradeOffer = after |
|
|
|
if trade.state != SteamPy.enums.TradeOfferState.Accepted: |
|
|
|
return |
|
|
|
|
|
|
|
info(f"[{trade.id}] Finalize accept") |
|
|
|
if trade.id in self.trade_tracker and self.trade_tracker[trade.id] == 0: |
|
|
|
"""if trade.id in self.trade_tracker and self.trade_tracker[trade.id] == 0: |
|
|
|
return |
|
|
|
|
|
|
|
if trade.id in self.trade_tracker and self.trade_tracker[trade.id] > 0: |
|
|
|
self.trade_tracker[trade.id] = 0 |
|
|
|
|
|
|
|
if not trade.id in self.trade_tracker: |
|
|
|
self.trade_tracker[trade.id] = 0 |
|
|
|
self.trade_tracker[trade.id] = 0""" |
|
|
|
|
|
|
|
if not trade.is_gift(): |
|
|
|
return |
|
|
|