Skip to main content
The Deno 2 Release Candidate is here
Learn more
class RagfairOfferService
Re-export
import { RagfairOfferService } from "https://deno.land/x/sptaki@1.2.0/services/mod.ts";

Constructors

new
RagfairOfferService(
logger: ILogger,
timeUtil: TimeUtil,
databaseServer: DatabaseServer,
saveServer: SaveServer,
ragfairServerHelper: RagfairServerHelper,
profileHelper: ProfileHelper,
eventOutputHolder: EventOutputHolder,
httpResponse: HttpResponseUtil,
localisationService: LocalisationService,
configServer: ConfigServer,
)

Properties

protected
configServer: ConfigServer
protected
databaseServer: DatabaseServer
protected
eventOutputHolder: EventOutputHolder
protected
expiredOffers: Record<string, IRagfairOffer>

Offer id + offer object

protected
httpResponse: HttpResponseUtil
protected
localisationService: LocalisationService
protected
logger: ILogger
protected
playerOffersLoaded: boolean
protected
profileHelper: ProfileHelper
protected
ragfairConfig: IRagfairConfig
protected
ragfairOfferHandler: RagfairOfferHolder
protected
ragfairServerHelper: RagfairServerHelper
protected
saveServer: SaveServer
protected
timeUtil: TimeUtil

Methods

protected
processStaleOffer(staleOffer: IRagfairOffer): void

Remove stale offer from flea

protected
returnPlayerOffer(playerOffer: IRagfairOffer): void
addOffer(offer: IRagfairOffer): void
addOfferToExpired(staleOffer: IRagfairOffer): void
doesOfferExist(offerId: string): boolean

Does the offer exist on the ragfair

Get an array of arrays of expired offer items + children

Get total count of current expired offers

Get all offers

getOffersOfType(templateId: string): IRagfairOffer[]
removeAllOffersByTrader(traderId: string): void
removeOfferById(offerId: string): void

Remove an offer from ragfair by offer id

removeOfferStack(offerId: string, amount: number): void

Reduce size of an offer stack by specified amount

Clear out internal expiredOffers dictionary of all items

traderOffersNeedRefreshing(traderID: string): boolean

Do the trader offers on flea need to be refreshed