update __main__.py.
1.修正了部分版本无法启动的BUG 2.修复了部分文件无法下载BUG 3.修复了无法启动某些刚刚下载的新游戏文件BUG
This commit is contained in:
parent
de373cf404
commit
b7b9770709
61
__main__.py
61
__main__.py
@ -296,7 +296,10 @@ if(parser.type=="download_file"):
|
||||
count=0
|
||||
for i in range(0,urljson['number']):
|
||||
try:
|
||||
download(urljson['url'][count],pathjson['path'][count])
|
||||
filepath=pathjson['path'][count]
|
||||
dirpath=filepath.replace(os.path.basename(filepath),"")
|
||||
make_dir_exist(dirpath)
|
||||
download(urljson['url'][count],filepath)
|
||||
except:
|
||||
log("error","Some errors happened while downloading files,please check and try again.")
|
||||
count=count+1
|
||||
@ -305,6 +308,8 @@ if(parser.type=="download_file"):
|
||||
deadly_error()
|
||||
except:
|
||||
try:
|
||||
dirpath=parser.download_path.replace(os.path.basename(parser.download_path),"")
|
||||
make_dir_exist(dirpath)
|
||||
download(parser.download_url,parser.download_path)
|
||||
except:
|
||||
log("error","Some errors happened while downloading files,please check and try again.")
|
||||
@ -545,13 +550,30 @@ elif(parser.type=="launcher_game"):
|
||||
for i in range(0,game_config_json.count('"path"')):
|
||||
try:
|
||||
make_file_exist(dir_i + '\\libraries\\' + game_config['libraries'][number]['downloads']['artifact']['path'].replace('/','\\'),game_config['libraries'][number]['downloads']['artifact']['url'])
|
||||
make_file_exist(dir_i + '\\libraries\\' + game_config['libraries'][number]['downloads']['classifiers']['javadoc']['path'].replace('/','\\'),game_config['libraries'][number]['downloads']['classifiers']['javadoc']['url'])
|
||||
if(platform.system()=='Windows'):
|
||||
make_file_exist(dir_i + '\\libraries\\' + game_config['libraries'][number]['downloads']['classifiers']['natives-windows']['path'].replace('/','\\'),game_config['libraries'][number]['downloads']['classifiers']['natives-windows']['url'])
|
||||
try:
|
||||
make_file_exist(dir_i + '\\libraries\\' + game_config['libraries'][number]['downloads']['classifiers']['natives-windows']['path'].replace('/','\\'),game_config['libraries'][number]['downloads']['classifiers']['natives-windows']['url'])
|
||||
except:
|
||||
try:
|
||||
make_file_exist(dir_i + '\\libraries\\' + game_config['patches'][0]['libraries'][number]['downloads']['classifiers']['natives-windows']['path'].replace('/','\\'),game_config['patches'][0]['libraries'][number]['downloads']['classifiers']['natives-windows']['url'])
|
||||
except:
|
||||
pass
|
||||
elif(platform.system()=='Linux'):
|
||||
make_file_exist(dir_i + '\\libraries\\' + game_config['libraries'][number]['downloads']['classifiers']['natives-linux']['path'].replace('/','\\'),game_config['libraries'][number]['downloads']['classifiers']['natives-linux']['url'])
|
||||
try:
|
||||
make_file_exist(dir_i + '\\libraries\\' + game_config['libraries'][number]['downloads']['classifiers']['natives-linux']['path'].replace('/','\\'),game_config['libraries'][number]['downloads']['classifiers']['natives-linux']['url'])
|
||||
except:
|
||||
try:
|
||||
make_file_exist(dir_i + '\\libraries\\' + game_config['patches'][0]['libraries'][number]['downloads']['classifiers']['natives-linux']['path'].replace('/','\\'),game_config['patches'][0]['libraries'][number]['downloads']['classifiers']['natives-linux']['url'])
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
make_file_exist(dir_i + '\\libraries\\' + game_config['libraries'][number]['downloads']['classifiers']['natives-macos']['path'].replace('/','\\'),game_config['libraries'][number]['downloads']['classifiers']['natives-macos']['url'])
|
||||
try:
|
||||
make_file_exist(dir_i + '\\libraries\\' + game_config['libraries'][number]['downloads']['classifiers']['natives-macos']['path'].replace('/','\\'),game_config['libraries'][number]['downloads']['classifiers']['natives-macos']['url'])
|
||||
except:
|
||||
try:
|
||||
make_file_exist(dir_i + '\\libraries\\' + game_config['patches'][0]['libraries'][number]['downloads']['classifiers']['natives-macos']['path'].replace('/','\\'),game_config['patches'][0]['libraries'][number]['downloads']['classifiers']['natives-macos']['url'])
|
||||
except:
|
||||
pass
|
||||
except:
|
||||
pass
|
||||
number=number+1
|
||||
@ -565,17 +587,26 @@ elif(parser.type=="launcher_game"):
|
||||
try:
|
||||
unzip(dir_i + '\\libraries\\' + game_config['libraries'][number]['downloads']['classifiers']['natives-windows']['path'].replace('/','\\'),dir_i + '\\versions\\' + parser.version + '\\natives')
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
unzip(dir_i + '\\libraries\\' + game_config['patches'][0]['libraries'][number]['downloads']['classifiers']['natives-windows']['path'].replace('/','\\'),dir_i + '\\versions\\' + parser.version + '\\natives')
|
||||
except:
|
||||
pass
|
||||
elif(platform.system()=='Linux'):
|
||||
try:
|
||||
unzip(dir_i + '\\libraries\\' + game_config['libraries'][number]['downloads']['classifiers']['natives-linux']['path'].replace('/','\\'),dir_i + '\\versions\\' + parser.version + '\\natives')
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
unzip(dir_i + '\\libraries\\' + game_config['patches'][0]['libraries'][number]['downloads']['classifiers']['natives-linux']['path'].replace('/','\\'),dir_i + '\\versions\\' + parser.version + '\\natives')
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
try:
|
||||
unzip(dir_i + '\\libraries\\' + game_config['libraries'][number]['downloads']['classifiers']['natives-macos']['path'].replace('/','\\'),dir_i + '\\versions\\' + parser.version + '\\natives')
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
unzip(dir_i + '\\libraries\\' + game_config['patches'][0]['libraries'][number]['downloads']['classifiers']['natives-macos']['path'].replace('/','\\'),dir_i + '\\versions\\' + parser.version + '\\natives')
|
||||
except:
|
||||
pass
|
||||
number=number+1
|
||||
cp=""
|
||||
number=0
|
||||
@ -583,7 +614,10 @@ elif(parser.type=="launcher_game"):
|
||||
try:
|
||||
cp=cp + dir_i + '\\libraries\\' + game_config['libraries'][number]['downloads']['artifact']['path'].replace('/','\\') + ';'
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
cp=cp + dir_i + '\\libraries\\' + game_config['patches'][0]['libraries'][number]['downloads']['artifact']['path'].replace('/','\\') + ';'
|
||||
except:
|
||||
pass
|
||||
number=number+1
|
||||
cp=cp + dir_i + '\\versions\\' + parser.version + '\\' + parser.version + '.jar'
|
||||
return_data('Checking java environment.')
|
||||
@ -606,10 +640,13 @@ elif(parser.type=="launcher_game"):
|
||||
return_info.close()
|
||||
else:
|
||||
memory=parser.memory
|
||||
asset_index=game_config['assetIndex']['id']
|
||||
asset_index="1.16"
|
||||
command='\"' + java.replace('\n','') + '\" -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=16M -XX:-UseAdaptiveSizePolicy -XX:-OmitStackTraceInFastThrow -Xmn128m -Xmx' + memory + ' -Dfml.ignoreInvalidMinecraftCertificates=true -Dfml.ignorePatchDiscrepancies=true -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Djava.library.path=' + dir_i + '\\versions\\' + parser.version + '\\natives -Dminecraft.launcher.brand=' + config['default_launcher_name'] + ' -Dminecraft.launcher.version=' + config['version'] + ' -cp ' + cp + ' net.minecraft.client.main.Main --username ' + parser.id + ' --version "' + config['default_launcher_name'] + ' ' + config['version'] + '" --gameDir ' + dir_i + ' --assetsDir ' + dir_i + '\\assets --assetIndex ' + asset_index + ' --uuid ' + uuid + ' --accessToken ' + uuid + ' --userProperties {} --userType mojang'
|
||||
try:
|
||||
asset_index=game_config['assetIndex']['id']
|
||||
except:
|
||||
asset_index=game_config['patches'][0]['assetIndex']['id']
|
||||
command='\"' + java.replace('\n','') + '\" -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=16M -XX:-UseAdaptiveSizePolicy -XX:-OmitStackTraceInFastThrow -Xmn128m -Xmx' + memory + ' -Dfml.ignoreInvalidMinecraftCertificates=true -Dfml.ignorePatchDiscrepancies=true -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Djava.library.path=' + dir_i + '\\versions\\' + parser.version + '\\natives -Dminecraft.launcher.brand=' + config['default_launcher_name'] + ' -Dminecraft.launcher.version=' + config['version'] + ' -cp ' + cp + ' net.minecraft.client.main.Main --username ' + parser.id + ' --version "' + config['default_launcher_name'] + ' ' + config['version'] + '" --gameDir ' + dir_i + ' --assetsDir ' + dir_i + '\\assets --assetIndex ' + asset_index + ' --uuid ' + uuid + ' --accessToken ' + uuid + ' --userProperties {} --userType mojang --versionType "' + config['default_launcher_name'] + ' ' + config['version'] + '"'
|
||||
subprocess.Popen(command, shell=True)
|
||||
print(command)
|
||||
else:
|
||||
return_data('The version you input is not exist!Please check if the parameter you input is correct!')
|
||||
log('error','The vversion you input is not exist!Please check if the parameter you input is correct!')
|
||||
|
Reference in New Issue
Block a user