コード例 #1
0
ファイル: config.py プロジェクト: theendsofinvention/esst
class ATISConfig(SentryConfigContext):
    """
    Configuration for the ATIS package
    """

    ATIS_CREATE = elib_config.ConfigValueBool(
        'atis',
        'create',
        description='create ATIS mp3 files when starting ESST',
        default=True,
    )

    UR_PATH = elib_config.ConfigValueString(
        'atis',
        'ur_path',
        description='Path to UR config folder (usually found in Saved Games)',
        default='')

    DEFAULT_ICAO = elib_config.ConfigValueString(
        'atis',
        'default_icao',
        description=
        'When generating the weather from a MIZ file, there is no way to know what ICAO to use.'
        'By default, ESST will use the "XXXX" ICAO to indicate that. However, that generates '
        'weather reports fro "unknown airport (XXXX)". To avoid that, you can define a fallback '
        'value for the ICAO, using a "dummy" ICAO for MIZ generated weathers.',
        default='XXXX')
コード例 #2
0
class ServerConfig(SentryConfigContext):
    """
    Manages configuration for the server monitor
    """
    SERVER_START_LOOP = elib_config.ConfigValueBool(
        'server',
        'enable',
        description='Enable server monitoring',
        default=True)
コード例 #3
0
ファイル: config.py プロジェクト: theendsofinvention/esst
class ListenerConfig(SentryConfigContext):
    """
    Manages configuration for the socket daemon
    """

    LISTENER_START_LOOP = elib_config.ConfigValueBool(
        'listener',
        'enable',
        description='Enable the socket daemon used to communicate with DCS',
        default=True)
コード例 #4
0
class ESSTConfig(SentryConfigContext):
    """
    Main ESST config values
    """
    DEBUG = elib_config.ConfigValueBool(
        'debug',
        description='outputs debug messages to console',
        default=False)

    SAVED_GAMES_DIR = elib_config.ConfigValueString(
        'saved_games_folder',
        description='Path to the "Saved Games" folder (no trailing "DCS")',
        default='')
コード例 #5
0
ファイル: config.py プロジェクト: theendsofinvention/esst
class DiscordBotConfig(SentryConfigContext):
    """
    Manages Discord bot configuration
    """
    DISCORD_START_BOT = elib_config.ConfigValueBool(
        'discord',
        'enable',
        description='Enable the Discord bot',
        default=True,
    )

    DISCORD_BOT_NAME = elib_config.ConfigValueString(
        'discord',
        'bot_name',
        description='Name of the discord bot',
        default='Mr Shiny')

    DISCORD_MOTD = elib_config.ConfigValueString(
        'discord',
        'motd',
        description=
        '"Message of the day" that will be printed when the bot joins a Discord channel',
        default='')

    DISCORD_CHANNEL = elib_config.ConfigValueString(
        'discord',
        'channel',
        description='Name of the Discord channel the bot should join',
    )

    # FIXME: add documentation link
    DISCORD_TOKEN = elib_config.ConfigValueString(
        'discord', 'token', description='Discord bot token')

    DISCORD_ADMIN_ROLES = elib_config.ConfigValueList(
        'discord',
        'admin_roles',
        description=
        'Roles on your server that have admin privileges over the server through the bot',
        element_type=str,
        default=[])
コード例 #6
0
ファイル: config.py プロジェクト: theendsofinvention/esst
class DCSConfig(SentryConfigContext):
    """
    DCS config values
    """
    DCS_START_LOOP = elib_config.ConfigValueBool(
        'dcs',
        'enable',
        description='Enable DCS starting & monitoring',
        default=True)

    DCS_CAN_START = elib_config.ConfigValueBool(
        'dcs', 'can_start', description='Allow DCS to start', default=True)

    DCS_PATH = elib_config.ConfigValueString(
        'dcs', 'install_path', description='Installation path of DCS.')

    DCS_IDLE_CPU_USAGE = elib_config.ConfigValueInteger(
        'dcs',
        'idle_cpu_usage',
        description=
        'Expected maximum CPU usage (in percent) of an idling dcs.exe process.',
        default=5)

    DCS_HIGH_CPU_USAGE = elib_config.ConfigValueInteger(
        'dcs',
        'high_cpu_usage',
        description=
        'Threshold for high CPU usage alert (in percent). Set to 0 to disable alerts.',
        default=0)

    DCS_HIGH_CPU_USAGE_INTERVAL = elib_config.ConfigValueInteger(
        'dcs',
        'high_cpu_usage_check_interval',
        description=
        'Interval in seconds between high DCS CPU usage (in seconds).',
        default=5)

    DCS_PING_INTERVAL = elib_config.ConfigValueInteger(
        'dcs',
        'ping_interval',
        description=
        'Interval, in seconds, between pings to check if DCS is alive & healthy',
        default=30)

    DCS_CLOSE_GRACE_PERIOD = elib_config.ConfigValueInteger(
        'dcs',
        'close_grace_period',
        description=
        'Amount of time, in seconds, given for DCS to close itself gracefully. '
        'Passed that delay, the dcs.exe process will be forcefully killed.',
        default=30)

    DCS_START_GRACE_PERIOD = elib_config.ConfigValueInteger(
        'dcs',
        'start_grace_period',
        description=
        'Amount of time, in seconds, given for DCS to start. Passed that delay, the DCS.exe will be'
        'considered "hung" and restarted.',
        default=150)

    DCS_CPU_AFFINITY = elib_config.ConfigValueList(
        'dcs',
        'affinity',
        description=
        'List of (logical) cores (as integers) to set DCS affinity to. '
        'Examples for logical cores 5 & 7 of a 4 physical cores CPU: [4, 6]',
        default=[],
        element_type=int)

    DCS_CPU_PRIORITY = elib_config.ConfigValueString(
        'dcs',
        'priority',
        description=
        'CPU priority for the DCS process (valid values are: "idle", "below_normal", '
        '"normal", "above_normal", "high", and "realtime"',
        default='high')

    DCS_MAX_LOG_AGE = elib_config.ConfigValueInteger(
        'dcs',
        'max_log_age',
        description=
        'Set a maximum age (in days) for DCS logs to be kept. Set to 0 to disable.',
        default=0)

    DCS_AUTO_MISSION_GH_OWNER = elib_config.ConfigValueString(
        'dcs',
        'auto_mission_gh_owner',
        description=
        'Owner of the Github repository to grab the latest MIZ file from',
        default='')

    DCS_AUTO_MISSION_GH_REPO = elib_config.ConfigValueString(
        'dcs',
        'auto_mission_gh_repo',
        description='Github repository to grab the latest MIZ file from',
        default='')

    DCS_AUTO_MISSION_ENABLE = elib_config.ConfigValueBool(
        'dcs',
        'enable_auto_mission',
        description='Enable pulling latest version of a mission from Github',
        default=False)

    DCS_INSTALL_HOOKS = elib_config.ConfigValueBool(
        'dcs',
        'install_hooks',
        description='Install DCS API hook LUA script at startup',
        default=True)

    DCS_INSTALL_DEDICATED_CONFIG = elib_config.ConfigValueBool(
        'dcs',
        'install_dedicated_config',
        description='Install dedicated.lua config script at startup',
        default=True)
コード例 #7
0
class DCSServerConfig(SentryConfigContext):
    """
    DCS server config values
    """
    public = elib_config.ConfigValueBool(
        'dcs_server', 'public',
        description='Whether the server will be shown in the public multiplayer lobby or not '
                    '(valid values: true, false)',
        default=True
    )

    requires_pure_clients = elib_config.ConfigValueBool(
        'dcs_server', 'integrity_check', 'requires_pure_client',
        description='Integrity check that prevents player from joining the server if they have modded scripts '
                    'in the units database. '
                    'Please see https://forums.eagle.ru/showthread.php?p=3387574 for more info about the '
                    'integrity check',
        default=False
    )

    requires_pure_textures = elib_config.ConfigValueBool(
        'dcs_server', 'integrity_check', 'requires_pure_textures',
        description='Integrity check that prevents player from joining the server if they have modded textures. '
                    'Please see https://forums.eagle.ru/showthread.php?p=3387574 for more info about the '
                    'integrity check',
        default=False
    )

    requires_pure_models = elib_config.ConfigValueBool(
        'dcs_server', 'integrity_check', 'requires_pure_models',
        description='Integrity check that prevents player from joining the server if they have modded models. '
                    'Please see https://forums.eagle.ru/showthread.php?p=3387574 for more info about the '
                    'integrity check',
        default=False
    )

    # SHUFFLE_MISSION_LIST = elib_config.ConfigValueBool(
    #     'dcs_server', 'shuffle_mission_list',
    #     description='Shuffles the list of missions on the server',
    #     default=False
    # )

    description = elib_config.ConfigValueString(
        'dcs_server', 'description',
        description='DCS server description (WARNING: this seems to be an undocumented DCS feature; use at your '
                    'own risk)',
        default=''
    )

    allow_change_tail_number = elib_config.ConfigValueBool(
        'dcs_server', 'allow', 'change_tail_number',
        description='Allow players to change their own tail number.',
        default=True
    )

    allow_change_skin = elib_config.ConfigValueBool(
        'dcs_server', 'allow', 'change_skin',
        description='Allow players to change their own skin.',
        default=True
    )

    allow_export_own_ship = elib_config.ConfigValueBool(
        'dcs_server', 'export', 'own_ship',
        description='Allow export of data about players own aircraft.',
        default=True
    )

    allow_export_objects = elib_config.ConfigValueBool(
        'dcs_server', 'export', 'objects',
        description='Allow export of data about objects in DCS World.',
        default=True
    )

    allow_export_sensors = elib_config.ConfigValueBool(
        'dcs_server', 'export', 'sensors',
        description='Allow export of data from onboard sensors.',
        default=True
    )

    pause_on_load = elib_config.ConfigValueBool(
        'dcs_server', 'pause', 'on_load',
        description='Start the server in a paused state.',
        default=False
    )

    pause_without_client = elib_config.ConfigValueBool(
        'dcs_server', 'pause', 'without_client',
        description='Automatically pause the server when the last client disconnects.',
        default=False
    )

    pause_resume_mode = elib_config.ConfigValueInteger(
        'dcs_server', 'pause', 'resume_mode',
        description='Select the "resume" (i.e. un-pause) behaviour for the server. '
                    '0: manually pause/un-pause, '
                    '1: un-pause on server start, '
                    '2: un-pause when a player connects to the server',
        default=1
    )

    report_takeoff = elib_config.ConfigValueBool(
        'dcs_server', 'report', 'takeoff',
        description='Display a server-wide message when a player takes off.',
        default=False
    )

    report_role_change = elib_config.ConfigValueBool(
        'dcs_server', 'report', 'role_change',
        description='Display a server-wide message when a player changes role.',
        default=False
    )

    report_connect = elib_config.ConfigValueBool(
        'dcs_server', 'report', 'connection',
        description='Display a server-wide message when a player connects to the server.',
        default=True
    )

    report_eject = elib_config.ConfigValueBool(
        'dcs_server', 'report', 'ejection',
        description='Display a server-wide message when a player ejects.',
        default=False
    )

    report_kill = elib_config.ConfigValueBool(
        'dcs_server', 'report', 'kill',
        description='Display a server-wide message when a player destroys another object.',
        default=False
    )

    report_crash = elib_config.ConfigValueBool(
        'dcs_server', 'report', 'crash',
        description='Display a server-wide message when a player crashes their own aircraft.',
        default=False
    )

    outbound_limit = elib_config.ConfigValueInteger(
        'dcs_server', 'connection', 'outbound_rate_limit',
        description='Limit, in bytes, for client outbound rate (0 means deactivated).',
        default=0
    )

    inbound_limit = elib_config.ConfigValueInteger(
        'dcs_server', 'connection', 'inbound_rate_limit',
        description='Limit, in bytes, for client inbound rate (0 means deactivated).',
        default=0
    )

    max_ping = elib_config.ConfigValueInteger(
        'dcs_server', 'connection', 'max_ping',
        description='Maximum allowed client ping in milliseconds (0 to disable).',
        default=0
    )

    port = elib_config.ConfigValueString(
        'dcs_server', 'connection', 'port',
        description='Port the DCS server will be listening to.',
        default='10308'
    )

    bind_address = elib_config.ConfigValueString(
        'dcs_server', 'connection', 'bind_address',
        description='Binds the DCS server to a specific network interface (leave empty to allow all interfaces).',
        default=''
    )

    name = elib_config.ConfigValueString(
        'dcs_server', 'name',
        description='Public name of the DCS server.'
    )

    password = elib_config.ConfigValueString(
        'dcs_server', 'password',
        description='Prevent players without password from connecting to the server.',
        default=''
    )

    max_players = elib_config.ConfigValueInteger(
        'dcs_server', 'max_player_count',
        description='Maximum amount of players allowed on the server at the same time.',
        default=16
    )