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:
-
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 theoptions_form
. -
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 theoptions_form
.
To conclude:
options_form
is suited to customize what options to present based on the userpre_spawn_hook
is suited to customize what final settings to configure based on the choices the user made in the presentedoptions_form
.