1
This commit is contained in:
parent
2424088dd1
commit
fdd98f0152
5
hlna.py
5
hlna.py
@ -379,7 +379,6 @@ def modextract(id_mod, id_game_workshop):
|
||||
return
|
||||
|
||||
for dirpath, dirnames, filenames in os.walk(mod_steam_workshop):
|
||||
print_line(dirnames)
|
||||
for dname in dirnames:
|
||||
os.makedirs(os.path.join(modextractdir, os.path.relpath(os.path.join(dirpath, dname), mod_steam_workshop)), exist_ok=True)
|
||||
# for fname in filenames:
|
||||
@ -395,6 +394,7 @@ def modextract(id_mod, id_game_workshop):
|
||||
srcfile = os.path.join(root, name)
|
||||
dstfile = os.path.join(modextractdir, os.path.relpath(srcfile, mod_steam_workshop))
|
||||
if not os.path.isfile(dstfile) or os.path.getmtime(srcfile) > os.path.getmtime(dstfile):
|
||||
print_line(dstfile)
|
||||
shutil.copy2(srcfile, dstfile)
|
||||
|
||||
modname = subprocess.check_output(['curl', '-s', 'https://steamcommunity.com/sharedfiles/filedetails/?id={}'.format(id_mod)]).decode('utf-8')
|
||||
@ -418,7 +418,8 @@ def modextract(id_mod, id_game_workshop):
|
||||
modpath = ("../../../" + "ShooterGame" + "/Content/Mods/" + id_mod + "\x00").encode('utf-8')
|
||||
modpathlen = len(modpath)
|
||||
modfile_bytes += struct.pack('<LLL{}sL{}sL'.format(modnamelen, modpathlen),
|
||||
int(id_mod), 0, modnamelen, modname, modpathlen, modpath, nummaps)
|
||||
int(id_mod), 0, modnamelen,
|
||||
modname, modpathlen, modpath, nummaps)
|
||||
for _ in range(nummaps):
|
||||
mapfilelen = struct.unpack_from('<L', data, offset=pos)
|
||||
mapfilelen = mapfilelen[0]
|
||||
|
Loading…
Reference in New Issue
Block a user