Skip to content

Commit fbcf230

Browse files
committed
1.52.2
1 parent ad835a0 commit fbcf230

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

changelog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
1.52.2:
2+
- Add the ability to change the server's java installation
3+
- Add the ability
14
1.52.1:
25
- Fix bug where you could not start servers by hand
36
- Fix corrupt library TAR archives since around v1.50

src/craftserversetup.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
VERSION_MANIFEST = "https://piston-meta.mojang.com/mc/game/version_manifest_v2.json"
66
BUNGEECORD_DOWNLOAD_URL = "https://ci.md-5.net/job/BungeeCord/lastStableBuild/artifact/bootstrap/target/BungeeCord.jar"
77
APP_VERSION = 1#The API Version.
8-
APP_UF_VERSION = "1.52.1"
8+
APP_UF_VERSION = "1.52.2"
99
#The semver version
1010
UPDATEINSTALLED = False
1111
DOCFILE = "https://github.com/Enderbyte-Programs/CraftServerSetup/raw/main/doc/craftserversetup.epdoc"
@@ -2026,6 +2026,15 @@ def write_package_file(packages:list,serverdir:str):
20262026
with open(assemble_package_file_path(serverdir),"w+") as f:
20272027
f.write(json.dumps({"date":datetime.datetime.now().strftime("%Y%m%d"),"packages":[{"name":z["name"],"id":z["id"]} for z in packages]},indent=2))
20282028

2029+
def clean_file_name(name:str) -> str:
2030+
ALLOWED_CHARACTERS = list("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.-")
2031+
fn_name = ""
2032+
for ch in name:
2033+
if ch in ALLOWED_CHARACTERS:
2034+
fn_name += ch
2035+
2036+
return fn_name
2037+
20292038
def spigot_api_manager(stdscr,modfolder:str,serverversion:str,serverdir:str):
20302039
final = []
20312040
headers = {
@@ -2086,7 +2095,7 @@ def spigot_api_manager(stdscr,modfolder:str,serverversion:str,serverdir:str):
20862095
_dloc[1] = _dloc[1].split(".")[1]
20872096
dloc = "/".join(_dloc)
20882097
try:
2089-
urllib.request.urlretrieve(f"https://api.spiget.org/v2/{dloc}",modfolder+"/"+pldat["name"]+".jar")
2098+
urllib.request.urlretrieve(f"https://api.spiget.org/v2/{dloc}",modfolder+"/"+clean_file_name(pldat["name"])+".jar")
20902099
except:
20912100
cursesplus.messagebox.showerror(stdscr,["There was an error downloading","the plugin. You may have to download it manually."])
20922101

@@ -2516,7 +2525,7 @@ def manage_server_icon(stdscr):
25162525
pass
25172526

25182527
def config_server(stdscr,chosenserver):
2519-
__l = crss_custom_ad_menu(stdscr,["Cancel","Modify server.properties","Modify CRSS Server options","Reset server configuration","Extra configuration","Rename Server","Change Server Memory","Startup Options"])#Todo rename server, memory
2528+
__l = crss_custom_ad_menu(stdscr,["Cancel","Modify server.properties","Modify CRSS Server options","Reset server configuration","Extra configuration","Rename Server","Change Server Memory","Startup Options","Change Java Installation"])#Todo rename server, memory
25202529
if __l == 0:
25212530
updateappdata()
25222531
return
@@ -2571,6 +2580,12 @@ def config_server(stdscr,chosenserver):
25712580
APPDATA["servers"][chosenserver-1] = startup_options(stdscr,APPDATA["servers"][chosenserver-1])
25722581
APPDATA["servers"][chosenserver-1]["script"]=generate_script(APPDATA["servers"][chosenserver-1])#Regen script
25732582

2583+
elif __l == 8:
2584+
njavapath = choose_java_install(stdscr)
2585+
APPDATA["servers"][chosenserver-1]["javapath"] = njavapath
2586+
APPDATA["servers"][chosenserver-1]["script"]=generate_script(APPDATA["servers"][chosenserver-1])#Regen script
2587+
2588+
25742589
def change_software(stdscr,directory,data) -> dict:
25752590
zxc = crss_custom_ad_menu(stdscr,["Cancel","Vanilla","Spigot","Paper","Purpur"],"Please choose the new software for the server")
25762591
if zxc == 0:

0 commit comments

Comments
 (0)