Exemplo n.º 1
0
 def __init__(self):
     self.state_warmup = True
     self.handle_flag = False
     self.checking = Repeat(self.players_quantity)
     self.players_to_start_sdm = settings.PAYERS_TO_START
     self.player_weapon = "weapon_glock"
     self.bot_weapon = "weapon_knife"
     self.single_player_weapon_restrict = WeaponRestrictionHandler()
Exemplo n.º 2
0
        'players': {
            'dummy': {
                'wcsadmin': 1,
                'wcsadmin_githubaccess': 1,
                'wcsadmin_managementaccess': 1,
                'wcsadmin_playersmanagement': 1,
                'wcsadmin_raceaccess': 1,
                'vip_raceaccess': 1
            }
        }
    }

    with open(CFG_PATH / 'privileges.json', 'w') as outputfile:
        json_dump(privileges, outputfile, indent=4)

_restrictions = WeaponRestrictionHandler()

# TODO: Should I even be using this?
_players = PlayerDictionary()

_global_bypass = False
_round_started = True
_delays = defaultdict(set)


# ============================================================================
# >> CLASSES
# ============================================================================
class _PlayerMeta(type):
    def __new__(mcs, name, bases, odict):
        cls = super().__new__(mcs, name, bases, odict)
Exemplo n.º 3
0
from config.manager import ConfigManager
from cvars import ConVar
from events import Event
from filters.weapons import WeaponClassIter
from listeners import OnServerActivate, OnLevelEnd, OnLevelInit
from messages import SayText2
from paths import CFG_PATH
from weapons.restrictions import WeaponRestrictionHandler

from .configs import _all_weapons, g_configs, g_configs_map
from .info import info

## GLOBALS

CONFIG_PATH = CFG_PATH / 'map_config'
restrict_handler = WeaponRestrictionHandler()
weapon_restrict_ct = []
weapon_restrict_t = []
cvar_list = dict()

## UTILS

def load_map_config(map_name):
    map_config = CONFIG_PATH / map_name + '.cfg'
    g_configs_map.clear()
    with open(map_config) as f:
        for line in f:
            line = line.strip()

            if not line or line.startswith('//'):
                continue