Beispiel #1
0
class MigrationTest(AppConfig):
    SETTING_1 = Setting('test_setting_1', 'Setting 1', Setting.CAT_GENERAL)
    SETTING_2 = Setting('test_setting_2',
                        'Integer test',
                        Setting.CAT_OTHER,
                        type=int,
                        default=-1)
    SETTING_3 = Setting('test_setting_3',
                        'Set test',
                        Setting.CAT_FEATURES,
                        type=set,
                        default=set())
    SETTING_4 = Setting(
        'test_setting_4',
        'Enable this or that',
        Setting.CAT_FEATURES,
        type=bool,
        description=
        'Large description that should break into multiple lines when displaying to the clients. Please test if this is the case at all.. Large description that should break into multiple lines when displaying to the clients. Please test if this is the case at all. Large description that should break into multiple lines when displaying to the clients. Please test if this is the case at all. Large description that should break into multiple lines when displaying to the clients. Please test if this is the case at all.'
    )
    SETTING_5 = Setting('test_setting_5',
                        'Set test',
                        Setting.CAT_FEATURES,
                        type=set,
                        default=set())

    async def on_start(self):
        await self.context.setting.register(self.SETTING_1, self.SETTING_2,
                                            self.SETTING_3, self.SETTING_4,
                                            self.SETTING_5)
Beispiel #2
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.current_bills = dict()
        self.min_donation = 10
        self.public_appreciation = 100
        self.lock = asyncio.Lock()

        self.widget = DonationToolbarWidget(self)

        self.setting_display_widget = Setting(
            'donation_widget',
            'Display Donation Widget',
            Setting.CAT_DESIGN,
            type=bool,
            default=True,
            description='Display the donation widget to the players',
            change_target=self.reload_settings,
        )
        self.setting_display_widget_podium_only = Setting(
            'donation_widget_podium',
            'Display Donation Widget only during podiums',
            Setting.CAT_BEHAVIOUR,
            type=bool,
            default=True,
            description=
            'Enabling this will only display the donation widget on the podium '
            '(requires the other setting to be enabled as well)',
            change_target=self.reload_settings)
Beispiel #3
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.current_votes = []
        self.current_karma = 0.0
        self.current_karma_percentage = 0.0
        self.current_karma_positive = 0.0
        self.current_karma_negative = 0.0
        self.widget = None

        self.setting_expanded_voting = Setting(
            'expanded_voting',
            'Expanded voting',
            Setting.CAT_BEHAVIOUR,
            type=bool,
            description='Expands the karma voting to use --, -, +-, + and ++.',
            default=False)

        self.setting_finishes_before_voting = Setting(
            'finishes_before_voting',
            'Finishes before voting',
            Setting.CAT_BEHAVIOUR,
            type=int,
            description=
            'Amount of times a player should finish before being allowed to vote.',
            default=0)

        self.mx_karma = MXKarma(self)
Beispiel #4
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.current_rankings = []
        self.points_repartition = []
        self.current_finishes = []
        self.widget = None
        self.dedimania_enabled = False

        self.setting_rankings_amount = Setting(
            'rankings_amount',
            'Amount of rankings to display',
            Setting.CAT_BEHAVIOUR,
            type=int,
            description='Amount of live rankings to display (minimum: 15).',
            default=15)
        self.setting_nadeo_live_ranking = Setting(
            'nadeo_live_ranking',
            'Show the Nadeo live rankings widget',
            Setting.CAT_BEHAVIOUR,
            type=bool,
            description=
            'Show the Nadeo live rankings widgets besides the live rankings widget.',
            default=True,
            change_target=self.nadeo_widget_change)
Beispiel #5
0
    def __init__(self, app):
        self.app = app
        self.api = MXKarmaApi(self)

        self.current_count = 0
        self.current_average = 0.0
        self.current_start = datetime.datetime.now()
        self.current_votes = None

        self.setting_mx_karma = Setting(
            'mx_karma',
            'Enable MX Karma',
            Setting.CAT_BEHAVIOUR,
            type=bool,
            description=
            'Enabling MX Karma will provide you with global karma information from ManiaExchange.',
            default=False,
            change_target=self.reload_settings)

        self.setting_mx_karma_key = Setting(
            'mx_karma_key',
            'MX Karma API Key',
            Setting.CAT_BEHAVIOUR,
            type=str,
            description=
            'Enabling MX Karma will provide you with global karma information from ManiaExchange.',
            default=None,
            change_target=self.reload_settings)
Beispiel #6
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.api = MXApi()

        self.namespace = 'mx'
        self.site_name = 'ManiaExchange'
        self.site_short_name = 'MX'
        self.award_widget = None

        self.setting_mx_key = Setting(
            'mx_key',
            'ManiaExchange/TrackmaniaExchange Key',
            Setting.CAT_KEYS,
            type=str,
            default=None,
            description=
            'Is only required when you want to download from a private group/section!'
        )
        self.setting_display_award_widget = Setting(
            'display_award_widget',
            'Display the award widget on podium',
            Setting.CAT_BEHAVIOUR,
            type=bool,
            description=
            'Whether to display the widget linking to the MX award page on podium.',
            default=True)
Beispiel #7
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.setting_records_required = Setting(
            'minimum_records_required',
            'Minimum records to acquire ranking',
            Setting.CAT_BEHAVIOUR,
            type=int,
            description=
            'Minimum of records required to acquire a rank (minimum 3 records).',
            default=5)

        self.setting_chat_announce = Setting(
            'rank_chat_announce',
            'Display server ranks on map start',
            Setting.CAT_BEHAVIOUR,
            type=bool,
            description=
            'Whether to display the server rank on every map start.',
            default=True)

        self.setting_topranks_limit = Setting(
            'topranks_limit',
            'Maximum rank to display in topranks',
            Setting.CAT_BEHAVIOUR,
            type=int,
            description='Amount of ranks to display in the topranks view.',
            default=100)
Beispiel #8
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.lock = asyncio.Lock()
        self.jukebox = []
        self.folder_manager = FolderManager(self)

        # Settings.
        self.setting_newest_days_range = Setting(
            'newest_days_range',
            'Number of days for a map to be new',
            Setting.CAT_BEHAVIOUR,
            type=int,
            description=
            'The number of days to a map should be visible in the newest mapfolder (defaults to 14 days).',
            default=14,
            change_target=self.folder_manager.update_folders)

        self.setting_allow_juking = Setting(
            'allow_juking',
            'Allow juking of maps by players',
            Setting.CAT_BEHAVIOUR,
            type=bool,
            description='Allow juking maps by non-admin players.',
            default=True,
        )
Beispiel #9
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.widget = None
        self.api = None

        self.lock = asyncio.Lock()
        self.current_records = []
        self.current_script = None
        self.player_info = dict()

        self.v_replay = None
        self.v_replay_checks = None
        self.ghost_replay = None
        self.ghost_files = []

        self.server_max_rank = None
        self.map_status = None
        self.map_uid = None
        self.ready = False

        self.setting_server_login = Setting(
            'server_login',
            'Dedimania Server Login',
            Setting.CAT_KEYS,
            type=str,
            description=
            'Only fill in when you want to override the auto-detected server login!',
            default=None,
            change_target=self.reload_settings)
        self.setting_dedimania_code = Setting(
            'dedimania_code',
            'Dedimania Server Code',
            Setting.CAT_KEYS,
            type=str,
            description=
            'The secret dedimania code. Get one at their site: $lhttp://dedimania.net/tm2stats/?do=register',
            default=None,
            change_target=self.reload_settings)

        self.setting_chat_announce = Setting(
            'chat_announce',
            'Minimum index for chat announce',
            Setting.CAT_BEHAVIOUR,
            type=int,
            description=
            'Minimum record index needed for public new record/recordchange announcement (0 for disable).',
            default=50)
        self.setting_sent_announce = Setting(
            'sent_announce',
            'Announce sending times to dedimania',
            Setting.CAT_BEHAVIOUR,
            type=bool,
            description=
            'Enable the announce of successfully sent records to dedimania message.',
            default=False)

        self.login = self.code = self.server_version = self.pack_mask = None
Beispiel #10
0
	def __init__(self, *args, **kwargs):
		super().__init__(*args, **kwargs)

		self.current_vote = None
		self.widget = None
		self.podium_stage = False

		self.setting_voting_enabled = Setting(
			'voting_enabled', 'Voting enabled', Setting.CAT_BEHAVIOUR, type=bool,
			description='Whether or not chat-based voting is enabled.',
			default=True
		)

		self.setting_voting_ratio = Setting(
			'voting_ratio', 'Voting ratio', Setting.CAT_BEHAVIOUR, type=float,
			description='Ratio of players that have to vote in favour for the vote to go through (between 0 and 1).',
			default=0.6
		)

		self.setting_callvoting_disable = Setting(
			'callvoting_disable', 'Disable callvoting', Setting.CAT_BEHAVIOUR, type=bool,
			description='Disable callvoting when chat-based voting is enabled.',
			default=True
		)

		self.setting_callvoting_timeout = Setting(
			'callvoting_timeout', 'Callvote time-out (chat disabled)', Setting.CAT_BEHAVIOUR, type=int,
			description='Callvote time-out in milliseconds, set when the chat-voting plugin is disabled (0 = disabled).',
			default=60000
		)

		self.setting_enabled_replay = Setting(
			'enabled_replay', 'Replay vote enabled', Setting.CAT_BEHAVIOUR, type=bool,
			description='Whether or not the replay vote is enabled.',
			default=True
		)

		self.setting_enabled_restart = Setting(
			'enabled_restart', 'Restart vote enabled', Setting.CAT_BEHAVIOUR, type=bool,
			description='Whether or not the restart vote is enabled.',
			default=True
		)

		self.setting_enabled_skip = Setting(
			'enabled_skip', 'Skip vote enabled', Setting.CAT_BEHAVIOUR, type=bool,
			description='Whether or not the skip vote is enabled.',
			default=True
		)

		self.setting_enabled_time_extend = Setting(
			'enabled_time_extend', 'Time Extend vote enabled', Setting.CAT_BEHAVIOUR, type=bool,
			description='Whether or not the time extend vote is enabled (only works in TimeAttack mode).',
			default=True
		)

		self.setting_remind_interval = Setting(
			'remind_interval', 'Vote reminder interval', Setting.CAT_BEHAVIOUR, type=int,
			description='Interval in seconds before players are reminded to vote.',
			default=30
		)
Beispiel #11
0
	def __init__(self, *args, **kwargs):
		super().__init__(*args, **kwargs)

		self.setting_enable_join_msg = Setting(
			'enable_join_message', 'Enable player join messages', Setting.CAT_FEATURES, type=bool, default=True,
			description='Enable this to announce that a player has joined the server.'
		)
		self.setting_enable_leave_msg = Setting(
			'enable_leave_message', 'Enable player leave messages', Setting.CAT_FEATURES, type=bool, default=True,
			description='Enable this to announce that a player has left the server.'
		)
Beispiel #12
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self.time_view = VoteTimeView(self, manager=self.context.ui)
     self.next_map_call = '''
         <methodCall>
             <methodName>NextMap</methodName>
         </methodCall>
     '''
     self.res_map_call = '''
                 <methodCall>
                     <methodName>RestartMap</methodName>
                 </methodCall>
             '''
     self.time_vote_call = '''
                 <methodCall>
                     <methodName>Echo</methodName>
                     <params>
                         <param>
                             <value><string>Play this map an additional hour?</string></value>
                         </param>
                         <param>
                             <value><string>teemann_add_time</string></value>
                         </param>
                     </params>
                 </methodCall>
             '''
     self.player_votes = {}
     self.time_limit = -1
     self.vote_time_limit = self.time_limit
     self.setting_show_bt = Setting(
         'chatvotes_show_bt',
         'Button request time',
         Setting.CAT_DESIGN,
         type=bool,
         description='Show the button to request more time',
         change_target=self.reload,
         default=True)
     self.setting_vote_time_ratio = Setting(
         'chatvotes_time_ratio',
         'Time vote ratio',
         Setting.CAT_GENERAL,
         type=float,
         description='The ratio needed for the additional-time-vote'
         'to pass. 0.5 = 50%',
         default=0.5)
     self.setting_vote_time_timeout = Setting(
         'chatvotes_time_timeout',
         'Time vote timeout',
         Setting.CAT_GENERAL,
         type=int,
         description='The timeout of the additional-time-vote'
         'in milliseconds.',
         default=90000)
Beispiel #13
0
	async def test_validating(self):
		instance = Controller.prepare(name='default').instance
		await instance.db.connect()
		await instance.apps.discover()

		test_1 = Setting('test1', 'Test 1', Setting.CAT_GENERAL, type=str)
		await instance.setting_manager.register(
			test_1
		)

		with self.assertRaises(SerializationException) as context:
			await test_1.set_value(True)
		assert isinstance(context.exception, SerializationException)

		with self.assertRaises(SerializationException) as context:
			await test_1.set_value(1)
		assert isinstance(context.exception, SerializationException)

		with self.assertRaises(SerializationException) as context:
			await test_1.set_value(float(55))
		assert isinstance(context.exception, SerializationException)

		with self.assertRaises(SerializationException) as context:
			await test_1.set_value(dict())
		assert isinstance(context.exception, SerializationException)

		with self.assertRaises(SerializationException) as context:
			await test_1.set_value(list())
		assert isinstance(context.exception, SerializationException)

		value = test_1.get_value(refresh=True)
		assert value is not True
Beispiel #14
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.bot = None
        self.chat_id = None

        self.setting_bot_key = Setting(
            'bot_key', 'Telegram Bot Key', Setting.CAT_KEYS, type=str,
            description='Telegram Bot Key',
            default=None, change_target=self.reload_settings
        )

        self.setting_target_chat = Setting(
            'target_group', 'Telegram Target Group', Setting.CAT_KEYS, type=str,
            description='Telegram Target Group Key',
            default=None, change_target=self.reload_settings
        )
Beispiel #15
0
	def __init__(self, *args, **kwargs):
		super().__init__(*args, **kwargs)
		self.api = MXApi()

		self.setting_mx_key = Setting(
			'mx_key', 'ManiaExchange Key', Setting.CAT_KEYS, type=str, default=None,
			description='Is only required when you want to download from a private group/section!'
		)
Beispiel #16
0
	def __init__(self, *args, **kwargs):
		super().__init__(*args, **kwargs)
		self.lock = asyncio.Lock()

		self.current_records = []
		self.widget = None

		self.setting_chat_announce = Setting(
			'chat_announce', 'Minimum index for chat announce', Setting.CAT_BEHAVIOUR, type=int,
			description='Minimum record index needed for public new record/recordchange announcement (0 for disable).',
			default=50
		)

		self.setting_record_limit = Setting(
			'record_limit', 'Local Records limit', Setting.CAT_BEHAVIOUR, type=int,
			description='Limit for the amount of Local Records displayed in-game (0 for disable).',
			default=100
		)
Beispiel #17
0
	def __init__(self, *args, **kwargs):
		super().__init__(*args, **kwargs)

		self.setting_emoji_toolbar = Setting(
			'emoji_toolbar', 'Display Emoji Toolbar', Setting.CAT_DESIGN, type=bool, default=True,
			description='Display the Emoji Toolbar to users.',
			change_target=self.reload_settings
		)

		self.emoji_toolbar = EmojiToolbarView(self)
Beispiel #18
0
	async def test_registration(self):
		instance = Controller.prepare(name='default').instance
		await instance.db.connect()
		await instance.apps.discover()

		test_1 = Setting('test1', 'Test 1', Setting.CAT_GENERAL, type=str)
		await instance.setting_manager.register(
			test_1
		)
		setting_list = await instance.setting_manager.get_all()
		assert test_1 in setting_list
	def __init__(self, *args, **kwargs):
		super().__init__(*args, **kwargs)
		
		self.setting_dynatime_active = Setting(
			'dynatime_active', 'Dynatime Active', Setting.CAT_BEHAVIOUR, type=bool,
			description='Activate Dynamic Round timer based on map bronze time',
			default=True
		)

		self.setting_dynatime_announce = Setting(
			'dynatime_accounce', 'Dynatime Accounce', Setting.CAT_BEHAVIOUR, type=bool,
			description='Announce the current timelimit at the start of each round',
			default=True
		)
		
		self.setting_dynatime_multiplier = Setting(
			'dynatime_multiplier', 'Dynatime Multiplier', Setting.CAT_BEHAVIOUR, type=int,
			description='Multiply map bronze time by this amount to get round timer',
			default=5
		)
Beispiel #20
0
	def __init__(self, *args, **kwargs):
		super().__init__(*args, **kwargs)

		self.sector_widget = SectorTimesWidget(self)
		self.cp_widget = CheckpointDiffWidget(self)
		self.gear_view = GearIndicatorView(self)

		self.setting_enable_gear_indicator = Setting(
			'gear_indicator', 'Enable Gear Indicator', Setting.CAT_FEATURES, type=bool, default=True,
			description='Enable the Gear Indicator View in Stadium based titles',
			change_target=self.reload_settings
		)
		self.gear_view_possible = False
Beispiel #21
0
	def __init__(self, app):
		"""
		:param app: App instance.
		:type app: pyplanet.apps.contrib.admin.app.Admin
		"""
		self.app = app
		self.instance = app.instance

		self.setting_juke_after_adding = Setting(
			'juke_after_adding', 'Juke map after adding to the server', Setting.CAT_BEHAVIOUR, type=bool,
			description='Add the map just added from file or MX to the jukebox.',
			default=True
		)
Beispiel #22
0
    def __init__(self, app):
        self.app = app
        self.instance = app.instance

        self.view = ToolbarView(self.app)

        self.setting_enable_toolbar = Setting(
            'enable_toolbar',
            'Enable the race control toolbar',
            Setting.CAT_DESIGN,
            type=bool,
            description=
            'Enable and show the race control toolbar for admins (all players with level above player level).',
            default=True)
Beispiel #23
0
	def __init__(self, *args, **kwargs):
		super().__init__(*args, **kwargs)

		# Initiate the logo views.
		self.paypal_view = PayPalLogoView(self, manager=self.context.ui)
		self.discord_view = DiscordLogoView(self, manager=self.context.ui)

		self.paypal_donation_url = None
		self.discord_join_url = None
		self.discord_server_id = None

		# Initiate settings.
		self.setting_enable_paypal = Setting(
			'paypal_enable', 'Show PayPal Donation Logo', Setting.CAT_DESIGN, type=bool,
			description='Show the PayPal logo with clickable link to donation page', change_target=self.reload_settings,
			default=False
		)
		self.setting_paypal_url = Setting(
			'paypal_url', 'PayPal Donation URL', Setting.CAT_KEYS, type=str,
			description='Your personalized PayPal donation link.', change_target=self.reload_settings,
		)

		self.setting_enable_discord = Setting(
			'discord_enable', 'Show Discord Logo', Setting.CAT_DESIGN, type=bool,
			description='Show the Discord logo with clickable link to join the server', change_target=self.reload_settings,
			default=False
		)
		self.setting_discord_join_url = Setting(
			'discord_url', 'Discord Invite URL', Setting.CAT_KEYS, type=str,
			description='Set the link to not expire in discord for this to keep working!',
			default='https://discord.gg/x9amg5K', change_target=self.reload_settings
		)
		self.setting_discord_server_id = Setting(
			'discord_id', 'Discord Server ID', Setting.CAT_KEYS, type=str,
			description='Get your discord server ID and enable the widget in the discord server settings!',
			default='158349559959912448', change_target=self.reload_settings
		)
Beispiel #24
0
	def __init__(self, *args, **kwargs):
		super().__init__(*args, **kwargs)

		# Initiate the logo views.
		self.paypal_view = PayPalLogoView(self, manager=self.context.ui)
		self.discord_view = DiscordLogoView(self, manager=self.context.ui)

		self.paypal_donation_url = None
		self.discord_join_url = None
		self.discord_server_id = None

		self.random_future = None

		# Initiate settings.
		self.setting_enable_paypal = Setting(
			'paypal_enable', 'Show PayPal Donation Logo', Setting.CAT_DESIGN, type=bool,
			description='Show the PayPal logo with clickable link to donation page', change_target=self.reload_settings,
			default=False
		)
		self.setting_paypal_url = Setting(
			'paypal_url', 'PayPal Donation URL', Setting.CAT_KEYS, type=str,
			description='Your personalized PayPal donation link.', change_target=self.reload_settings,
		)

		self.setting_enable_discord = Setting(
			'discord_enable', 'Show Discord Logo', Setting.CAT_DESIGN, type=bool,
			description='Show the Discord logo with clickable link to join the server', change_target=self.reload_settings,
			default=False
		)
		self.setting_discord_join_url = Setting(
			'discord_url', 'Discord Invite URL', Setting.CAT_KEYS, type=str,
			description='Set the link to not expire in discord for this to keep working!',
			default='https://discord.gg/x9amg5K', change_target=self.reload_settings
		)
		self.setting_discord_server_id = Setting(
			'discord_id', 'Discord Server ID', Setting.CAT_KEYS, type=str,
			description='Get your discord server ID and enable the widget in the discord server settings!',
			default='158349559959912448', change_target=self.reload_settings
		)

		self.setting_random_messages = Setting(
			'random_messages', 'Random Messages', Setting.CAT_BEHAVIOUR, type=list,
			description='Show random messages at random moments in the chat. '
						'The messages will be displayed every time the interval passes (another setting).',
			default=None, change_target=self.reload_settings
		)
		self.setting_random_messages_interval = Setting(
			'random_messages_interval', 'Random Messages Interval', Setting.CAT_BEHAVIOUR, type=int,
			description='The interval of the random messages in seconds. Default 2 minutes (120 seconds)',
			default=120, change_target=self.reload_settings
		)
Beispiel #25
0
	def __init__(self, app):
		"""
		:param app: App instance.
		:type app: pyplanet.apps.contrib.admin.app.Admin
		"""
		self.app = app
		self.instance = app.instance

		self.view = ToolbarView(self.app)

		self.setting_enable_toolbar = Setting(
			'enable_toolbar', 'Enable the admin toolbar', Setting.CAT_DESIGN, type=bool,
			description='Enable and show the admin toolbar for admins (all players with level above player level).',
			default=True
		)
Beispiel #26
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.current_votes = []
        self.current_karma = 0
        self.current_positive_votes = 0
        self.current_negative_votes = 0
        self.widget = None

        self.setting_finishes_before_voting = Setting(
            'finishes_before_voting',
            'Finishes before voting',
            Setting.CAT_BEHAVIOUR,
            type=int,
            description=
            'Amount of times a player should finish before being allowed to vote.',
            default=0)
Beispiel #27
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self.manialinks = None
     self.msg_view = MessagesView(self)
     self.msg_loop_task = None
     self.chat_messages = []
     self.msg_interval_setting = Setting(
         'messages_interval',
         'Messages interval',
         Setting.CAT_BEHAVIOUR,
         type=int,
         description='The time between the chat messages in seconds',
         default=60 * 5,
         change_target=self.interval_changed)
     self.loop = None
     self.lock = asyncio.Lock(loop=self.loop)
     self.msg_index = 0
Beispiel #28
0
	async def test_saving(self):
		instance = Controller.prepare(name='default').instance
		await instance.db.connect()
		await instance.apps.discover()

		test_1 = Setting('test1', 'Test 1', Setting.CAT_GENERAL, type=str)
		await instance.setting_manager.register(
			test_1
		)

		expected = 'test1'
		await test_1.set_value('test1')
		cached = await test_1.get_value(refresh=False)
		real = await test_1.get_value(refresh=True)

		assert cached == expected
		assert real == expected
Beispiel #29
0
    def __init__(self, *args, **kwargs):
        """
		Initializes the plugin.
		"""
        super().__init__(*args, **kwargs)
        self.context.signals.listen(mp_signals.flow.podium_start,
                                    self.podium_start)
        self.mod_url = "http://www.maniapark.com/download/mods/TMT_stadium.zip"

        self.setting_mod_url = Setting(
            'mod_url',
            'Mod Url',
            Setting.CAT_KEYS,
            type=str,
            description=
            'The mod link to be forced (Skip the map to apply the mod change).',
        )
Beispiel #30
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.lock = asyncio.Lock()
        self.context.signals.listen(mp_signals.map.map_end, self.map_end)
        self.server = None
        self.current_song_index = 0
        self.current_song = None
        self.songs = []
        self.list_view = None
        self.playlist = []
        self.playlist_view = None

        self.setting_override_map_music = Setting(
            'override_map_music',
            'Override map music',
            Setting.CAT_BEHAVIOUR,
            type=bool,
            description='Whether to override the map music.',
            default=True)