Ejemplo n.º 1
0
def es_map_start(event_var):
    for userid in es.getUseridList():
        playerlimit[userid] = 0
    if xasoundslist:
        if int(sounds_download) == 1:
            for sound in xasoundslist:
                es.stringtable('downloadables', 'sound/%s'%xasoundslist[sound])
Ejemplo n.º 2
0
def es_map_start(event_var):
    bomb_timer_setting.clear(int(bomb_timer_savetime)*86400)
    if int(bomb_timer_soundload):
        for keyname in bomb_timer_language.keys():
            if keyname.startswith('sound_'):
                for soundname in bomb_timer_language[keyname].keys():
                    es.stringtable('downloadables', 'sound/%s'%bomb_timer_language[keyname][soundname])
Ejemplo n.º 3
0
def makedownloadable(skinfile, skingroup):
    """ This function reads each model/material list files and makes them downloadable if cvar set.  Also returns model name """
    strPath = xaskins_skinfiles_path + skingroup + "/" + skinfile
    if not os.path.isfile(strPath):
        xaskins.logging.log(
            "Cannot find the text file which contains all the download files for skin %s"
            % skingroup)
        return None
    sp = open(xaskins_skinfiles_path + skingroup + "/" + skinfile, "r")
    for line in sp:
        line = line.strip()
        if not line.startswith('//') and bool(line):
            if not line.count("."):
                """ Allow users to just give us folder names """
                directory = os.path.join(xa.gamedir(), line)
                if os.path.isdir(directory):
                    for fileName in os.listdir(directory):
                        if skins_downloadable == 1:
                            es.stringtable("downloadables",
                                           line + "/" + fileName)
                        if fileName.endswith('.mdl'):
                            model = line + "/" + fileName
            else:
                if skins_downloadable == 1:
                    es.stringtable("downloadables", line)
                if line.endswith('.mdl'):
                    model = line
    return model
Ejemplo n.º 4
0
def makedownloadable(skinfile,skingroup):
    """ This function reads each model/material list files and makes them downloadable if cvar set.  Also returns model name """
    strPath = xaskins_skinfiles_path + skingroup + "/" + skinfile
    if not os.path.isfile(strPath):
        xaskins.logging.log("Cannot find the text file which contains all the download files for skin %s"%skingroup)
        return None
    sp = open(xaskins_skinfiles_path + skingroup + "/" + skinfile, "r")
    for line in sp:
        line = line.strip()
        if not line.startswith('//') and bool(line):
            if not line.count("."):
                """ Allow users to just give us folder names """
                directory = os.path.join(xa.gamedir(), line ) 
                if os.path.isdir(directory):
                    for fileName in os.listdir(directory):
                        if skins_downloadable == 1:
                            es.stringtable("downloadables", line + "/" + fileName)
                        if fileName.endswith('.mdl'):
                            model = line + "/" + fileName
            else:
                if skins_downloadable == 1:
                    es.stringtable("downloadables", line)
                if line.endswith('.mdl'):
                    model = line
    return model
Ejemplo n.º 5
0
def es_map_start(event_var):
    for userid in es.getUseridList():
        playerlimit[userid] = 0
    if xasoundslist:
        if int(sounds_download) == 1:
            for sound in xasoundslist:
                soundfile = str(xasoundslist[sound])
                es.stringtable("downloadables", "sound/" + sound)
Ejemplo n.º 6
0
def es_map_start(event_var):
    for userid in es.getUseridList():
        playerlimit[userid] = 0
    if xasoundslist:
        if int(sounds_download) == 1:
            for sound in xasoundslist:
                soundfile = str(xasoundslist[sound])
                es.stringtable('downloadables', 'sound/' + sound)
Ejemplo n.º 7
0
def es_map_start(event_var):
    bomb_timer_setting.clear(int(bomb_timer_savetime) * 86400)
    if int(bomb_timer_soundload):
        for keyname in bomb_timer_language.keys():
            if keyname.startswith('sound_'):
                for soundname in bomb_timer_language[keyname].keys():
                    es.stringtable(
                        'downloadables',
                        'sound/%s' % bomb_timer_language[keyname][soundname])
Ejemplo n.º 8
0
def es_map_start(event_var):
    quake_sounds_setting.clear(int(quake_sounds_savetime)*86400)
    quake_sounds_players = {}
    for userid in es.getUseridList():
        quake_sounds_players[userid] = {'kills':0,'multikills':0,'headshot':False,'headshots':0}
    if int(quake_sounds_soundload):
        for keyname in quake_sounds_kv:
            if (str(keyname) != 'styles') and ('sound' in quake_sounds_kv[str(keyname)]):
                for soundname in quake_sounds_kv[str(keyname)]['sound']:
                    es.stringtable('downloadables', 'sound/'+str(quake_sounds_kv[str(keyname)]['sound'][str(soundname)]))
    _check_event(event_var)
Ejemplo n.º 9
0
def es_map_start(event_var):
    global firstblood, quake_sounds
    firstblood = True
    for userid in es.getUseridList():
        playerkills[userid] = 0
        playertimes[userid] = 0
        playerheads[userid] = False
    if len(xaquakesoundslist) > 0:
        if int(quake_sounds_download) == 1:
            for sound in xaquakesoundslist:
                es.stringtable('downloadables', 'sound/%s'%xaquakesoundslist[sound])
    else:
        quake_sounds.set('0')
Ejemplo n.º 10
0
def es_map_start(event_var):
    global firstblood, quake_sounds
    firstblood = True
    for userid in es.getUseridList():
        playerkills[userid] = 0
        playertimes[userid] = 0
        playerheads[userid] = False
    if len(xaquakesoundslist) > 0:
        if int(quake_sounds_download) == 1:
            for sound in xaquakesoundslist:
                es.stringtable('downloadables', 'sound/%s'%xaquakesoundslist[sound])
    else:
        quake_sounds.set('0')
Ejemplo n.º 11
0
def es_map_start(event_var):
    quake_sounds_setting.clear(int(quake_sounds_savetime) * 86400)
    quake_sounds_players = {}
    for userid in es.getUseridList():
        quake_sounds_players[userid] = {
            'kills': 0,
            'multikills': 0,
            'headshot': False,
            'headshots': 0
        }
    if int(quake_sounds_soundload):
        for keyname in quake_sounds_kv:
            if (str(keyname) !=
                    'styles') and ('sound' in quake_sounds_kv[str(keyname)]):
                for soundname in quake_sounds_kv[str(keyname)]['sound']:
                    es.stringtable(
                        'downloadables', 'sound/' + str(quake_sounds_kv[str(
                            keyname)]['sound'][str(soundname)]))
    _check_event(event_var)
Ejemplo n.º 12
0
def stringtable(argv):
  es.stringtable(*argv)
Ejemplo n.º 13
0
def stringtable(argv):
    es.stringtable(*argv)
Ejemplo n.º 14
0
def doDownloads():
    for sound in (lmv_sound_gameplay_start,lmv_sound_gameplay_end,lmv_sound_mapvote_start,lmv_sound_mapvote_end,lmv_sound_random_map):
        if str(sound):
            es.stringtable('downloadables','sound/%s'%sound)
Ejemplo n.º 15
0
def make_downloadable(gg_loading=False):
    # Make the global variable winnerSounds global to this function in case we
    # use it below
    global winnerSounds

    # Is GunGame loading?
    if gg_loading:

        # Print message to server console
        es.dbgmsg(0, langstring('Load_SoundSystem'))

    # Make sure we are in a map
    if not in_map():
        return

    # Loop through all files in the sound_pack directory
    for f in iniDir.walkfiles():

        # Make sure the extension is ".ini"
        if f.ext.lower() != '.ini':
            continue

        # Grab the ConfigObj for the INI
        config = ConfigObj('%s/%s' % (iniDir, f.name))

        # Loop through all names (keys) in the INI
        for name in config:

            # Make sure the name isn't "title"
            if name.lower() == 'title':
                continue

            # Make sure that the sound file exists at the given path
            if sound_exists(config[name]):

                # Make the sound downloadable
                es.stringtable('downloadables', 'sound/%s' % config[name])

            else:

                # See if the file is a random sound text file
                if not iniDir.joinpath('random_sound_files',
                                       config[name]).isfile():
                    continue

                # If we are on a random winner sound, and we have more sounds
                # in the current list of random sounds, choose one and make it
                # downloadable
                if name == "winner" and winnerSounds:
                    # If there are winner sounds left in the shuffled list,
                    # remove the last used sound
                    if len(winnerSounds) > 1:
                        winnerSounds.pop(0)
                        # Make the new random winner sound downloadable
                        if sound_exists(winnerSounds[0]):
                            es.stringtable('downloadables',
                                           'sound/%s' % winnerSounds[0])
                        # If gg_dynamic_chattime is enabled, set the chattime
                        if int(gg_dynamic_chattime):
                            set_chattime()

                        continue
                    # If the last used winner sound is the only thing left,
                    # clear the list so that we can fill it below
                    winnerSounds = []

                # Open the random sound file
                with iniDir.joinpath('random_sound_files',
                                     config[name]).open() as randomFile:

                    randomSounds = randomFile.readlines()

                # Loop through all sounds in the file
                for sound in randomSounds:
                    # Remove the line return character and whitespace,
                    sound = sound.strip('\\n').strip()

                    # Do not add comment lines
                    if sound.startswith("//"):
                        continue

                    # If we are on a random winner sound, add it to the
                    # random winner sounds list
                    if name == "winner":
                        winnerSounds.append(sound)

                        # We will make the winner sound chosen for this round
                        # downloadable below this loop
                        continue

                    # Make sure that the sound file exists at the given path
                    if sound_exists(sound):
                        # Make the sound downloadable
                        es.stringtable('downloadables', 'sound/%s' % sound)

                # Now that we are done adding random winner sounds to
                # the winnerSounds list, choose one to make downloadable
                if name == "winner":
                    # Shuffle the list of new winner sounds
                    shuffle(winnerSounds)
                    # Make the new random winner sound downloadable
                    if sound_exists(winnerSounds[0]):
                        es.stringtable('downloadables',
                                       'sound/%s' % winnerSounds[0])
                    # If gg_dynamic_chattime is enabled, set the chattime
                    if int(gg_dynamic_chattime):
                        set_chattime()
Ejemplo n.º 16
0
def make_downloadable(gg_loading=False):
    # Make the global variable winnerSounds global to this function in case we
    # use it below
    global winnerSounds

    # Is GunGame loading?
    if gg_loading:

        # Print message to server console
        es.dbgmsg(0, langstring('Load_SoundSystem'))

    # Make sure we are in a map
    if not in_map():
        return

    # Loop through all files in the sound_pack directory
    for f in iniDir.walkfiles():

        # Make sure the extension is ".ini"
        if f.ext.lower() != '.ini':
            continue

        # Grab the ConfigObj for the INI
        config = ConfigObj('%s/%s' % (iniDir, f.name))

        # Loop through all names (keys) in the INI
        for name in config:

            # Make sure the name isn't "title"
            if name.lower() == 'title':
                continue

            # Make sure that the sound file exists at the given path
            if sound_exists(config[name]):

                # Make the sound downloadable
                es.stringtable('downloadables', 'sound/%s' % config[name])

            else:

                # See if the file is a random sound text file
                if not iniDir.joinpath(
                  'random_sound_files', config[name]).isfile():
                    continue

                # If we are on a random winner sound, and we have more sounds
                # in the current list of random sounds, choose one and make it
                # downloadable
                if name == "winner" and winnerSounds:
                    # If there are winner sounds left in the shuffled list,
                    # remove the last used sound
                    if len(winnerSounds) > 1:
                        winnerSounds.pop(0)
                        # Make the new random winner sound downloadable
                        if sound_exists(winnerSounds[0]):
                            es.stringtable(
                                'downloadables', 'sound/%s' % winnerSounds[0])
                        # If gg_dynamic_chattime is enabled, set the chattime
                        if int(gg_dynamic_chattime):
                            set_chattime()

                        continue
                    # If the last used winner sound is the only thing left,
                    # clear the list so that we can fill it below
                    winnerSounds = []

                # Open the random sound file
                with iniDir.joinpath(
                  'random_sound_files', config[name]).open() as randomFile:

                    randomSounds = randomFile.readlines()

                # Loop through all sounds in the file
                for sound in randomSounds:
                    # Remove the line return character and whitespace,
                    sound = sound.strip('\\n').strip()

                    # Do not add comment lines
                    if sound.startswith("//"):
                        continue

                    # If we are on a random winner sound, add it to the
                    # random winner sounds list
                    if name == "winner":
                        winnerSounds.append(sound)

                        # We will make the winner sound chosen for this round
                        # downloadable below this loop
                        continue

                    # Make sure that the sound file exists at the given path
                    if sound_exists(sound):
                        # Make the sound downloadable
                        es.stringtable('downloadables', 'sound/%s' % sound)

                # Now that we are done adding random winner sounds to
                # the winnerSounds list, choose one to make downloadable
                if name == "winner":
                    # Shuffle the list of new winner sounds
                    shuffle(winnerSounds)
                    # Make the new random winner sound downloadable
                    if sound_exists(winnerSounds[0]):
                        es.stringtable(
                            'downloadables', 'sound/%s' % winnerSounds[0])
                    # If gg_dynamic_chattime is enabled, set the chattime
                    if int(gg_dynamic_chattime):
                        set_chattime()
Ejemplo n.º 17
0
def es_map_start(ev):   
    for i in rpgParachuteDownloads:
        es.stringtable("downloadables", i) 
Ejemplo n.º 18
0
def load():    
    es.addons.registerTickListener(OnTick)
   
    for i in rpgParachuteDownloads:
        es.stringtable("downloadables", i) 
Ejemplo n.º 19
0
 def setdownloadables(self):
     es.stringtable("downloadables", "models/player/home net server/zombie/zombie_hc/t_arctic.xbox.vtx")
     es.stringtable("downloadables", "models/player/home net server/zombie/zombie_hc/t_arctic.vvd")
     es.stringtable("downloadables", "models/player/home net server/zombie/zombie_hc/t_arctic.sw.vtx")
     es.stringtable("downloadables", "models/player/home net server/zombie/zombie_hc/t_arctic.phy")
     es.stringtable("downloadables", "models/player/home net server/zombie/zombie_hc/t_arctic.mdl")
     es.stringtable("downloadables", "models/player/home net server/zombie/zombie_hc/t_arctic.dx90.vtx")
     es.stringtable("downloadables", "models/player/home net server/zombie/zombie_hc/t_arctic.dx80.vtx")
     es.stringtable("downloadables", "materials/models/player/home net server/zombie/zombie_hc/Zombie_Classic_sheet_normal.vtf")
     es.stringtable("downloadables", "materials/models/player/home net server/zombie/zombie_hc/Zombie_Classic_sheet.vtf")
     es.stringtable("downloadables", "materials/models/player/home net server/zombie/zombie_hc/Zombie_Classic_sheet.vmt")
     es.stringtable("downloadables", "materials/models/player/home net server/zombie/zombie_hc/t_leet_normal.vtf")
     es.stringtable("downloadables", "materials/models/player/home net server/zombie/zombie_hc/t_leet.vtf")
     es.stringtable("downloadables", "materials/models/player/home net server/zombie/zombie_hc/t_leet.vmt")
     es.stringtable("downloadables", "materials/models/player/home net server/zombie/zombie_hc/headcrabsheet_normal.vtf")
     es.stringtable("downloadables", "materials/models/player/home net server/zombie/zombie_hc/headcrabsheet.vtf")
     es.stringtable("downloadables", "materials/models/player/home net server/zombie/zombie_hc/headcrabsheet.vmt")