Browse Source

Ready TO conflict

marches
Anthony Rinaldo 4 years ago
parent
commit
0141be8122
  1. 2
      Worlds/Test1/map.json
  2. 21
      app/routes.py

2
Worlds/Test1/map.json

@ -1,3 +1,3 @@
{
"places": [ { "name":"Temple_Of_Constant_Explosions", "x":"0","y":"0", "r":"30"} ]
}

21
app/routes.py

@ -6,6 +6,12 @@ from items import get_items, get_worlds
from random import choice, sample
import re
import json
from shutil import copyfile
if sys.version_info.major < 3:
# XXX OOF
reload(sys)
@ -63,10 +69,19 @@ def marches():
@app.route("/marches/worlds/<world>")
def marchWorld(world):
worldDir = "../Worlds/"+world
worldDir = "../Worlds/"+world + "/"
#copy <worldname>.png from world.png into static
player_list = ["INVALID1","INVALID2","INVALID3"]
image_map = [(10,20,35),(50,40,20)] #(x,y,r)
copyfile(worldDir+"world.png","static/"+world+".png")
#player_list = ["INVALID1","INVALID2","INVALID3"]
empty = re.compile('^\s*$')
pfile = open(worldDir + "players.txt",'r')
pData = pfile.read().split('\n')
player_list = [ x for x in pData if not empty.match(x)]
pfile.close()
#image_map = [(10,20,35),(50,40,20)] #("place name",x,y,r)
mfile = open(worldDir + "map.json",'r')
mData = mfile.read()
image_map = [ (x['name'],x['x'],x['y'],x['r']) for x in json.loads(mData)['places']]
log_list = [("5/3/19",[("Josh Gordon","bottom text"),("Anthony Rinaldo","lorem ipsum")])] # :: [(Date,[(CharacterName,String)])]
return render_template("marchWorld.html",worldname=world,players=player_list,imap=image_map,logs=log_list)

Loading…
Cancel
Save