Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MultiplayerGameTime

Hierarchy

Index

Constructors

constructor

Methods

deserialize

  • deserialize(data: any): any

getEstimatedTotalSimulationDelaySeconds

  • getEstimatedTotalSimulationDelaySeconds(): any
  • Returns the estimated total simulation delay (i.e. how much the slowest client is behind compared to the fastest) in seconds

    Returns any

getInternalSimulatedFrame

  • getInternalSimulatedFrame(): any
  • Returns the frame we are currently simulating internally

    Returns any

getIsPaused

  • getIsPaused(): boolean

getIsWaitingForNewFrame

  • getIsWaitingForNewFrame(): boolean
  • Returns if we are currently waiting for a new frame, that is, we can not render

    Returns boolean

getIsWaitingForOpponentsSimulation

  • getIsWaitingForOpponentsSimulation(): boolean
  • Returns if our opponent is behind (time wise) and we have to wait for him

    Returns boolean

getIsWithinGracePeriod

  • getIsWithinGracePeriod(): boolean

getRemainingGracePeriodSeconds

  • getRemainingGracePeriodSeconds(): number

getSpeed

  • getSpeed(): any
  • Returns any

getTimeMs

  • getTimeMs(): number
  • Returns the ingame time in milliseconds

    Returns number

getTimeMultiplierWithSlowdown

  • getTimeMultiplierWithSlowdown(): 0 | 1 | 0.25
  • Returns how much to slow down the game time in order to make the other client catch up

    Returns 0 | 1 | 0.25

grantLogicFrame

  • grantLogicFrame(index: any): void
  • Grants a new logic frame, callback from the server

    Parameters

    • index: any

    Returns void

handleForcedResync

  • handleForcedResync(frameId: any): void
  • Handles a forced resync

    Parameters

    • frameId: any

    Returns void

isIngameTimerExpired

  • isIngameTimerExpired(lastTick: any, tickRateSeconds: any): boolean
  • Safe check to check if a timer is expired. quantizes numbers

    Parameters

    • lastTick: any

      Last tick of the timer

    • tickRateSeconds: any

      Interval of the timer in seconds

    Returns boolean

now

  • now(): any
  • Returns ingame time in seconds

    Returns any

    seconds

performTicks

  • performTicks(deltaMs: any, updateMethod: any): void
  • Performs game ticks

    Parameters

    • deltaMs: any
    • updateMethod: any

    Returns void

realtimeNow

  • realtimeNow(): any
  • Returns "real" time in seconds

    Returns any

    seconds

reinitializeRngSeeds

  • reinitializeRngSeeds(): void
  • Re-initializes the Random Number Generators so they are synchronized

    Returns void

requestSpeedToggle

  • requestSpeedToggle(): void

sendSimulationResult

  • sendSimulationResult(): void
  • Sends a new simuation result to the serve

    Returns void

serialize

  • serialize(): object

setSpeed

  • setSpeed(speed: any): void
  • You can not set the speed in multiplayer

    Parameters

    • speed: any

    Returns void

systemNow

  • systemNow(): number
  • Returns "real" time in seconds

    Returns number

    seconds

updateRealtimeNow

  • updateRealtimeNow(): void
  • Fetches the new "real" time, called from the core once per frame, since performance now() is kinda slow

    Returns void

înternalAddDeltaToBudget

  • înternalAddDeltaToBudget(deltaMs: any): void
  • Internal method to generate new logic time budget

    Parameters

    • deltaMs: any

    Returns void

Static getCachedSchema

  • getCachedSchema(): any

Static getId

  • getId(): string

Static getSchema

  • getSchema(): object

Static verify

  • verify(data: any): string