Author Topic: Tutorial - How to make a Dedicated Server (Batch File)  (Read 15286 times)

Server requests the master server for BLID 999's IP address, BLID 999 is connecting with a LAN address, and that's a mismatch so of course it can't verify you.

I actually wrote my post wrong before, I wrote when I hit query lan it still wont verify, I meant to write "query internet" instead....so know Im not sure to what to think of what your wrote.


do you people not realize that you get this exact same file by clicking a damn checkbox? The "how to make a dedicated server" question has been answered an uncountable number of times.

non stop punch packets

do you people not realize that you get this exact same file by clicking a damn checkbox? The "how to make a dedicated server" question has been answered an uncountable number of times.

I know, and people still find problems, thats why I made this

just a note

Program Files (x86) will only exist if you have a 64-bit computer or if you made it yourself.


EDIT:
you could also have a batch file like this to allow you to choose map when starting the server with a small modification

Code: [Select]
@echo off
SET /p map="Type in a map name:    "
C:\Program Files (x86)\Blockland\BlocklandLauncher.exe -dedicated -map %map%
forget you stole my post was going to say that

This dosn't work for me, when I do it the box imeditly closes.

do you people not realize that you get this exact same file by clicking a damn checkbox? The "how to make a dedicated server" question has been answered an uncountable number of times.
when i re-installed blockland to get v20, it came up with the checkbox. i checked both lan and internet dedicated checkboxes and installed.
then when i re-started my computer the files dissapeared the next time i started up my computer.
however, the normal blockland shortcut was still there.
so i had to do
make a shortcut with the following target:
"C:\Program Files (x86)\Blockland\BlocklandLauncher.exe" -dedicated -map SPAAAAAAACE

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
Code: [Select]
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.



To start off you first need to either Port Forward or enable an option called UPnP in Blockland and on your rotuer.
mentioning UPnP is just going to confuse someone, it's enabled by default anyway

Make it for mac?

I will try and get a mac version when I can use a mac, I dont have one but my one of my family members has one.