import { TraderController } from "https://deno.land/x/sptaki@1.2.0/controllers/mod.ts";
Constructors
new
TraderController(logger: ILogger,
timeUtil: TimeUtil,
databaseServer: DatabaseServer,
traderAssortHelper: TraderAssortHelper,
profileHelper: ProfileHelper,
traderHelper: TraderHelper,
traderAssortService: TraderAssortService,
traderPurchasePersisterService: TraderPurchasePersisterService,
fenceService: FenceService,
fenceBaseAssortGenerator: FenceBaseAssortGenerator,
jsonUtil: JsonUtil,
configServer: ConfigServer,
Properties
protected
configServer: ConfigServerprotected
databaseServer: DatabaseServerprotected
fenceBaseAssortGenerator: FenceBaseAssortGeneratorprotected
fenceService: FenceServiceprotected
jsonUtil: JsonUtilprotected
logger: ILoggerprotected
profileHelper: ProfileHelperprotected
timeUtil: TimeUtilprotected
traderAssortHelper: TraderAssortHelperprotected
traderAssortService: TraderAssortServiceprotected
traderConfig: ITraderConfigprotected
traderHelper: TraderHelperprotected
traderPurchasePersisterService: TraderPurchasePersisterServiceMethods
protected
sortByTraderId(traderA: ITraderBase, traderB: ITraderBase): numberOrder traders by their traderId (Ttid)
getAllTraders(sessionID: string): ITraderBase[]
Handle client/trading/api/traderSettings Return an array of all traders
getAssort(sessionId: string, traderId: string): ITraderAssort
Handle client/trading/api/getTraderAssort
getTrader(sessionID: string, traderID: string): ITraderBase
Handle client/trading/api/getTrader
load(): void
Runs when onLoad event is fired Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService Store timestamp of next assort refresh in nextResupply property of traders .base object
update(): boolean
Runs when onUpdate is fired If current time is > nextResupply(expire) time of trader, refresh traders assorts and Fence is handled slightly differently