Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MultiplayerClientActionManager

Hierarchy

Index

Constructors

constructor

Methods

computeTimeForNegotiation

  • computeTimeForNegotiation(): number
  • Compute time which should be safe for an action to execute on all clients respecting the RTT and additional delay

    Returns number

    Offset in seconds to wait

handleContinueGameAfterResync

  • handleContinueGameAfterResync(packet: any): void
  • Handles the confirmation from the server when all clients finished the resync so we may continue the game

    Parameters

    • packet: any

    Returns void

handleForcedResync

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

    Parameters

    • packet: any

    Returns void

handleGrantLogicFramePacket

  • handleGrantLogicFramePacket(packet: any): void
  • Handles a newly granted logic frame

    Parameters

    • packet: any

    Returns void

handleValidationAndPerformPacket

  • handleValidationAndPerformPacket(packet: any): boolean
  • Handles another clients action and validates it

    Parameters

    • packet: any

    Returns boolean

hasDuplicate

  • hasDuplicate(action: any): boolean
  • Checks if there is already a duplicate action which is not yet confirmed by the server

    Parameters

    • action: any

    Returns boolean

internalPushPendingAction

  • internalPushPendingAction(pendingAction: any): void
  • Pushes a new pending action

    Parameters

    • pendingAction: any

    Returns void

internalTryExecuteActionAsyncCallback

  • internalTryExecuteActionAsyncCallback(pendingAction: any): void
  • Tries to execute the given action, called in an async task

    Parameters

    • pendingAction: any

    Returns void

processActionsAfterResync

  • processActionsAfterResync(): void
  • Filters all actions and tries to reply aborted actions

    Returns void

tryPerform

  • tryPerform(action: any, negotiations?: number, scheduledTime?: any): any
  • Tries to perform the given action

    Parameters

    • action: any
    • Default value negotiations: number = 0

      Optionally specifies how often the action has been negotiated so far

    • Default value scheduledTime: any = null

      Optionally specifiy the time to schedule the action

    Returns any

update

  • update(): void