-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
36 lines (25 loc) · 836 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Import system modules
import sys, os
import gdheroku
# default port: 4202
gdheroku.create_port_file()
# Boot Web Server
# ============================
port = 3000
try:
port = int(os.environ["PORT"])
except KeyError:
print "Please set the environment variable PORT"
sys.exit(1)
os.system("python2 -m SimpleHTTPServer "+str(port)+ " &")
os.system("export DREAMLIGHTSERVER=666")
# Boot Game Server
# ================
# Locate the tarball, it should be a neighbor
tarball = os.path.join(os.path.dirname(os.path.realpath(__file__)), "server.tar.gz")
os.system("cp " + tarball + " " + tarball + ".old")
os.system("tar -zxvf " + tarball)
os.system("mv " + tarball + ".old " + tarball)
server = os.path.join(os.path.dirname(os.path.realpath(__file__)), "heroku_server.sh")
os.system("chmod +x "+server)
os.system(server)