Tailoring spawn options and server configuration to certain users

Problem 1 is about customizing the options presented to a user, and you can’t do that in the pre_spawn_hook. The pre_spawn_hook that is invoked after the user has been presented with options and made choices about presented server options.

The order of events of relevance are:

  1. A user is presented with server options

    Providing a custom options_form function makes these options render based on custom logic that can be user specific. It would be too late to use a pre_spawn_hook in this case, because those are triggered after the user has been presented and provided input via the options_form.

  2. A user has opted to start a server with some chosen entry from the options_form.

    Providing a pre_spawn_hook function enables to take further actions based on the choice(s) made in the options_form.

To conclude:

  • options_form is suited to customize what options to present based on the user
  • pre_spawn_hook is suited to customize what final settings to configure based on the choices the user made in the presented options_form.
1 Like