Lua functions

SendOptionWindow

Registered in this checkout as EQ2Emu_lua_SendOptionWindow; implementation found at WorldServer/Lua/LuaFunctions.cpp:6028.

Historical signature: SendOptionWindow(option_window, player, window_title, cancel_command)

Parameter and behavior details in the historical explanation are under review against the current implementation.

Function: SendOptionWindow(window, player, title[, cancel_command])

Attempts to send the owned choices from an option-window builder to its original Player operation.

Parameters:

  • window (OptionWindow): an open builder from CreateOptionWindow, with no more than 255 choices.
  • player (Player): the recipient Player.
  • title (string): nonempty window title.
  • cancel_command (string, optional): cancel command; defaults to an empty string.

Returns: None.

Invalid recipients/titles, no current matching connection, a missing client packet definition, and oversized builders leave the builder unconsumed. Once the packet definition and original Player/wire context are admitted, the builder transfers its values once before serialization/queue callbacks. Consumed or expired builders cannot be reused; failed serialization or rejected transport does not reopen one.

The native call owns the choice strings, title, cancel command and packet descriptor. A retained Player/connection and original wire context keep preparation tied to its admitted audience; reconnecting, changing scene or replacing the Player cannot send this packet to a successor. No builder lock is held through packet or transport services. Available fields and display still depend on the client's packet definition.

Checked example

Active call in a local runtime Lua script. Argument count matches current fixed C++ readers. This is a contextual call pattern, not a tested standalone script.

SendOptionWindow(window, Spawn, "Pledge allegiance to Qeynos?", "Cancel")

Evidence: server/SpawnScripts/IsleRefuge1/AmbassadorSaera.lua:160; binding EQ2Emu_lua_SendOptionWindow.

Current registration: WorldServer/Lua/LuaInterface.cpp. Historical explanation: EQ2Emu Lua documentation.