# HG changeset patch # User Nicholas Jillings # Date 1505391240 -3600 # Node ID b09e9b7ef246e7e83b61665810e4c341fddec8c8 # Parent c93687862a79c99047684248d9218149dee1b4e5# Parent cacc7f1cf062f8fd11cd8a23ab90c97e5b6d7752 Merge branch 'vnext' into Dev_main diff -r c93687862a79 -r b09e9b7ef246 js/core.js --- a/js/core.js Tue Sep 12 19:24:03 2017 +0100 +++ b/js/core.js Thu Sep 14 13:14:00 2017 +0100 @@ -3591,7 +3591,7 @@ returnURL = specification.projectReturn; } } - this.request.open("GET", returnURL + "php/requestKey.php", true); + this.request.open("GET", returnURL + "php/requestKey.php?saveFilenamePrefix=" + this.parent.filenamePrefix, true); this.request.addEventListener("load", this); this.request.send(); }, diff -r c93687862a79 -r b09e9b7ef246 php/requestKey.php --- a/php/requestKey.php Tue Sep 12 19:24:03 2017 +0100 +++ b/php/requestKey.php Thu Sep 14 13:14:00 2017 +0100 @@ -17,6 +17,13 @@ header("Pragma: no-cache"); // Get the current test URL +// Load up the parameters +$saveFilenamePrefix = ''; +if (isset($_GET['saveFilenamePrefix'])) { + $saveFilenamePrefix = $_GET['saveFilenamePrefix'].'-'; +} else { + $saveFilenamePrefix = "save-"; +} $testURL = ""; if (isset($_GET['url'])) { $testURL = "../".$_GET["url"]; @@ -47,7 +54,7 @@ } } -$filename = "../saves/save-".$key.".xml"; +$filename = "../saves/".$saveFilenamePrefix.$key.".xml"; $fileHandle = fopen($filename, 'w'); if ($fileHandle == FALSE) { die("ERROR".$key."Could not open file for writing"); diff -r c93687862a79 -r b09e9b7ef246 python/pythonServer.py --- a/python/pythonServer.py Tue Sep 12 19:24:03 2017 +0100 +++ b/python/pythonServer.py Thu Sep 14 13:14:00 2017 +0100 @@ -120,6 +120,14 @@ tempKey = ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(32)); if (os.path.isfile("saves/save-"+tempKey+".xml") == False): key = tempKey + options = s.path.rsplit('?') + options = options[1].rsplit('&') + for option in options: + optionPair = option.rsplit('=') + if optionPair[0] == "saveFilenamePrefix": + prefix = optionPair[1] + if prefix == None: + prefix = "save" s.send_response(200) s.send_header("Content-type", "application/xml"); s.end_headers() @@ -128,7 +136,7 @@ s.wfile.write(reply) elif sys.version_info[0] == 3: s.wfile.write(bytes(reply, "utf-8")) - file = open("../saves/save-"+key+".xml",'w') + file = open("../saves/"+prefix+"-"+key+".xml",'w') file.write("") file.close()