When I want to set up a new dedicated server, I create a folder for it, paste key.dat into it and add the following file:
update.py
import sys, subprocess, urllib2, os, hashlib
def update(manifestPath):
print "Downloading manifest...",
try:
manifestRequest = urllib2.Request(manifestPath, headers={"User-Agent": "blocklandWIN/2.0"})
manifestFile = urllib2.urlopen(manifestRequest)
manifest = manifestFile.readlines(False)
except IOError:
print "ERROR"
return
except _socket.error:
print "ERROR"
return
print "DONE"
print "Processing manifest...",
downloadPath = manifest[0].split("\t")[1].strip()
files = {}
open("ignored.txt", "a")
ignoredFiles = open("ignored.txt").readlines(False)
ignoredFiles2 = []
for item in ignoredFiles:
ignoredFiles2.append(item.strip())
ignoredFiles = ignoredFiles2
del ignoredFiles2
for i in manifest[1:]:
i = i.strip()[1:].split("\t")
digest = ""
if os.path.exists(i[0]):
digest = hashlib.sha1()
digest.update(open(i[0], "rb").read())
digest = digest.hexdigest()
if i[0] not in ignoredFiles and digest.lower() != i[1].lower():
files[i[0]] = i[1]
print "DONE"
downloadedFiles = 0
for i in files:
downloadedFiles += 1
print "Downloading " + i + " (file " + str(downloadedFiles) + "/" + str(len(files)) + ")...",
download = urllib2.urlopen(downloadPath + "/" + files[i])
folders = i.split("/")[:-1]
for j in range(len(folders)):
path = "/".join(folders[:j + 1])
if not os.path.exists(path):
os.mkdir(path)
open(i, "wb").write(download.read())
print "DONE"
update("http://update.blockland.us/latestVersion.php")
if '-updateOnly' not in sys.argv:
process = subprocess.Popen(["Blockland.exe", "ptlaaxobimwroe"] + sys.argv[1:])
I create a shortcut to it named launch with these arguments: -dedicated -map whatever
I create a shortcut to it named update with these arguments: -updateOnly
Then, I run the 'update' shortcut, wait for it to download all the files, run the 'launch' shortcut, wait for the server to start fully and type quit();.
Then, I edit files in config/server to change things such as enabled add-ons, quotas, port, server name, max players, etc.
When I want to start the server, I simply run the 'launch' shortcut.
This method is rather advanced and requires Python 2.7, but it allows for running dedicated servers on computers with such low graphics hardware that they cannot display the launcher. This runs more than five times faster than the normal launcher in any case, and allows you to add file paths to the 'ignored.txt' file to easily use custom content.