()
Description: Initiate the application by asking questions.
Description: Initiate the application by asking questions.
Description : Initiate the application by asking questions .
def init():
    """Description: Initiate the application by asking questions."""
    ui.info(ui.yellow, constants.Strings.sever_starting.value)
    port = int(ui.ask_string(constants.Strings.server_port.value))
    max_players = int(ui.ask_string(constants.Strings.server_maxp.value))
    if max_players < 4:
        # If the maximum players allowed on the server is less than 4
        # which is the minimum required for a pommerman match then
        # notify the user about that and quit.
        ui.fatal(ui.yellow, constants.Strings.server_playercount_too_low.value)
    modes = []
    for i in pommerman.configs.__dir__():
        if i[-4:] == "_env":
            id = getattr(pommerman.configs, i)()["env_id"]
            if id[-2:] != "v2":
                modes.append(id)
    timeout = float(ui.ask_string(constants.Strings.server_timeout.value))
    mode = str(ui.ask_choice(constants.Strings.server_mode.value, modes))
    run(port, max_players, timeout, mode, ui_en=True, exit_handler=True)
def init ( ) : ui . info ( ui . yellow , constants . Strings . sever_starting . value ) port = int ( ui . ask_string ( constants . Strings . server_port . value ) ) max_players = int ( ui . ask_string ( constants . Strings . server_maxp . value ) ) if max_players < 4 : # If the maximum players allowed on the server is less than 4 # which is the minimum required for a pommerman match then # notify the user about that and quit. ui . fatal ( ui . yellow , constants . Strings . server_playercount_too_low . value ) modes = [ ] for i in pommerman . configs . __dir__ ( ) : if i [ - 4 : ] == "_env" : id = getattr ( pommerman . configs , i ) ( ) [ "env_id" ] if id [ - 2 : ] != "v2" : modes . append ( id ) timeout = float ( ui . ask_string ( constants . Strings . server_timeout . value ) ) mode = str ( ui . ask_choice ( constants . Strings . server_mode . value , modes ) ) run ( port , max_players , timeout , mode , ui_en = True , exit_handler = True )