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