Skip to main content
The Deno 2 Release Candidate is here
Learn more
class EventOutputHolder
import { EventOutputHolder } from "https://deno.land/x/sptaki@1.2.0/routers/EventOutputHolder.d.ts";

Constructors

new
EventOutputHolder(
jsonUtil: JsonUtil,
profileHelper: ProfileHelper,
timeUtil: TimeUtil,
)

Properties

protected
clientActiveSessionStorage: Record<string, { clientInformed: boolean; }>

What has client been informed of this game session

protected
jsonUtil: JsonUtil
protected
output: IItemEventRouterResponse
protected
profileHelper: ProfileHelper
protected
timeUtil: TimeUtil

Methods

protected
cleanUpCompleteCraftsInProfile(productions: Record<string, Productive>): void

Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started

protected
constructTraderRelations(traderData: Record<string, TraderInfo>): Record<string, TraderData>

Convert the internal trader data object into an object we can send to the client

Return all hideout Improvements from player profile, adjust completed Improvements' completed property to be true

protected
getProductionsFromProfileAndFlagComplete(productions: Record<string, Productive>): Record<string, Productive>

Return productions from player profile except those completed crafts the client has already seen

resetOutput(sessionID: string): void

Reset the response object to a default state Occurs prior to event being handled by server

updateOutputProperties(sessionId: string): void

Update output object with most recent values from player profile