Skip to main content

Launchingserverpopup

Based on game build 714014 | Last updated: 2026-03-09

Overview

LaunchingServerPopup is a screen component that displays a waiting interface during the launch and initialization of a dedicated server. It extends GenericWaitingPopup and monitors the server process status via TheNet:GetChildProcessStatus() and error states via TheNet:GetChildProcessError(). Upon detecting completion (status 3) or failure (error or status 0/1), it triggers the appropriate callback and removes itself from the UI stack.

Usage example

local popup = LaunchingServerPopup(
serverinfo,
function(info) print("Server started:", info.name) end,
function() print("Server failed to start") end
)
TheFrontEnd:PushScreen(popup)

Dependencies & tags

Components used: None identified
Tags: None identified

Properties

PropertyTypeDefault ValueDescription
serverinfotablenilServer configuration data passed to successCallback on successful launch.
successCallbackfunctionnilCallback invoked when the server reaches ready status (status == 3).
errorCallbackfunctionnilCallback invoked when an error is detected (hasError == true).
launchtimenumberGetStaticTime()Timestamp when the popup is instantiated.
errorStartingServersbooleanfalseInternal flag set via SetErrorStartingServers() to force error state.
worldgenscreenScreen or nilnilPlaceholder reference; commented-out code suggests potential usage but is unused in current build.

Main functions

OnUpdate(dt)

  • Description: Periodically checks the server process status and error state. Updates the dialog title during world generation and triggers callbacks or screen removal based on status changes.
  • Parameters: dt (number) — time elapsed since last frame.
  • Returns: Nothing.
  • Error states: Performs screen removal and callback invocation under three conditions:
    • hasError is true: calls errorCallback(), pops itself and optionally worldgenscreen.
    • status == 2: updates dialog title to "SERVER_WORLDGEN".
    • status == 3: calls successCallback(serverinfo), pops itself.

OnCancel()

  • Description: Handles user-initiated cancellation. Stops all dedicated servers and removes the screen.
  • Parameters: None.
  • Returns: Nothing.

SetErrorStartingServers()

  • Description: Sets the internal errorStartingServers flag to true, forcing the popup to treat the next OnUpdate cycle as an error state.
  • Parameters: None.
  • Returns: Nothing.

Events & listeners

None identified